[Bf-python] Re: Bf-python Digest, Vol 18, Issue 22

Tron Thomas tron.thomas at verizon.net
Sun Jan 15 22:36:23 CET 2006


I can't say I really understand most of the code Joseph found in his 
research, and how it relates the code I used to fix the problem.  This 
seems a lot more complicated than what I had to go through.  Still, I 
think most of this armature code is pretty confusing so it is hard to 
know what the right solution is.

>Date: Sun, 15 Jan 2006 00:23:57 -0500
>From: "Gilbert, Joseph T." <jgilbert at tigr.ORG>
>Subject: RE: [Bf-python] Fixing NMesh.getVertexInfluences
>To: "Blender Foundation Python list" <bf-python at projects.blender.org>
>Message-ID: <7F0AA25C9B1706448E8B73DFDD109B311F1C7F at EXCHANGE.TIGR.ORG>
>Content-Type: text/plain; charset="iso-8859-1"
>
>
>Doing a little searching....
>
>numGroups = BLI_countlist(&target->defbase);
>			
>dverts = ((Mesh*)target->data)->dvert;
>if(dverts) {
>	defnrToPC = MEM_callocN(sizeof(*defnrToPC)*numGroups, "defnrToBone");
>	for (i=0,dg=target->defbase.first; dg; i++,dg=dg->next) {
>	        defnrToPC[i] = get_pose_channel(armOb->pose, dg->name);
>		/* exclude non-deforming bones */
>		if(defnrToPC[i]) {
>			if(defnrToPC[i]->bone->flag & BONE_NO_DEFORM)
>				defnrToPC[i]= NULL;
>		}
>	}
>
>.............
>
>for (j=0; j<dvert->totweight; j++){
>	int index= dvert->dw[j].def_nr;
>	pchan = index<numGroups?defnrToPC[index]:NULL;
>	if (pchan) {
>		float weight= dvert->dw[j].weight;
>		Bone *bone= pchan->bone;
>		deformed= 1;
>					
>		if(bone && bone->flag & BONE_MULT_VG_ENV) {
>						
>			weight*= distfactor_to_bone(co, bone->arm_head, bone->arm_tail, bone->rad_head, bone->rad_tail, bone->dist);
>		}
>		pchan_bone_deform(pchan, weight, vec, co, &contrib);
>
>
>The above code is from armature_deform_verts in armature.c
>
>It looks like dvert->dw[j].def_nr is being mapped by index to the bones.... Might be a good place to start.
>  
>




More information about the Bf-python mailing list