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:
Diffstat (limited to 'source/blender/shader_fx/intern/FX_ui_common.c')
-rw-r--r--source/blender/shader_fx/intern/FX_ui_common.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/source/blender/shader_fx/intern/FX_ui_common.c b/source/blender/shader_fx/intern/FX_ui_common.c
index c1e3b2e21cd..9a86e1e96f5 100644
--- a/source/blender/shader_fx/intern/FX_ui_common.c
+++ b/source/blender/shader_fx/intern/FX_ui_common.c
@@ -124,6 +124,59 @@ PointerRNA *shaderfx_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_
#define ERROR_LIBDATA_MESSAGE TIP_("External library data")
+static void gpencil_shaderfx_ops_extra_draw(bContext *C, uiLayout *layout, void *fx_v)
+{
+ PointerRNA op_ptr;
+ uiLayout *row;
+ ShaderFxData *fx = (ShaderFxData *)fx_v;
+
+ PointerRNA ptr;
+ Object *ob = ED_object_active_context(C);
+ RNA_pointer_create(&ob->id, &RNA_ShaderFx, fx, &ptr);
+ uiLayoutSetContextPointer(layout, "shaderfx", &ptr);
+ uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT);
+
+ uiLayoutSetUnitsX(layout, 4.0f);
+
+ /* Duplicate. */
+ uiItemO(layout,
+ CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Duplicate"),
+ ICON_DUPLICATE,
+ "OBJECT_OT_shaderfx_copy");
+
+ uiItemS(layout);
+
+ /* Move to first. */
+ row = uiLayoutColumn(layout, false);
+ uiItemFullO(row,
+ "OBJECT_OT_shaderfx_move_to_index",
+ IFACE_("Move to First"),
+ ICON_TRIA_UP,
+ NULL,
+ WM_OP_INVOKE_DEFAULT,
+ 0,
+ &op_ptr);
+ RNA_int_set(&op_ptr, "index", 0);
+ if (!fx->prev) {
+ uiLayoutSetEnabled(row, false);
+ }
+
+ /* Move to last. */
+ row = uiLayoutColumn(layout, false);
+ uiItemFullO(row,
+ "OBJECT_OT_shaderfx_move_to_index",
+ IFACE_("Move to Last"),
+ ICON_TRIA_DOWN,
+ NULL,
+ WM_OP_INVOKE_DEFAULT,
+ 0,
+ &op_ptr);
+ RNA_int_set(&op_ptr, "index", BLI_listbase_count(&ob->shader_fx) - 1);
+ if (!fx->next) {
+ uiLayoutSetEnabled(row, false);
+ }
+}
+
static void shaderfx_panel_header(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
@@ -159,6 +212,9 @@ static void shaderfx_panel_header(const bContext *UNUSED(C), Panel *panel)
uiItemR(row, ptr, "show_viewport", 0, "", ICON_NONE);
uiItemR(row, ptr, "show_render", 0, "", ICON_NONE);
+ /* Extra operators. */
+ uiItemMenuF(row, "", ICON_DOWNARROW_HLT, gpencil_shaderfx_ops_extra_draw, fx);
+
row = uiLayoutRow(row, false);
uiLayoutSetEmboss(row, UI_EMBOSS_NONE);
uiItemO(row, "", ICON_X, "OBJECT_OT_shaderfx_remove");