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
------------------------------