You can use the ActivePrimitive.ConstructionHistory to find out where an ICETree is in the construction stack.
var o = Dictionary.GetObject( "someobject" ); var sMarker; oEnum = new Enumerator( o.ActivePrimitive.ConstructionHistory ); for (;!oEnum.atEnd();oEnum.moveNext()) { if( oEnum.item().BelongsTo( "MarkerOperators" ) ) { sMarker = oEnum.item().type; } else if (oEnum.item().IsClassOf( siICETreeID ) == true ) { LogMessage( sMarker + " -> " + oEnum.item().name ); } } // INFO : simulationmarker -> ICETree1 // INFO : modelingmarker -> ICETree
And here’s a Python version courtesy of Alan Fregtman of the Softimage mailing list.
How to tell if a given ICETree object is simulated or not
# --------------------------------- xsi = Application obj = xsi.Selection(0) markers = ["secondaryshapemarker","postsimulationmarker","simulationmarker","animationmarker","shapemarker","modelingmarker"] opstack = obj.ActivePrimitive.ConstructionHistory for op in opstack: if any([op.FullName.endswith("."+marker) for marker in markers]): lastMarker = op.FullName if xsi.ClassName(op) == "ICETree": print op.FullName+" is under marker: "+lastMarker.split(".")[-1]