Message 1 of 12
running script at file open and access global variables in UI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a script controlling objects and to get it working I'm evaluating it after I open up the file containing the objects. I have two questions ..
1. what's the best way to set it up so that the script is evaluated automatically when the file is opened?
2. what would be the best way to make for example the variable "speedMultiplier" available in the UI?
Here is a sample of the script ..
global speedMultiplier = 1000
global plMultiplier = 4.029
global initialPlPosition = 254.52
global positionOffset = 0
$pl.position.controller=position_script()
$pl.position.controller.script = "$pl.transform.controller.Position = [$plOrbit.radius*cos(positionOffset+initialPlPosition+360*speedMultiplier*plMultiplier*F/2700), $plOrbit.radius*sin(positionOffset+initialPlPosition+360*speedMultiplier*plMultiplier*F/2700), 0]+$plOrbit.transform.pos"