Thursday, November 17, 2011

Scripting - Softimage - Similar Name Selector

Here's a simple yet handy little Python script I created for Softimage.
Used to select all object with a similar name to the currently selected object.


si = Application
log = Application.LogMessage
oSel = Application.Selection

#select and split the selected object by its underscore '_'.
for sel in oSel:
n = sel.Name.split('_')
log (n[0])

#Use the selected object's first section and wild card '*' to select all similar named objects.
si.SelectObj(n[0]+'_*',"",True)


It is very limited but works well for my naming convention; all objects are named 'objectname_1', etc. It splits the selected object's name at the underscore '_' then choose all with a similar name before '_'.  Simple as that!

No comments: