If you look at the trace when a queue is processed there are several methods that fire before the PerfomMaterialMovement. I assume one of them does the needed setup. I spotted an OkToProcess also.
here is a post using the methods in a customization that should be close.