Multiply by armature inverse matrix to make sure converted bones are where they should be.

This commit is contained in:
Martin Poirier
2008-10-12 17:54:47 +00:00
parent 6d7353321e
commit 4e7b736097

View File

@@ -890,10 +890,13 @@ void sk_convertStroke(SK_Stroke *stk)
bArmature *arm= G.obedit->data;
SK_Point *head;
EditBone *parent = NULL;
float invmat[4][4]; /* move in caller function */
int i;
head = NULL;
Mat4Invert(invmat, G.obedit->obmat);
for (i = 0; i < stk->nb_points; i++)
{
SK_Point *pt = stk->points + i;
@@ -913,6 +916,9 @@ void sk_convertStroke(SK_Stroke *stk)
VECCOPY(bone->head, head->p);
VECCOPY(bone->tail, pt->p);
Mat4MulVecfl(invmat, bone->head);
Mat4MulVecfl(invmat, bone->tail);
if (parent != NULL)
{
bone->parent = parent;