Game Loop
The previous chapter described the custom_ui. This chapter will lay out the game loop. We start with the template code supplied by OmniStep:
Start
The start method is called once when the OmniStep operator begins running. This is where you can initialize variables, call methods, and define private variables. The core class passed to this method is described in the next chapter
Update
The update method is called every frame. This method corresponds to the viewport update, not the Blender timeline. In this template, when the user presses the action1 input ( Left Mouse by default), it displays the state of the variable example_var the bottom of the viewport.
Late Update
There is an additional optional method called late_update, which is called after the player and the animation data is updated. This can be useful for correcting elements that 'lag' behind the player for a single frame.
Here is an excerpt of the OmniStep update loop showing the positions of the update and late_update functions for both UserScripts and Modules:
Done
The done method is called once when you end or abort the operator. The done method has an additional parameter: canceled, a boolean that indicates whether the user pressed Esc or Enter (or the 'Alternate Done' Key).