Blender V5.0
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
8
9#include "DNA_screen_types.h"
10
11#include "BLT_translation.hh"
12
13#include "BKE_context.hh"
14#include "BKE_screen.hh"
15
17#include "UI_resources.hh"
18
19#include "RNA_access.hh"
20
21#include "FX_shader_types.h"
22#include "FX_ui_common.h"
23
24static void init_data(ShaderFxData *fx)
25{
27 gpfx->flag |= FX_FLIP_HORIZONTAL;
28}
29
30static void copy_data(const ShaderFxData *md, ShaderFxData *target)
31{
33}
34
35static void panel_draw(const bContext * /*C*/, Panel *panel)
36{
37 uiLayout *row;
38 uiLayout *layout = panel->layout;
40
42
43 layout->use_property_split_set(true);
44
45 row = &layout->row(true, IFACE_("Axis"));
46 row->prop(ptr, "use_flip_x", toggles_flag, std::nullopt, ICON_NONE);
47 row->prop(ptr, "use_flip_y", toggles_flag, std::nullopt, ICON_NONE);
48
49 shaderfx_panel_end(layout, ptr);
50}
51
52static void panel_register(ARegionType *region_type)
53{
55}
56
58 /*name*/ N_("Flip"),
59 /*struct_name*/ "FlipShaderFxData",
60 /*struct_size*/ sizeof(FlipShaderFxData),
62 /*flags*/ ShaderFxTypeFlag(0),
63
64 /*copy_data*/ copy_data,
65
66 /*init_data*/ init_data,
67 /*free_data*/ nullptr,
68 /*is_disabled*/ nullptr,
69 /*update_depsgraph*/ nullptr,
70 /*depends_on_time*/ nullptr,
71 /*foreach_ID_link*/ nullptr,
72 /*foreach_working_space_color*/ nullptr,
73 /*panel_register*/ panel_register,
74};
@ eShaderFxType_GpencilType
void BKE_shaderfx_copydata_generic(const struct ShaderFxData *fx_src, struct ShaderFxData *fx_dst)
ShaderFxTypeFlag
#define IFACE_(msgid)
@ FX_FLIP_HORIZONTAL
@ eShaderFxType_Flip
static void panel_register(ARegionType *region_type)
static void init_data(ShaderFxData *fx)
static void panel_draw(const bContext *, Panel *panel)
static void copy_data(const ShaderFxData *md, ShaderFxData *target)
ShaderFxTypeInfo shaderfx_Type_Flip
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)
static void init_data(ModifierData *md)
static void panel_register(ARegionType *region_type)
static void panel_draw(const bContext *, Panel *panel)
static void copy_data(const ModifierData *md, ModifierData *target, const int flag)
@ UI_ITEM_R_TOGGLE
@ UI_ITEM_R_FORCE_BLANK_DECORATE
struct uiLayout * layout
uiLayout & row(bool align)
void use_property_split_set(bool value)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
#define N_(msgid)
PointerRNA * ptr
Definition wm_files.cc:4238