Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-16 11:57:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-16 11:57:58 +0300
commit45042f6a035dd8f2c21512af567a10db0b052a3c (patch)
tree5f3f19171a4def575f6a3d89aca3fcb817658162 /source
parent735653cda86c88c4768bf0456afd8112044704fd (diff)
Fix uninitialized cursor w/ setting object origin
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/armature/armature_edit.c2
-rw-r--r--source/blender/editors/include/ED_armature.h2
-rw-r--r--source/blender/editors/object/object_transform.c3
3 files changed, 4 insertions, 3 deletions
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;