[Bf-committers] Armatures Bones and Constraints Oh My!
Thu, 20 May 2004 10:31:25 -0500
In whatever system that eventually replaces the current Armature and
Constraint setup in blender I see several key things to keep in mind
Bones need to store several key pieces of data.
1. Rest Position (currently in head tail and roll)
2. Pose Position (currently stored in quat and duplicated in pose-
3. IK flag
4. Parent Bone
5. Child Bone List
6. RootBone (could be calculated by following the parents up)
7. Constraint list
anything else is really unneccessary information. Pose position
should be stored in the same format as the rest position. This is
where we get our data for drawing the bone and deforming the mesh.
The rest position is only used for going to the bones rest position.
it should never be used for drawing the bone or deforming the mesh.
When we return to rest position we just copy the rest position values
to the pose position. This is the basis of a working efficient Bone
system. Some of you may see the need for additional pieces of data.
Please respond if you do. I'd like some feedback.
Constraints need to be evaluated per every transform operation. I
think they would be better served as a test function not performing
actual operations on the data. returning a boolean value for pass or
fail perhaps. the only hitch there is many transformations operate on
more than one axis. an indication of which axis operation failed
might be in order. Or perhaps transformations could be calculated on
a per axis basis. Such a method might tie in with working transform
handles also. Constraint's would be easier to use also in the code if
they were linked to the object's struct. Like in the proposed bone
structure above each object should have a list of constraints on that
object. No more looking up the constraint in the global list.
PS. Sorry about the title there I have something of a sense of humor
as you'll find out.