B. Create exit coroutine
- Last UpdatedJan 20, 2025
- 1 minute read
Copy and paste the coroutine script into your Procedures.xml script file or apm_data_sampleAsset.xml depending on which technique you used. You can use the same exit script for all procedures or define unique exit scripts for each procedure.
The details of what the coroutine is providing is described below and represented by the script.
The architecture gives the opportunity to have different exit scripts per procedure. The stop script below provides the following functionality.
-
Reset and Stop Animation Clip Engine
-
Transition to Home or Startup Camera
-
Reset other visual effects
Create an Exit Coroutine script
Use the sample below for the BallBearing procedure.
-
Copy and paste the coroutine text into the script.
-
Modify the values.
<!--**************************** BEGIN - EXIT PROCEDURE COROUTINE ***************************************-->
<Coroutine name="exit_proc_BallBearing">
<!-- 1. set the current frame to frame 0 -->
<setfield name="@[email protected]" value="0" />
<setfield name="@[email protected]" value="0" />
<setfield name="@[email protected]" value="0" />
<wait condition="@exit_proc_BallBearing.timeFromWait@<0.1"/>
<!-- 2. stops the clip -->
<setfield name="@[email protected]" />
<wait condition="[@exit_proc_BallBearing.timeFromWait]<=0.1"/>
<execute command="apm_crt_resetBlink"/>
</Coroutine>
<!--*************************** END - EXIT PROCEDURE COROUTINE ******************************************-->