So you might be coming up against an odd bug in which Engine doesn't always work. I've had this problems with materials and fixed it with "Project".
This is not a bug, an explanation of the behavior you are seeing:
You should only run into this on systems and workflows that load multiple Projects into the XPression Engine.
Engine.GetThingByName targets the Active project loaded in XPression - the Project that is in bold in the in the 'Project Manager' list inside XPression.
XPression can load multiple projects at once, but only one can be active. You can make a Project Active by double clicking it or by using Engine.SetActiveProject
Self.Project.GetThingByName looks in the same project as the one that contacts the scene/script.
Every Project has unique scenes, materials, fonts and widgets. So XPression needs to know where to look for something when multiple projects are loaded.
XPression MOS and Tessera workflows will often load multiple projects at once, so using Self.Project ensures your script run on the correct references.
Manually driven workflows usually only load one project at a time, but it depends. Master control and channel automation workflows sometimes use multiple projects and sometimes don't.
Original Message:
Sent: 11-20-2023 10:38
From: Azathoth Son of Cthulhu
Subject: Scritping Scene Directors
So you might be coming up against an odd bug in which Engine doesn't always work. I've had this problems with materials and fixed it with "Project".
Since use are using the variable name "Scene", which I don't recommend since depending on the script location that is a reserved word, I'll assume the local xpScene is using "Self" for this example.
I'd recommend trying this:
Dim myScene as xpScene
Dim sd as xpSceneDirector
Self.Project.GetSceneByName("Race", myScene, False)
myScene.SetOnline(5,0,0)
myScene.GetSceneDirectorByName("RaceReveal", sd)
sd.Play()
sd.AutoStop = True
I cannot guarantee this will fix the problem, but it is worth a shot.
VB does seem to be forgiving on case sometimes, but try to be consistent on the case of reserved words like Dim and booleans.
------------------------------
Azathoth
Son of Cthulhu
Original Message:
Sent: 11-19-2023 18:54
From: ERIC RODRIGUEZ
Subject: Scritping Scene Directors
I'm looking for a little help if possible. I have a Scene that has a few different scene directors(RaceReveal, RaceCover, RaceReset) attached to each Race (total of 3 Race Cars). I'm looking to play the scene online and trigger via keyboard mapping different scene directors when needed for each race care. Below is the script I'm working with but 50% of the time it works. When I trigger one scene director it also clears the other animations that were already triggered. Other times it will not reset/clear any scene directors that was already triggered.
This is the script I'm using in my Keybaord/GPI Mapping.
Dim Scene as xpScene
dim sd as xpSceneDirector
Engine.GetSceneByName("Race", Scene,False)
Scene.SetOnline(5,0,0)
Scene.GetSceneDirectorByName("RaceReveal", sd)
sd.Play()
sd.AutoStop = true
Any input would be appreciated. Thank you.
Eric R
UPDATE: I was able to figure it out. For some reason I had to change Scene.SetOnline(5,0,0) to Scene.SetOnline(5,1,1) and it started working.
------------------------------
ERIC RODRIGUEZ
Xpression designer, and operator
Phoenix Suns & Phoenix Mercury
Phoenix
------------------------------