[Bf-blender-cvs] [45042f6a035] master: Fix uninitialized cursor w/ setting object origin

Campbell Barton noreply at git.blender.org
Wed Jan 16 09:58:23 CET 2019


Commit: 45042f6a035dd8f2c21512af567a10db0b052a3c
Author: Campbell Barton
Date:   Wed Jan 16 19:57:58 2019 +1100
Branches: master
https://developer.blender.org/rB45042f6a035dd8f2c21512af567a10db0b052a3c

Fix uninitialized cursor w/ setting object origin

===================================================================

M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/include/ED_armature.h
M	source/blender/editors/object/object_transform.c

===================================================================

diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index c262cbdd556..845730faadd 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -141,7 +141,7 @@ void ED_armature_transform(Main *bmain, bArmature *arm, float mat[4][4], const b
 
 /* exported for use in editors/object/ */
 /* 0 == do center, 1 == center new, 2 == center cursor */
-void ED_armature_origin_set(Main *bmain, Object *ob, float cursor[3], int centermode, int around)
+void ED_armature_origin_set(Main *bmain, Object *ob, const float cursor[3], int centermode, int around)
 {
 	const bool is_editmode = BKE_object_is_in_editmode(ob);
 	EditBone *ebone;
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index bce04f4382f..88459da3a95 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -206,7 +206,7 @@ void ED_armature_ebone_from_mat3(EditBone *ebone, float mat[3][3]);
 void ED_armature_ebone_from_mat4(EditBone *ebone, float mat[4][4]);
 
 void ED_armature_edit_transform_mirror_update(struct Object *obedit);
-void ED_armature_origin_set(struct Main *bmain, struct Object *ob, float cursor[3], int centermode, int around);
+void ED_armature_origin_set(struct Main *bmain, struct Object *ob, const float cursor[3], int centermode, int around);
 
 void ED_armature_transform_bones(struct bArmature *arm, float mat[4][4], const bool do_props);
 void ED_armature_transform_apply(struct Main *bmain, struct Object *ob, float mat[4][4], const bool do_props);
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 57a04cbd0f3..a30bc60eba6 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -811,7 +811,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 	Object *obedit = CTX_data_edit_object(C);
 	Depsgraph *depsgraph = CTX_data_depsgraph(C);
 	Object *tob;
-	float cursor[3], cent[3], cent_neg[3], centn[3];
+	float cent[3], cent_neg[3], centn[3];
+	const float *cursor = scene->cursor.location;
 	int centermode = RNA_enum_get(op->ptr, "type");
 
 	ListBase ctx_data_list;



More information about the Bf-blender-cvs mailing list