From cf59d2a38534cf48128ee893b0015b882f43ffbc Mon Sep 17 00:00:00 2001 From: Falk David Date: Mon, 22 Apr 2024 18:25:45 +0200 Subject: [PATCH] GPv3: Expose Shader FX in the UI Enables GPv3 in the UI poll functions for shader FX. --- source/blender/editors/object/object_shader_fx.cc | 2 +- source/blender/editors/space_buttons/buttons_context.cc | 2 +- source/blender/shader_fx/intern/FX_ui_common.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/object/object_shader_fx.cc b/source/blender/editors/object/object_shader_fx.cc index 413acd23ba5..9f643d31ed8 100644 --- a/source/blender/editors/object/object_shader_fx.cc +++ b/source/blender/editors/object/object_shader_fx.cc @@ -61,7 +61,7 @@ ShaderFxData *shaderfx_add( ShaderFxData *new_fx = nullptr; const ShaderFxTypeInfo *fxi = BKE_shaderfx_get_info(ShaderFxType(type)); - if (ob->type != OB_GPENCIL_LEGACY) { + if (!ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL)) { BKE_reportf(reports, RPT_WARNING, "Effect cannot be added to object '%s'", ob->id.name + 2); return nullptr; } diff --git a/source/blender/editors/space_buttons/buttons_context.cc b/source/blender/editors/space_buttons/buttons_context.cc index 1b9cf99fdd1..602bdf70a27 100644 --- a/source/blender/editors/space_buttons/buttons_context.cc +++ b/source/blender/editors/space_buttons/buttons_context.cc @@ -327,7 +327,7 @@ static bool buttons_context_path_shaderfx(ButsContextPath *path) if (buttons_context_path_object(path)) { Object *ob = static_cast(path->ptr[path->len - 1].data); - if (ob && ELEM(ob->type, OB_GPENCIL_LEGACY)) { + if (ob && ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL)) { return true; } } diff --git a/source/blender/shader_fx/intern/FX_ui_common.cc b/source/blender/shader_fx/intern/FX_ui_common.cc index 52c79c7aab6..4d81851b28b 100644 --- a/source/blender/shader_fx/intern/FX_ui_common.cc +++ b/source/blender/shader_fx/intern/FX_ui_common.cc @@ -216,7 +216,7 @@ static bool shaderfx_ui_poll(const bContext *C, PanelType * /*pt*/) { Object *ob = blender::ed::object::context_active_object(C); - return (ob != nullptr) && (ob->type == OB_GPENCIL_LEGACY); + return (ob != nullptr) && (ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL)); } PanelType *shaderfx_panel_register(ARegionType *region_type, ShaderFxType type, PanelDrawFn draw)