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>2019-08-26 07:40:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-08-26 07:40:00 +0300
commitdb851c78b4b391e4ddeb3350550a0da5194554fd (patch)
treea5f70712a4506216e5ee7d3124540ac08d73e2fb /source/blender/editors/transform/transform_conversions.c
parent7b61fe1638051b3b2e296680a000819f31672414 (diff)
Transform: support snapping origins onto the objects geometry
Normally it wouldn't make sense for the object to snap onto it's self, when moving origins this is a common use-case.
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r--source/blender/editors/transform/transform_conversions.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 4fe79dc3202..dc072d74be6 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -6536,11 +6536,14 @@ static void flush_trans_object_base_deps_flag(Depsgraph *depsgraph, Object *obje
depsgraph, &object->id, DEG_OB_COMP_TRANSFORM, set_trans_object_base_deps_flag_cb, NULL);
}
-static void trans_object_base_deps_flag_finish(ViewLayer *view_layer)
+static void trans_object_base_deps_flag_finish(const TransInfo *t, ViewLayer *view_layer)
{
- for (Base *base = view_layer->object_bases.first; base; base = base->next) {
- if (base->object->id.tag & LIB_TAG_DOIT) {
- base->flag_legacy |= BA_SNAP_FIX_DEPS_FIASCO;
+
+ if ((t->flag & T_OBJECT_DATA_IN_OBJECT_MODE) == 0) {
+ for (Base *base = view_layer->object_bases.first; base; base = base->next) {
+ if (base->object->id.tag & LIB_TAG_DOIT) {
+ base->flag_legacy |= BA_SNAP_FIX_DEPS_FIASCO;
+ }
}
}
}
@@ -6602,7 +6605,7 @@ static void set_trans_object_base_flags(TransInfo *t)
/* Store temporary bits in base indicating that base is being modified
* (directly or indirectly) by transforming objects.
*/
- trans_object_base_deps_flag_finish(view_layer);
+ trans_object_base_deps_flag_finish(t, view_layer);
}
static bool mark_children(Object *ob)
@@ -6670,7 +6673,7 @@ static int count_proportional_objects(TransInfo *t)
/* Store temporary bits in base indicating that base is being modified
* (directly or indirectly) by transforming objects.
*/
- trans_object_base_deps_flag_finish(view_layer);
+ trans_object_base_deps_flag_finish(t, view_layer);
return total;
}