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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-04-23 11:25:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-23 11:25:29 +0300
commit8dedbb17478316ff44e739b68ff5d03d36b7ab40 (patch)
tree4f05490a4d58761c687cabf41fbb756bfc2cbfc7 /source/blender/editors/object/object_transform.c
parentb900a5e4527035b7eaf02d5df4b5fcaaeee52703 (diff)
Fix T75836: Light target misses updates while dragging
Diffstat (limited to 'source/blender/editors/object/object_transform.c')
-rw-r--r--source/blender/editors/object/object_transform.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index b3d76382d26..62a8b46e904 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -1727,7 +1727,7 @@ static void object_apply_location(Object *ob, const float loc[3])
copy_v3_v3(ob->loc, mat[3]);
}
-static void object_orient_to_location(Object *ob,
+static bool object_orient_to_location(Object *ob,
const float rot_orig[3][3],
const float axis[3],
const float location[3])
@@ -1744,9 +1744,10 @@ static void object_orient_to_location(Object *ob,
object_apply_rotation(ob, final_rot);
- DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
+ return true;
}
}
+ return false;
}
static void object_transform_axis_target_cancel(bContext *C, wmOperator *op)
@@ -1975,6 +1976,8 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const
object_orient_to_location(
item->ob, item->rot_mat, item->rot_mat[2], location_world);
+
+ DEG_id_tag_update(&item->ob->id, ID_RECALC_TRANSFORM);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, item->ob);
}
if (normal_found) {
@@ -1986,8 +1989,11 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const
else {
struct XFormAxisItem *item = xfd->object_data;
for (int i = 0; i < xfd->object_data_len; i++, item++) {
- object_orient_to_location(item->ob, item->rot_mat, item->rot_mat[2], location_world);
- WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, item->ob);
+ if (object_orient_to_location(
+ item->ob, item->rot_mat, item->rot_mat[2], location_world)) {
+ DEG_id_tag_update(&item->ob->id, ID_RECALC_TRANSFORM);
+ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, item->ob);
+ }
}
xfd->prev.is_normal_valid = false;
}