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-08-12 11:50:19 +0300
committerBastien Montagne <bastien@blender.org>2020-08-12 12:11:48 +0300
commit4e31b5b1738cc36ee66421ecd16dc1662464ca89 (patch)
tree6a48018c7a9eb16d5c90d3bb82514f2e3ff94fc9 /source/blender/editors/object/object_shader_fx.c
parentb3702f5918863eb743406b4543552a1ca7f00c19 (diff)
Fix (unreported) broken Poll function of GPencile mods and ShaderFX operators in liboverride case.
Those where assuming we always get a valid modifier data from context, which is not always true... Also fix similar issue with shortcuts as reported in T79635.
Diffstat (limited to 'source/blender/editors/object/object_shader_fx.c')
-rw-r--r--source/blender/editors/object/object_shader_fx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c
index 977d4abd4d4..9cfba767dad 100644
--- a/source/blender/editors/object/object_shader_fx.c
+++ b/source/blender/editors/object/object_shader_fx.c
@@ -332,6 +332,7 @@ static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obt
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "shaderfx", rna_type);
Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C);
+ ShaderFxData *fx = ptr.data; /* May be NULL. */
if (!ob || ID_IS_LINKED(ob)) {
return 0;
@@ -344,8 +345,10 @@ static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obt
}
if (ID_IS_OVERRIDE_LIBRARY(ob)) {
- CTX_wm_operator_poll_msg_set(C, "Cannot edit shaderfxs coming from library override");
- return (((ShaderFxData *)ptr.data)->flag & eShaderFxFlag_OverrideLibrary_Local) != 0;
+ if ((fx == NULL) || (fx->flag & eShaderFxFlag_OverrideLibrary_Local) == 0) {
+ CTX_wm_operator_poll_msg_set(C, "Cannot edit shaderfxs coming from library override");
+ return 0;
+ }
}
return 1;