Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / Clear selection
  RSS 2.0 ATOM  

Clear selection
Rate this thread
 
23328
 
Permlink of this thread  
avatar
  • Serguei
  • Posted: 25 February 2009 06:40 PM
  • Location: Los Angeles, CA
  • Total Posts: 20
  • Joined: 20 May 2008 04:59 AM

Is there a function to clear selection in MB, can’t seem to find out.
I could do something close to it with

FBSelectObjectsByNamespace (Namespace, False)

but how do I pass it the root namespace?
Thanks!



Replies: 0
avatar
  • raitch
  • Posted: 26 February 2009 09:47 AM

You could try this:

# function to pick nothing
def PickNothing():
    
# Going through all the components in the scene to deselect them
    
for lComp in FBSystem().Scene.Components:
        
lComp.Selected False
PickNothing
()

P.S.  It was named for people that remember using PowerAnimator…



Replies: 0
avatar
  • Serguei
  • Posted: 26 February 2009 07:06 PM

Yeah I wrote a clear selection function in the meantime…

def clearSelection ():
    
''' Clear selection function '''
    
# Get selected models
    
modelList FBModelList ()
    
FBGetSelectedModels (modelListNoneTrue)
    
    
# Deselect models
    
for model in modelList:
        
model.Selected False


Replies: 0