diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 15 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 20 |
2 files changed, 23 insertions, 12 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; } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index b29edcb00de..14242f6ba40 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -632,12 +632,20 @@ static void initSnappingMode(TransInfo *t) else if (t->tsnap.applySnap != NULL && // A snapping function actually exist (obedit_type == -1)) // Object Mode { - /* In "Edit Strokes" mode, - * snap tool can perform snap to selected or active objects (see T49632) - * TODO: perform self snap in gpencil_strokes */ - t->tsnap.modeSelect = (((t->options & (CTX_GPENCIL_STROKES | CTX_CURSOR)) != 0) ? - SNAP_ALL : - SNAP_NOT_SELECTED); + + if (t->options & (CTX_GPENCIL_STROKES | CTX_CURSOR)) { + /* In "Edit Strokes" mode, + * snap tool can perform snap to selected or active objects (see T49632) + * TODO: perform self snap in gpencil_strokes */ + t->tsnap.modeSelect = SNAP_ALL; + } + else if (t->flag & T_OBJECT_DATA_IN_OBJECT_MODE) { + /* When we're moving the origins, allow snapping onto our own geometry (see T69132). */ + t->tsnap.modeSelect = SNAP_ALL; + } + else { + t->tsnap.modeSelect = SNAP_NOT_SELECTED; + } } else { /* Grid if snap is not possible */ |