Fix #115171: Transfer Mode operator tries and fails on linked objects
Skip operator execution if destination id is linked or overridden. Pull Request: https://projects.blender.org/blender/blender/pulls/115266
This commit is contained in:
committed by
Pratik Borhade
parent
e50a601a95
commit
a7ae024ea3
@@ -506,6 +506,14 @@ static int object_transfer_mode_invoke(bContext *C, wmOperator *op, const wmEven
|
||||
const eObjectMode src_mode = (eObjectMode)ob_src->mode;
|
||||
|
||||
Base *base_dst = ED_view3d_give_base_under_cursor(C, event->mval);
|
||||
|
||||
if (ID_IS_LINKED(base_dst->object) || ID_IS_OVERRIDE_LIBRARY(base_dst->object)) {
|
||||
BKE_reportf(op->reports,
|
||||
RPT_ERROR,
|
||||
"Unable to execute, %s object is linked",
|
||||
base_dst->object->id.name + 2);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
const bool mode_transferred = object_transfer_mode_to_base(C, op, base_dst);
|
||||
if (!mode_transferred) {
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
Reference in New Issue
Block a user