When you’re in a component selection mode (such as Edge, Polygon, or Point), the active objects are highlighted in orange. The “active objects” are the objects that are “active for component selection”.
When Softimage is in a component selection mode, the Selection will either by empty or it will contain CollectionItems (one for each object with selected components).
So, how do you get the active objects? Here’s one way, using the little known, magical “.[obj].”:
# Python import win32com.client oActiveObjects = win32com.client.Dispatch( "XSI.Collection" ) oActiveObjects.Items = ".[obj]."
// JScript var oActiveObjects = new ActiveXObject( "XSI.Collection" ); oActiveObjects.Items = ".[obj].";
Great! It was a big problem for me for a long time… and now it is solved! Thanks!!!
The same code in JScript – some ppl may find it useful:
var oCollection = XSIFactory.CreateObject( “XSI.Collection” );
oCollection.Items = “.[obj].”;
Thanks, I added a JScript version to the post
Hello, I’m new to scripting.
What Im trying to do is apply a command, Poly Mesh Triangulate in this case, to a selection.
So because the script needs to apply the triangulation to just the selected faces, I need to get the selection string and apply the triangulate to the string.
Application.ApplyTopoOp(“TriangulatePolygons”, “cylinder.poly[7]”, “siUnspecified”, “siPersistentOperation”, “”)
Can I use your script to get the numbers of the selected faces, then go on to apply the triangulate command?
Cheers,
Mike
You can do that like this:
si = Application
si.ApplyTopoOp("TriangulatePolygons", si.Selection(0), "siUnspecified", "siPersistentOperation", "")