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:
authorBastien Montagne <bastien@blender.org>2022-03-28 18:34:36 +0300
committerBastien Montagne <bastien@blender.org>2022-03-29 18:59:55 +0300
commit5596f79821caae3d4c1eb608ce77371904f74b80 (patch)
tree92dbb06728dd7bbecfa71d17dbe25cde49dfdeb5 /source/blender/editors/object/object_transform.cc
parent354db59fb12a5ee595ae650ac3a736e3cc6df39d (diff)
LibOverride: Massive edits to 'editable' IDs checks in editors code.
Add new `BKE_id_is_editable` helper in `BKE_lib_id.h`, that supercedes previous check (simple `ID_IS_LINKED()` macro) for many editing cases. This allows to also take into account 'system override' (aka non-editable override) case. Ref: {T95707}.
Diffstat (limited to 'source/blender/editors/object/object_transform.cc')
-rw-r--r--source/blender/editors/object/object_transform.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc
index afd2c048379..da75703a0d9 100644
--- a/source/blender/editors/object/object_transform.cc
+++ b/source/blender/editors/object/object_transform.cc
@@ -622,10 +622,10 @@ static int apply_objects_internal(bContext *C,
changed = false;
}
- if (ID_IS_LINKED(obdata)) {
+ if (ID_IS_LINKED(obdata) || ID_IS_OVERRIDE_LIBRARY(obdata)) {
BKE_reportf(reports,
RPT_ERROR,
- R"(Cannot apply to library data: Object "%s", %s "%s", aborting)",
+ R"(Cannot apply to library or override data: Object "%s", %s "%s", aborting)",
ob->id.name + 2,
BKE_idtype_idcode_to_name(GS(obdata->name)),
obdata->name + 2);
@@ -1138,7 +1138,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
/* Special support for instanced collections. */
if ((ob->transflag & OB_DUPLICOLLECTION) && ob->instance_collection &&
(ob->instance_collection->id.tag & LIB_TAG_DOIT) == 0) {
- if (ID_IS_LINKED(ob->instance_collection)) {
+ if (!BKE_id_is_editable(bmain, &ob->instance_collection->id)) {
tot_lib_error++;
}
else {
@@ -1163,7 +1163,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
}
}
}
- else if (ID_IS_LINKED(ob->data)) {
+ else if (ID_IS_LINKED(ob->data) || ID_IS_OVERRIDE_LIBRARY(ob->data)) {
tot_lib_error++;
}
else if (ob->type == OB_MESH) {