Everything that you can do manually in Softimage can be done through scripting commands, and selecting is no exception. You can change what's selected or find out what's selected.
This section only addresses how to work with the selection using scripting commands. For the more powerful object model and C++ API access, see Selection.
To find out what is currently selected, use the native Softimage GetValue command to return the SelectionList.
The SelectionList is a comma-delimited list of scene item names (strings) that represents all the objects that are currently selected.
When you use the Set keyword with certain native Softimage commands, the return value is automatically converted into a real object. This is very useful if, for example, you wanted to build a collection of objects from a string of Softimage object names, and especially if you want to use wildcards.
You can add items to the current selection through scripting or remove items from the current selection.
To select an element or parameter, use the SelectObj command with the corresponding name. For example:
SelectObj "Camera_Interest"
To add something to the current selection, use the AddToSelection command:
AddToSelection "Spot_Interest"
To select all cameras, lights, and 3D objects in a scene, use:
SelectAllTo remove something from the current selection, use the RemoveFromSelection command:
RemoveFromSelection "Scene.Scenecolors.litcol"
You can use the PickElement command to start an interactive picking session in a script.
The following example uses PickElement to prompt the user to pick a property. The returned variables are PickedElement, ButtonPressed, and ModifierPressed (for example, the Shift or Ctrl key). ButtonPressed is 0 if the users presses Esc or right-clicks to cancel the picking.
Dim PickedElement, ButtonPressed, ModifierPressed call PickElement( "property", "Select a property", "Select a property",_ PickedElement, ButtonPressed, ModifierPressed) if ButtonPressed <> 0 Then 'Test PickedElement to see if it's a property then 'Do something with PickedElement End if
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License