-
Notifications
You must be signed in to change notification settings - Fork 20
Scripting
Häfner edited this page Mar 9, 2015
·
11 revisions
Scripting is the way to add logic, interaction and animations to the virtual scene. All features of PolyVR are accessible from scripts, including scene graph operations, content import or creation, physics, lightning, cameras and many more. The module is called 'VR', it is documented, just click on the button with the question mark.
import VR
print VR.getVersion()
Scripts are written in python, this allows to import any module installed on your system. This also allows to import your own python modules. The path to place your modules is the folder where your project lies. If you want to add more paths you can do this in an init script:
import sys
sys.path.append("my/module/path")
Scripts can be triggered by pressing the button with the gears. This is only meant for testing! The trigger types are:
on_scene_load
timeout
device