Blender V5.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
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.hh"
22#include "FX_ui_common.hh"
23
24namespace blender {
25
26static void init_data(ShaderFxData *fx)
27{
28 FlipShaderFxData *gpfx = reinterpret_cast<FlipShaderFxData *>(fx);
29 gpfx->flag |= FX_FLIP_HORIZONTAL;
30}
31
32static void copy_data(const ShaderFxData *md, ShaderFxData *target)
33{
35}
36
37static void panel_draw(const bContext * /*C*/, Panel *panel)
38{
39 ui::Layout &layout = *panel->layout;
41
43
44 layout.use_property_split_set(true);
45
46 ui::Layout &row = layout.row(true, IFACE_("Axis"));
47 row.prop(ptr, "use_flip_x", toggles_flag, std::nullopt, ICON_NONE);
48 row.prop(ptr, "use_flip_y", toggles_flag, std::nullopt, ICON_NONE);
49
50 shaderfx_panel_end(layout, ptr);
51}
52
53static void panel_register(ARegionType *region_type)
54{
56}
57
59 /*name*/ N_("Flip"),
60 /*struct_name*/ "FlipShaderFxData",
61 /*struct_size*/ sizeof(FlipShaderFxData),
63 /*flags*/ ShaderFxTypeFlag(0),
64
65 /*copy_data*/ copy_data,
66
67 /*init_data*/ init_data,
68 /*free_data*/ nullptr,
69 /*is_disabled*/ nullptr,
70 /*update_depsgraph*/ nullptr,
71 /*depends_on_time*/ nullptr,
72 /*foreach_ID_link*/ nullptr,
73 /*foreach_working_space_color*/ nullptr,
74 /*panel_register*/ panel_register,
75};
76
77} // namespace blender
#define IFACE_(msgid)
BMesh Iterators.
static void copy_data(const ModifierData *md, ModifierData *target, const int flag)
PanelType * shaderfx_panel_register(ARegionType *region_type, ShaderFxType type, PanelDrawFn draw)
static void init_data(ModifierData *md)
ShaderFxTypeInfo shaderfx_Type_Flip
static void panel_register(ARegionType *region_type)
@ eShaderFxType_GpencilType
void shaderfx_panel_end(ui::Layout &layout, PointerRNA *ptr)
PointerRNA * shaderfx_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr)
static void panel_draw(const bContext *, Panel *panel)
void BKE_shaderfx_copydata_generic(const ShaderFxData *fx_src, ShaderFxData *fx_dst)
Definition shader_fx.cc:161
ui::Layout * layout
void use_property_split_set(bool is_sep)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
Layout & row(bool align)
#define N_(msgid)