Skip to content

Instantly share code, notes, and snippets.

@OmniZ3D
Created June 27, 2013 10:00
Show Gist options
  • Save OmniZ3D/5875346 to your computer and use it in GitHub Desktop.
Save OmniZ3D/5875346 to your computer and use it in GitHub Desktop.
getSelectedOrder (MotionBuilder) snippet function via pyfbsdk FBGetSelectedModels
from pyfbsdk import *
def getSelectedOrder():
# selectionOrder selection order
# Get the current selection
lModelList = FBModelList()
pParent = None
pSelected = True
pSortSelectedOrder = True
FBGetSelectedModels( lModelList, pParent, pSelected, pSortSelectedOrder )
if not lModelList: return None
else: return lModelList
lSelected = getSelectedOrder()
for i in range(len(lSelected)): print "%d: %s" % ( i, lSelected[i].Name )
## FBGetSelectedModels(
## tuple pList,
## FBModel pParent = None,
## bool pSelected = True,
## bool pSortBySelectOrder = False
## )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment