[Bf-blender-cvs] [2896ce7bc79] master: Fix using non-euler cursor orientation
Campbell Barton
noreply at git.blender.org
Thu May 16 05:50:54 CEST 2019
Commit: 2896ce7bc793908f2ee054c2c5e1f58e9c6e8dce
Author: Campbell Barton
Date: Thu May 16 13:48:23 2019 +1000
Branches: master
https://developer.blender.org/rB2896ce7bc793908f2ee054c2c5e1f58e9c6e8dce
Fix using non-euler cursor orientation
Missed in 06fe2a5e0c5d6
===================================================================
M release/scripts/modules/bpy_extras/object_utils.py
M source/blender/editors/object/object_add.c
===================================================================
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index 48cdbb41c50..3a751a7b907 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -80,7 +80,8 @@ def add_object_align_init(context, operator):
rotation.resize_4x4()
properties.rotation = rotation.to_euler()
elif properties.align == 'CURSOR':
- rotation = context.scene.cursor.rotation_euler.to_matrix().to_4x4()
+ rotation = context.scene.cursor.matrix
+ rotation.col[3][0:3] = 0.0, 0.0, 0.0
properties.rotation = rotation.to_euler()
else:
rotation = properties.rotation.to_matrix().to_4x4()
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index f8760f93f2f..3af05970038 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -435,7 +435,9 @@ bool ED_object_add_generic_get_opts(bContext *C,
break;
case ALIGN_CURSOR: {
const Scene *scene = CTX_data_scene(C);
- copy_v3_v3(rot, scene->cursor.rotation_euler);
+ float tmat[3][3];
+ BKE_scene_cursor_rot_to_mat3(&scene->cursor, tmat);
+ mat3_normalized_to_eul(rot, tmat);
RNA_float_set_array(op->ptr, "rotation", rot);
break;
}
More information about the Bf-blender-cvs
mailing list