|
Hello,
I’m using JavaScript and Object model to get current pass and its camera:
var pass = Application.ActiveProject.ActiveScene.ActivePass; LogMessage(pass.Camera.type); LogMessage(pass.NestedObjects("Camera").type;
Result:
// INFO : Parameter
// INFO : Parameter
I can’t access the camera as an object! It is a string - name of the camera…
But I see, that there are two items with the key “camera” nested:
var n = pass.NestedObjects;
var i;
for(i = 0; i < n.count; ++i) {
if(n.item(i).name == "Camera") LogMessage(i + " " + n.item(i).name + " " + n.item(i).type); }
Result:
// INFO : 6 Camera Parameter
// INFO : 56 Camera camera
How is it possible, that there are two items with the same key?
I need the second one…
Now I’m using following walkaround, but I’m still interested in…
var pass = Application.ActiveProject.ActiveScene.ActivePass;
var cam = ActiveSceneRoot.FindChildren([URL="http://pass.camera.name/"]pass.Camera.Name[/URL]); LogMessage(cam.item(0).type);
Thanks for help.
|