Insert code in the event loop¶
loop.py¶
1# © 2024 Autodesk, Inc. All rights reserved.
2
3# example to show how to insert an object into the event loop
4# the loop function of this object is called within each render frame
5newScene()
6
7#from random import *
8
9print("Executing loop script!")
10
11class TestAction(vrAEBase):
12 def __init__(self):
13 vrAEBase.__init__(self)
14 self.addLoop()
15 def recEvent(self, state):
16 vrAEBase.recEvent(self, state)
17 print("vrAEBase active = ", self.isActive())
18 def loop(self):
19 print("loop!")
20
21ta = TestAction()
22ta.setActive(true)
23
24print("end")