diff options
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 5237335e8ca..142e41918dd 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1476,7 +1476,7 @@ static void armature_set_id_extern(Object *ob) { bArmature *arm= ob->data; bPoseChannel *pchan; - int lay= arm->layer_protected; + unsigned int lay= arm->layer_protected; for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) { if(!(pchan->bone->layer & lay)) @@ -1704,12 +1704,18 @@ void object_apply_mat4(Object *ob, float mat[][4]) /* location */ copy_v3_v3(ob->loc, mat[3]); - - /* rotation */ + + /* rotation & scale are linked, we need to create the mat's + * for these together since they are related. */ copy_m3_m4(mat3, mat); /* so scale doesnt interfear with rotation [#24291] */ normalize_m3_m3(mat3_n, (const float(*)[3])mat3); + if(mat3_n[0][0] < 0.0f) negate_v3(mat3_n[0]); + if(mat3_n[1][1] < 0.0f) negate_v3(mat3_n[1]); + if(mat3_n[2][2] < 0.0f) negate_v3(mat3_n[2]); + + /* rotation */ object_mat3_to_rot(ob, mat3_n, 0); /* scale */ |