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>2021-06-16 17:03:35 +0300
committerBastien Montagne <bastien@blender.org>2021-06-16 17:09:28 +0300
commitaf3d7123c9721bc0e53432528839a32ed5da920b (patch)
tree649fd602aa2def6095be9b339ba794c9007708d2 /source/blender/blenkernel/intern/shader_fx.c
parent3953b82030ab75689ece389c02b8c7ca389311b4 (diff)
ShaderFX/LibOverride: Add `BKE_shaderfx_is_nonlocal_in_liboverride` util.
Used to detect if a shaderfx is purely local, or comes from linked data, in case of a liboverride. Not actually used yet since we do not currently support adding shaderfx's to overrides, but will be in the future, and matches constraints and modifiers code.
Diffstat (limited to 'source/blender/blenkernel/intern/shader_fx.c')
-rw-r--r--source/blender/blenkernel/intern/shader_fx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/shader_fx.c b/source/blender/blenkernel/intern/shader_fx.c
index 3727ec866ca..60f0b744e59 100644
--- a/source/blender/blenkernel/intern/shader_fx.c
+++ b/source/blender/blenkernel/intern/shader_fx.c
@@ -165,6 +165,18 @@ const ShaderFxTypeInfo *BKE_shaderfx_get_info(ShaderFxType type)
}
/**
+ * Check whether given shaderfx is not local (i.e. from linked data) when the object is a library
+ * override.
+ *
+ * \param shaderfx: May be NULL, in which case we consider it as a non-local shaderfx case.
+ */
+bool BKE_shaderfx_is_nonlocal_in_liboverride(const Object *ob, const ShaderFxData *shaderfx)
+{
+ return (ID_IS_OVERRIDE_LIBRARY(ob) &&
+ ((shaderfx == NULL) || (shaderfx->flag & eShaderFxFlag_OverrideLibrary_Local) == 0));
+}
+
+/**
* Get an effect's panel type, which was defined in the #panelRegister callback.
*
* \note ShaderFx panel types are assumed to be named with the struct name field concatenated to