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/gpencil/gpencil_data.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/gpencil/gpencil_data.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 338a7c8a51d..6843c42d2d0 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -2195,8 +2195,9 @@ static bool gpencil_vertex_group_poll(bContext *C)
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
+ Main *bmain = CTX_data_main(C);
const bGPdata *gpd = (const bGPdata *)ob->data;
- if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) &&
+ if (BKE_id_is_editable(bmain, &ob->id) && BKE_id_is_editable(bmain, ob->data) &&
!BLI_listbase_is_empty(&gpd->vertex_group_names)) {
if (ELEM(ob->mode, OB_MODE_EDIT_GPENCIL, OB_MODE_SCULPT_GPENCIL)) {
return true;
@@ -2212,8 +2213,9 @@ static bool gpencil_vertex_group_weight_poll(bContext *C)
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
+ Main *bmain = CTX_data_main(C);
const bGPdata *gpd = (const bGPdata *)ob->data;
- if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) &&
+ if (BKE_id_is_editable(bmain, &ob->id) && BKE_id_is_editable(bmain, ob->data) &&
!BLI_listbase_is_empty(&gpd->vertex_group_names)) {
if (ob->mode == OB_MODE_WEIGHT_GPENCIL) {
return true;