vrFade demo

fade.py
 1# © 2024 Autodesk, Inc. All rights reserved.
 2
 3print("Executing fade script!")
 4
 5newScene()
 6
 7cloth = loadGeometry("$VRED_EXAMPLES/geo/cloth.osb")
 8car = loadGeometry("$VRED_EXAMPLES/geo/car.osb")
 9updateScene()
10
11# fade object a single time from opaque to transparent and back in five seconds
12fade = vrFade(car, 5.0)
13fade.setActive(true)
14
15# define timer object that toggles the fade object after 7 seconds. Because the duration
16# of a single fade operation is 5 seconds, the fade object state is off, so the timer
17# activates it back again
18timer = vrTimer(7.0)
19timer.connect(fade, SWITCH_TOGGLE)
20timer.setActive(true)