Best I could come up with is by name only
If there is a better way, please do share
If not, with the below script, is there a way to skip a cycle if the camera does not exist?
In other words, say there is only one Camera, 3 in the scene
When you run this script, it sets the Camera, 3 view
Currently, you have to run this script until it reaches cycle 4
Code: Select all
var cycle = 0;
function Execute(params)
{
util = System.CreateDO('Clintons3D Package/Utility functions')
if(typeof(Clintons3dPlugin) == "undefined") {
System.Alert("Clintons3dPlugin is Required!\n\nInstall the Clintons3dPlugin.rsx in the Package Manager");
params.SetTerminationFlag()
return;
}
if(Node.SubObjectCount("/D3DView")==0) return;
if(cycle==0 && Node.Exists(Space.CurrentScene() + "/EntryPoint")) {
Node.Select(Space.CurrentScene() + "/EntryPoint")
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from the EntryPoint Camera", 2000)
Space.Unselect()
}
if(cycle==1 && Node.Exists(Space.CurrentScene() + "/Camera")) {
Node.Select(Space.CurrentScene() + "/Camera")
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from Camera", 2000)
Space.Unselect()
}
if(cycle==2 && Node.Exists(Space.CurrentScene() + "/Camera, 1")) {
Node.Select(Space.CurrentScene() + "/Camera, 1")
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from Camera, 1", 2000)
Space.Unselect()
}
if(cycle==3 && Node.Exists(Space.CurrentScene() + "/Camera, 2")) {
Node.Select(Space.CurrentScene() + "/Camera, 2")
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from Camera, 2", 2000)
Space.Unselect()
}
if(cycle==4 && Node.Exists(Space.CurrentScene() + "/Camera, 3")) {
Node.Select(Space.CurrentScene() + "/Camera, 3")
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from Camera, 3", 2000)
Space.Unselect()
}
if(cycle==5 && Node.Exists(Space.CurrentScene() + "/Camera, 4")) {
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from Camera, 4", 2000)
Space.Unselect()
}
if(cycle==6 && Node.Exists(Space.CurrentScene() + "/Camera, 5")) {
Node.Select(Space.CurrentScene() + "/Camera, 5")
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from Camera, 5", 2000)
Space.Unselect()
}
if(cycle==7 && Node.Exists(Space.CurrentScene() + "/Camera, 6")) {
Node.Select(Space.CurrentScene() + "/Camera, 6")
var cmd = '';cmd += 'UUFS = Node.AccessFnSet("Widgets/UUFunctionSet");UUFS.SetCamera();';RsApp.RunScriptBuffer(cmd);
util.SetStatusMessage("Viewing from Camera, 6", 2000)
Space.Unselect()
}
cycle++;
cycle = cycle % 8;
}