Here is another code snippet to do the same in Python:
# Retrieve all the Fx Trees in the scene.
oFxTrees = XSIFactory.CreateObject( "XSI.Collection" )
# "FxTree" gets all the FxTrees under the scene root. "*.FxTree" gets
the first FxTree
# under the scene root and all the other FxTrees under models and 3D
objects.
oFxTrees.Items = "FxTree, *.FxTree"
# Make sure the first FxTree under the scene root is listed once.
oFxTrees.Unique = True
# Loop on the file output operators per FxTree.
for oFxTree in oFxTrees:
oOutputNodes = oFxTree.FxOperators.Filter( "FileOutputOp" )
for oOutputNode in oOutputNodes:
# Do your stuff with oOutputNode.Name.
Cheers,
François
Le 2007-02-13 18:18, Greg Smith a écrit :
here are two functions I use to pretty much for doing what your trying
to do.
The first function goes through and finds all "fxTrees"
The second functions finds all FileOutput Ops from a given input fx
tree.
function GetFxTreeColl() {
var oColl = new ActiveXObject("XSI.Collection");
var myRootProps = ActiveSceneRoot.properties;
fc = new Enumerator(myRootProps);
for (; !fc.atEnd(); fc.moveNext()) {
if(fc.item().type == "FxTree") {
oColl.Add (fc.item());
}
}
return(oColl);
}
function GetFxOutputOps(in_FxTree) {
var oColl = new ActiveXObject("XSI.Collection");
var fxTreeChildren = EnumElements(in_FxTree);
fc = new Enumerator(fxTreeChildren);
for (; !fc.atEnd(); fc.moveNext())
{
if(fc.item().type == "FileOutputOp"){
oColl.Add (fc.item());
}
}
return(oColl);
}
so an example of these two functions would be :
myFxTreeColl = GetFxTreeColl();
myOutputs = GetFxOutputOps(myFxTreeColl(0));
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi