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>2020-12-07 18:52:45 +0300
committerBastien Montagne <bastien@blender.org>2020-12-07 18:55:51 +0300
commitbab57550b69b8429bb2f081fbc75f1d1ca035a34 (patch)
tree2a92f1ea9a693b32bc22dea73d1dfe7bdfb4506b /source/blender/blenkernel/intern/gpencil_modifier.c
parent513578b182fd0c427b9da653b715f8bfb16faec1 (diff)
LibOverride: Abstract a bit handling of local items of RNA collections.
RNA collections that support insertion of new items in liboverride data-block need a special way to distiguish between locale and orig-from-linked items (since some operations are allowed on the forer, but no the latter). In future we want a proper solution to abstract that at the `BKE_lib_override` level, but for now we need to add some code for each case. Note that this commit also fixes a few potential issues with GPencil modifiers, and constraints, regarding their handling of local overrides.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil_modifier.c')
-rw-r--r--source/blender/blenkernel/intern/gpencil_modifier.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index 09f9e9e891c..7425a1a5f7a 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -531,6 +531,19 @@ void BKE_gpencil_modifier_set_error(GpencilModifierData *md, const char *_format
}
/**
+ * Check whether given modifier is local when the object is a library override.
+ *
+ * \param gmd May be NULL, in which case we consider it as a non-local modifier case.
+ *
+ * \note This check is only valid for a liboverride data-block, it always return \a true otherwise.
+ */
+bool BKE_gpencil_modifier_is_local_in_liboverride(const Object *ob, const GpencilModifierData *gmd)
+{
+ return (!ID_IS_OVERRIDE_LIBRARY(ob) ||
+ (gmd != NULL && (gmd->flag & eGpencilModifierFlag_OverrideLibrary_Local) != 0));
+}
+
+/**
* Link grease pencil modifier related IDs.
* \param ob: Grease pencil object
* \param walk: Walk option