Multiply by armature inverse matrix to make sure converted bones are where they should be.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user