GPv3: Expose Shader FX in the UI

Enables GPv3 in the UI poll functions for shader FX.
This commit is contained in:
Falk David
2024-04-22 18:25:45 +02:00
parent 22c6831f63
commit cf59d2a385
3 changed files with 3 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -327,7 +327,7 @@ static bool buttons_context_path_shaderfx(ButsContextPath *path)
if (buttons_context_path_object(path)) {
Object *ob = static_cast<Object *>(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;
}
}

View File

@@ -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)