vCSript has some predefined events
| Method |
Parameters |
Description |
| OnFinalize |
|
Called after all components are loaded or copied |
| OnRebuild |
|
Called when a component's geometry is rebuilt (initially after loading)
|
| OnStart |
|
First event to be triggered when simulation is started |
| OnRun |
|
This is the main loop. Called when
simulation is started. |
| OnStop |
|
Called when the simulation is halted |
| OnContinue |
|
Called when the simulation continues after being halted |
| OnReset |
|
Called when the simulation is reset |
| OnSignal |
vcSignal
signal |
Signal handler. Called when a signal connected to the script is received.
|
| OnSimulationUpdate |
real time |
Called simulation updated |
| OnDestroy |
|
Called when script is destroying |
OnSignal() and Onstart() functions are a special functions because they cannot contain any commands that spend time in the simulation such us delay().
OnStart() is the first method called when a simulation is started and should be
used to initialize simulation data. It must be run immediately so there can be no time spent on that method.
OnSignal() method listens for all the signals that are connected to that python script all the time during the simulation. For that it would no longer work as intended if it consumes
any time and is busy.