Blender V4.3
FX_shader_flip.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2017 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdio>
10
12#include "DNA_object_types.h"
13#include "DNA_scene_types.h"
14#include "DNA_screen_types.h"
15
16#include "BLI_utildefines.h"
17
18#include "BLT_translation.hh"
19
20#include "BKE_context.hh"
21#include "BKE_screen.hh"
22
23#include "UI_interface.hh"
24#include "UI_resources.hh"
25
26#include "RNA_access.hh"
27
28#include "FX_shader_types.h"
29#include "FX_ui_common.h"
30
31static void init_data(ShaderFxData *fx)
32{
34 gpfx->flag |= FX_FLIP_HORIZONTAL;
35}
36
37static void copy_data(const ShaderFxData *md, ShaderFxData *target)
38{
40}
41
42static void panel_draw(const bContext * /*C*/, Panel *panel)
43{
44 uiLayout *row;
45 uiLayout *layout = panel->layout;
47
49
50 uiLayoutSetPropSep(layout, true);
51
52 row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis"));
53 uiItemR(row, ptr, "use_flip_x", toggles_flag, nullptr, ICON_NONE);
54 uiItemR(row, ptr, "use_flip_y", toggles_flag, nullptr, ICON_NONE);
55
56 shaderfx_panel_end(layout, ptr);
57}
58
59static void panel_register(ARegionType *region_type)
60{
62}
63
65 /*name*/ N_("Flip"),
66 /*struct_name*/ "FlipShaderFxData",
67 /*struct_size*/ sizeof(FlipShaderFxData),
69 /*flags*/ ShaderFxTypeFlag(0),
70
71 /*copy_data*/ copy_data,
72
73 /*init_data*/ init_data,
74 /*free_data*/ nullptr,
75 /*is_disabled*/ nullptr,
76 /*update_depsgraph*/ nullptr,
77 /*depends_on_time*/ nullptr,
78 /*foreach_ID_link*/ nullptr,
79 /*panel_register*/ panel_register,
80};
@ eShaderFxType_GpencilType
void BKE_shaderfx_copydata_generic(const struct ShaderFxData *fx_src, struct ShaderFxData *fx_dst)
ShaderFxTypeFlag
#define IFACE_(msgid)
Object is a sort of wrapper for general info.
struct FlipShaderFxData FlipShaderFxData
@ FX_FLIP_HORIZONTAL
@ eShaderFxType_Flip
static void panel_register(ARegionType *region_type)
ShaderFxTypeInfo shaderfx_Type_Flip
static void init_data(ShaderFxData *fx)
static void panel_draw(const bContext *, Panel *panel)
static void copy_data(const ShaderFxData *md, ShaderFxData *target)
PanelType * shaderfx_panel_register(ARegionType *region_type, ShaderFxType type, PanelDrawFn draw)
void shaderfx_panel_end(uiLayout *layout, PointerRNA *ptr)
PointerRNA * shaderfx_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutRowWithHeading(uiLayout *layout, bool align, const char *heading)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
eUI_Item_Flag
@ UI_ITEM_R_TOGGLE
@ UI_ITEM_R_FORCE_BLANK_DECORATE
struct uiLayout * layout
#define N_(msgid)
PointerRNA * ptr
Definition wm_files.cc:4126