|
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
|
|
|
|
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
|
|
|