On 2/28/2013 9:11 PM, Christian Gotzinger wrote:
preselection = [s for s in Application.Selection]
# This list now includes all objects you had selected (the objects,
not just their names!)
# When you're done with the script, this brings back the original
selection:
Application.Selection.Clear()
for obj in preselection:
Application.Selection.Add(obj)
Thanks Christian -
yes, this works for simple objects and for entire branches.
What Mihail and I are concerned, however, is how this code would work
when the user has done a polygon, vertex, etc. selection - note that in
the 'processing' part of this code (after we save the original object
list and before we attempt the restore), we mess around with existing
scene polymeshes (via the C++ CMeshBuilder API). The user might even
have selected items within the meshes we're modifying as part of this
processing.