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
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:31:50 +0300
commita46de41db595de4c2564af25a091a420723a222f (patch)
tree4a90a688d8ff02c4d180aa7f16757f16b9236502 /source/blender/editors/geometry
parent59975875f892f004330e4df85ed8dec4a8036778 (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/geometry')
-rw-r--r--source/blender/editors/geometry/geometry_attributes.cc4
1 files changed, 3 insertions, 1 deletions
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<ID *>(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);
}