forked from bartvdbraak/blender
Fix T46263: bpy api - assigning to object.matrix_basis with AXIS_ANGLE rotation mode does not work correctly.
Drot in axis angle does not make that much sense anyway (it's even disabled in UI), but let's apply it correctly at least!
This commit is contained in:
parent
b278e8742b
commit
7967da2515
@ -1950,9 +1950,15 @@ void BKE_object_mat3_to_rot(Object *ob, float mat[3][3], bool use_compat)
|
|||||||
}
|
}
|
||||||
case ROT_MODE_AXISANGLE:
|
case ROT_MODE_AXISANGLE:
|
||||||
{
|
{
|
||||||
mat3_to_axis_angle(ob->rotAxis, &ob->rotAngle, mat);
|
float quat[4];
|
||||||
sub_v3_v3(ob->rotAxis, ob->drotAxis);
|
float dquat[4];
|
||||||
ob->rotAngle -= ob->drotAngle;
|
|
||||||
|
/* without drot we could apply 'mat' directly */
|
||||||
|
mat3_to_quat(quat, mat);
|
||||||
|
axis_angle_to_quat(dquat, ob->drotAxis, ob->drotAngle);
|
||||||
|
invert_qt(dquat);
|
||||||
|
mul_qt_qtqt(quat, dquat, quat);
|
||||||
|
quat_to_axis_angle(ob->rotAxis, &ob->rotAngle, quat);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: /* euler */
|
default: /* euler */
|
||||||
|
Loading…
Reference in New Issue
Block a user