Blender V4.3
FX_shader_wave.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2018 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 "BKE_context.hh"
17#include "BKE_screen.hh"
18
19#include "BLI_utildefines.h"
20
21#include "BLT_translation.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->amplitude = 10.0f;
35 gpfx->period = 20.0f;
36 gpfx->phase = 0.0f;
37 gpfx->orientation = 1;
38}
39
40static void copy_data(const ShaderFxData *md, ShaderFxData *target)
41{
43}
44
45static void panel_draw(const bContext * /*C*/, Panel *panel)
46{
47 uiLayout *layout = panel->layout;
48
50
51 uiLayoutSetPropSep(layout, true);
52
53 uiItemR(layout, ptr, "orientation", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
54 uiItemR(layout, ptr, "amplitude", UI_ITEM_NONE, nullptr, ICON_NONE);
55 uiItemR(layout, ptr, "period", UI_ITEM_NONE, nullptr, ICON_NONE);
56 uiItemR(layout, ptr, "phase", UI_ITEM_NONE, nullptr, ICON_NONE);
57
58 shaderfx_panel_end(layout, ptr);
59}
60
61static void panel_register(ARegionType *region_type)
62{
64}
65
67 /*name*/ N_("WaveDistortion"),
68 /*struct_name*/ "WaveShaderFxData",
69 /*struct_size*/ sizeof(WaveShaderFxData),
71 /*flags*/ ShaderFxTypeFlag(0),
72
73 /*copy_data*/ copy_data,
74
75 /*init_data*/ init_data,
76 /*free_data*/ nullptr,
77 /*is_disabled*/ nullptr,
78 /*update_depsgraph*/ nullptr,
79 /*depends_on_time*/ nullptr,
80 /*foreach_ID_link*/ nullptr,
81 /*panel_register*/ panel_register,
82};
@ eShaderFxType_GpencilType
void BKE_shaderfx_copydata_generic(const struct ShaderFxData *fx_src, struct ShaderFxData *fx_dst)
ShaderFxTypeFlag
Object is a sort of wrapper for general info.
struct WaveShaderFxData WaveShaderFxData
@ eShaderFxType_Wave
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_Wave
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)
#define UI_ITEM_NONE
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_EXPAND
struct uiLayout * layout
#define N_(msgid)
PointerRNA * ptr
Definition wm_files.cc:4126