[Bf-python] Armature issues

Joseph Gilbert models at paposo.com
Tue Mar 2 13:37:26 CET 2004


Your going to need to take a look at load_editArmature in editarmature.c.
There is a loop where the first pass adds the bone to the armature's
bonebase list. However, each bone has a childbase list which must be updated
upon bone addition. the bonebase for the armature only tells how many bones
there are in the armature not how they are connected. It the childbase list
in each bone and it's pointer to parent that define the armature's
connections. The matrices of each of the child/parents prob need to be
updated too. As for redraw look at draw_armature it has this:

index = 0;
for (bone=arm->bonebase.first; bone; bone=bone->next) {
	glPushMatrix();
	draw_bonechildren(bone, arm->flag, &index);
	glPopMatrix();
	if (arm->flag & ARM_POSEMODE)
		cpack (B_CYAN);
}
arm->flag &= ~ARM_POSEMODE;

as the code for drawing the armature bones.
Again you can see that it draws the children of each bone:
Also take a look at draw_bonechildren:

if (bone->parent && !(bone->flag & (BONE_IK_TOPARENT|BONE_HIDDEN)) ){
	float childMat[4][4];
	float boneMat[4][4];
	float tip[3], root[3];
	get_objectspace_bone_matrix(bone->parent, boneMat, 0, 1);
	get_objectspace_bone_matrix(bone, childMat, 1, 1);

	VECCOPY (tip, boneMat[3]);
	VECCOPY	(root, childMat[3]);

	if (flag & ARM_POSEMODE)
		glLoadName (-1);
	setlinestyle(3);
	glBegin(GL_LINES);
	glVertex3fv(tip);
	glVertex3fv(root);
	glEnd();
	setlinestyle(0);
}
Maybe this will help.

-----Original Message-----
From: bf-python-admin at blender.org [mailto:bf-python-admin at blender.org]On
Behalf Of Joseph Gilbert
Sent: Monday, March 01, 2004 6:40 AM
To: bf-python at blender.org
Subject: RE: [Bf-python] Armature issues


Editmode is a separate issue, don't worry about that. We'll need to create a
module for working with objects in editmode. If it's not in the oops
schematic it probably hasnt been added to the armature, otherwise I would
say to call window.redraw() in your script. I'll take a look at it later
today.
Joseph

-----Original Message-----
From: bf-python-admin at blender.org [mailto:bf-python-admin at blender.org]On
Behalf Of Bob Holcomb
Sent: Sunday, February 29, 2004 4:16 AM
To: bf-python at blender.org
Subject: [Bf-python] Armature issues


I've attached some updated armature.[ch] and bone.[ch] files.  For some
reason
it seems I creating an aramture, and adding a bone, but I can't get the
armature to show up in blender.  I can't find it in the OOPS Schematic with
the other armatures I created manually.  But when I get a list of armatures
through python it's in the list, and it's bones are attached.  Also, I can't
get information about armatures if I am in edit mode on the armature.  If
somebody else knows how to get the armature that is created to show up in
blender then the add bone code should work.

Cheers,

Bob

_______________________________________________
Bf-python mailing list
Bf-python at blender.org
http://www.blender.org/mailman/listinfo/bf-python





More information about the Bf-python mailing list