[Bf-committers] 'Why armatures are so slow' Report

Ton Roosendaal bf-committers@blender.org
Sat, 5 Jul 2003 19:04:22 +0200


Thanks for the report! A few remarks below:

> So what to do?
> 1) figure out when is the best time to recalculate a pose. This would
> include:
> - Frame changed
> - Enter pose mode
> - Exit pose mode
> - In the while loop in transform, i.e., 'g', 's', 'r' in pose mode...  
> and also
>   after you press esc in there.
> - The target of a constraint on the armature has changed
> - any others? (I noticed intrr added some code to clear constraints on
>   'set scenes' so some care will be needed).

The calls in Blender currently used to do it is "do_all_xxxx()". With  
the purpose of having a non-recursive predictable end-result of  
animation systems.
They're abused a bit in the code... the official method is to create an  
event for it, B_NEWFRAME, or call the update_for_newframe() function.

For single Armatures (ipos, etc) the do_xxx() function should be used.

In general, the animation system in Blender could use a cleanup. When  
we've got the Constraints in place, we can use that system to sync all  
other animation systems.

> 2) figure out when the best time to recalculate the deformation of a
> child mesh of an armature. This would basically include all of the
> events listed above in 1), but with the added consideration that it
> must be in very good sync with the pose calculation to avoid lags.

The deform calculation should'nt create a lag, since this derives from  
the actual poses... when you can make sure the deform matrices in Bones  
are updated for the actual Bones position, there won't be deform  

The 'MakeDisplist()' call takes care of deformation calculation.

> P.S. On an only partially related note, it might be good to replace
> some code in drawview3d that is flagged as /* SILLY CODE!!!! */
> with a non-silly alternative... if the code is silly it means it's
> broken or poorly understood and it should be re-evaluated.

I already removed one such remark (the code was commented anyway), and  
just committed a drawview.c without the other remark. Just a personal  
note from Zr... from back to 1999 when we working with just the two of  


Ton Roosendaal  Blender Foundation ton@blender.org