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_edit.c
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_edit.c')
-rw-r--r--source/blender/editors/object/object_edit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 7cef3e1725b..cc8644285c0 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -51,6 +51,7 @@
#include "BKE_image.h"
#include "BKE_lattice.h"
#include "BKE_layer.h"
+#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mball.h"
@@ -973,7 +974,7 @@ static int posemode_exec(bContext *C, wmOperator *op)
const View3D *v3d = CTX_wm_view3d(C);
FOREACH_SELECTED_OBJECT_BEGIN (view_layer, v3d, ob) {
if ((ob != obact) && (ob->type == OB_ARMATURE) && (ob->mode == OB_MODE_OBJECT) &&
- (!ID_IS_LINKED(ob))) {
+ BKE_id_is_editable(bmain, &ob->id)) {
ED_object_posemode_enter_ex(bmain, ob);
}
}
@@ -1528,6 +1529,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
}
}
+ Main *bmain = CTX_data_main(C);
LISTBASE_FOREACH (CollectionPointerLink *, ctx_ob, &ctx_objects) {
/* Always un-tag all object data-blocks irrespective of our ability to operate on them. */
Object *ob = ctx_ob->ptr.data;
@@ -1538,7 +1540,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
data->tag &= ~LIB_TAG_DOIT;
/* Finished un-tagging, continue with regular logic. */
- if (data && ID_IS_LINKED(data)) {
+ if (data && !BKE_id_is_editable(bmain, data)) {
has_linked_data = true;
continue;
}