From a46de41db595de4c2564af25a091a420723a222f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 28 Mar 2022 17:34:36 +0200 Subject: 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}. --- source/blender/editors/geometry/geometry_attributes.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/geometry') diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc index 6225a68f53c..5d9d02db660 100644 --- a/source/blender/editors/geometry/geometry_attributes.cc +++ b/source/blender/editors/geometry/geometry_attributes.cc @@ -15,6 +15,7 @@ #include "BKE_context.h" #include "BKE_deform.h" #include "BKE_geometry_set.hh" +#include "BKE_lib_id.h" #include "BKE_object_deform.h" #include "BKE_report.h" @@ -41,8 +42,9 @@ namespace blender::ed::geometry { static bool geometry_attributes_poll(bContext *C) { Object *ob = ED_object_context(C); + Main *bmain = CTX_data_main(C); ID *data = (ob) ? static_cast(ob->data) : nullptr; - return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data)) && + return (ob && BKE_id_is_editable(bmain, &ob->id) && data && BKE_id_is_editable(bmain, data)) && BKE_id_attributes_supported(data); } -- cgit v1.2.3