Selection time in MotionBuilder isn’t as fast as expected

If you are using MotionBuilder 2012 and above, you should use the functions FBBeginChangeAllModels() and FBEndChangeAllModels() to accelerate the selection time otherwise the selection might not be smooth like in the UI.

Here is an example:

import time
from pyfbsdk import *
FBBeginChangeAllModels()
s_Time = time.clock()
all_Grp = FBSystem().Scene.Groups
for grp in all_Grp :
for item in grp.Items :
item.Selected = True
e_Time = time.clock()
FBEndChangeAllModels()
print "Select","ProccesTime = %s"%(e_Time - s_Time),"OK"

If now you try the same code without these 2 function calls, you see the difference immediately.


Comments

2 responses to “Selection time in MotionBuilder isn’t as fast as expected”

  1. Erik Johansson Avatar
    Erik Johansson

    Sorry to bug you in this comment field but could not comment anymore on the original post about compiling PySide for Maya.
    Do you have any suggestions for using the Maya compiled PySide without putting it in ldconfig?
    If I do so it conflicts with the systems main version of PySide which is compiled against an older Qt version.
    I could ofc make an alias that sets LD_LIBRARY_PATH and PYTHONPATH before launching maya but would like to use the regular bin if possible.

  2. Not really :(
    I know it is sometimes possible to use PySide/PyQt packages built with a slightly different version of Qt, but this is not really recommended and only works (as far I know) with minors Qt/PySide/PyQt updates.
    If anyone knows and can help, I’d be interested to know as well.
    -cyrille

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading