Outliner: Keep Transform by default on drag-dropping to parent

A common issue many artists have in Blender is that
parenting/unparenting objects by drag and drop in the Outliner
does not keep the transform by default, need to hold Alt to maintain
transform values.
Since keeping the transform is the expected behavior, this PR will
reverse the behavior. i.e. Holding Alt will not keep the transform
on Parent/Un-Parent.

Pull Request: https://projects.blender.org/blender/blender/pulls/139029
This commit is contained in:
Dan-Gry
2025-06-06 06:59:55 +02:00
committed by Pratik Borhade
parent df75f965d0
commit 1d37f76b91

View File

@@ -436,7 +436,7 @@ static wmOperatorStatus parent_drop_invoke(bContext *C, wmOperator *op, const wm
static_cast<wmDragID *>(drag->ids.first),
par,
object::PAR_OBJECT,
event->modifier & KM_ALT);
!(event->modifier & KM_ALT));
return OPERATOR_FINISHED;
}
@@ -444,7 +444,7 @@ static wmOperatorStatus parent_drop_invoke(bContext *C, wmOperator *op, const wm
void OUTLINER_OT_parent_drop(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Drop to Set Parent (hold Alt to keep transforms)";
ot->name = "Drop to Set Parent (hold Alt to not keep transforms)";
ot->description = "Drag to parent in Outliner";
ot->idname = "OUTLINER_OT_parent_drop";
@@ -519,8 +519,8 @@ static wmOperatorStatus parent_clear_invoke(bContext *C, wmOperator * /*op*/, co
Object *object = (Object *)drag_id->id;
object::parent_clear(object,
(event->modifier & KM_ALT) ? object::CLEAR_PARENT_KEEP_TRANSFORM :
object::CLEAR_PARENT_ALL);
(event->modifier & KM_ALT) ? object::CLEAR_PARENT_ALL :
object::CLEAR_PARENT_KEEP_TRANSFORM);
}
}
@@ -533,7 +533,7 @@ static wmOperatorStatus parent_clear_invoke(bContext *C, wmOperator * /*op*/, co
void OUTLINER_OT_parent_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Drop to Clear Parent (hold Alt to keep transforms)";
ot->name = "Drop to Clear Parent (hold Alt to not keep transforms)";
ot->description = "Drag to clear parent in Outliner";
ot->idname = "OUTLINER_OT_parent_clear";