diff options
Diffstat (limited to 'source/blender/shader_fx/intern/FX_shader_flip.c')
-rw-r--r-- | source/blender/shader_fx/intern/FX_shader_flip.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/shader_fx/intern/FX_shader_flip.c b/source/blender/shader_fx/intern/FX_shader_flip.c index b915fb8e591..325d2c2608f 100644 --- a/source/blender/shader_fx/intern/FX_shader_flip.c +++ b/source/blender/shader_fx/intern/FX_shader_flip.c @@ -26,10 +26,22 @@ #include "DNA_gpencil_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_screen_types.h" #include "BLI_utildefines.h" +#include "BLT_translation.h" + +#include "BKE_context.h" +#include "BKE_screen.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#include "RNA_access.h" + #include "FX_shader_types.h" +#include "FX_ui_common.h" static void initData(ShaderFxData *fx) { @@ -42,6 +54,29 @@ static void copyData(const ShaderFxData *md, ShaderFxData *target) BKE_shaderfx_copydata_generic(md, target); } +static void panel_draw(const bContext *C, Panel *panel) +{ + uiLayout *row; + uiLayout *layout = panel->layout; + int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; + + PointerRNA ptr; + shaderfx_panel_get_property_pointers(C, panel, NULL, &ptr); + + uiLayoutSetPropSep(layout, true); + + row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis")); + uiItemR(row, &ptr, "flip_horizontal", toggles_flag, NULL, ICON_NONE); + uiItemR(row, &ptr, "flip_vertical", toggles_flag, NULL, ICON_NONE); + + shaderfx_panel_end(layout, &ptr); +} + +static void panelRegister(ARegionType *region_type) +{ + shaderfx_panel_register(region_type, eShaderFxType_Flip, panel_draw); +} + ShaderFxTypeInfo shaderfx_Type_Flip = { /* name */ "Flip", /* structName */ "FlipShaderFxData", @@ -58,4 +93,5 @@ ShaderFxTypeInfo shaderfx_Type_Flip = { /* dependsOnTime */ NULL, /* foreachObjectLink */ NULL, /* foreachIDLink */ NULL, + /* panelRegister */ panelRegister, }; |