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 / Is Evaluating the scene when iterating frames inefficent?
  RSS 2.0 ATOM  

Is Evaluating the scene when iterating frames inefficent?
Rate this thread
 
22120
 
Permlink of this thread  
avatar
  • dj120
  • Posted: 30 January 2009 03:52 PM
  • Total Posts: 7
  • Joined: 22 January 2009 12:21 AM

Hey All,

I’m working on a script to loop through an animation and report to a text file frame ranges with joint locks on an ik rig.  I have the code working, but I’m not sure the method I’m using is the most efficient.

Right now I’m using something that looks like this in my function:

while ( ( lSystem.LocalTime.GetFrame(True) < fileStop ) ):
        
lPlayerControl.StepForward()
        
lScene.Evaluate()

        
joint.GetVector(rot FBModelTransformationMatrix.kModelRotation False )

basically i’m iterating through the frame range once for each joint, and my suspicion is that the scene evaluate is not very efficient (assuming it updates everything in the scene when it’s called).

Changing the code to iterate through frames once for all joints is possible, but will require me to do a bit more data management, so I’m curious to know if it will really save processing time before I make that effort.

Thanks,

dJ



Replies: 0
avatar
  • dj120
  • Posted: 02 February 2009 09:25 PM

If anyone is interested, evaluating the scene is definitely an intensive operation and should be kept to a minimum when possible.

I switched routine described above so joint loop was nested in the frame loop (i.e. Scene.Evaluate is now only called once per frame).  This had a significant impact on the processing time.

For a 16 joints over a 400 frame sample, the processing time reduced from 6.5 minutes to 0.5 mintues.

Hope this helps someone, somewhere, someday.  :)

dJ



Replies: 0
avatar
  • KxL
  • Posted: 03 February 2009 12:49 AM

We already had similar thread, check it: http://area.autodesk.com/for...ions-without-stepforward/

Cheers



Replies: 0