diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-19 22:07:13 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-19 22:07:13 +0300 |
commit | bb4cef71eeaf36aa61187d47b8a8ae06ba55f7c0 (patch) | |
tree | 35700820beee851c984c9162d40952387cca5e39 /source/blender/shader_fx/intern/FX_shader_swirl.c | |
parent | 702e00f91088031f83cfed1528d5ed22069a9d35 (diff) |
UI: ShaderFx Drag and Drop, Layout Updates
This patch implements the list panel system D7490 for grease pencil
shader effects. It also moves their drawing to a callback in
ShaderFxTypeInfo in line with the extensible architecture refactoring
goal T75724.
The implementation is basically exactly the same as for the modifier
patch (9b099c86123fc82).
Thanks to Matias Mendiola (@mendio) for helping to develop the layout
changes.
Differential Revision: https://developer.blender.org/D7985
Diffstat (limited to 'source/blender/shader_fx/intern/FX_shader_swirl.c')
-rw-r--r-- | source/blender/shader_fx/intern/FX_shader_swirl.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/shader_fx/intern/FX_shader_swirl.c b/source/blender/shader_fx/intern/FX_shader_swirl.c index 990b43748da..65e861fa46f 100644 --- a/source/blender/shader_fx/intern/FX_shader_swirl.c +++ b/source/blender/shader_fx/intern/FX_shader_swirl.c @@ -26,15 +26,24 @@ #include "DNA_gpencil_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_screen_types.h" #include "BLI_math_base.h" #include "BLI_utildefines.h" +#include "BKE_context.h" #include "BKE_lib_query.h" #include "BKE_modifier.h" +#include "BKE_screen.h" #include "BKE_shader_fx.h" +#include "UI_interface.h" +#include "UI_resources.h" + +#include "RNA_access.h" + #include "FX_shader_types.h" +#include "FX_ui_common.h" #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" @@ -77,6 +86,28 @@ static void foreachObjectLink(ShaderFxData *fx, walk(userData, ob, &fxd->object, IDWALK_CB_NOP); } +static void panel_draw(const bContext *C, Panel *panel) +{ + uiLayout *layout = panel->layout; + + PointerRNA ptr; + PointerRNA ob_ptr; + shaderfx_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + + uiLayoutSetPropSep(layout, true); + + uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE); + uiItemR(layout, &ptr, "radius", 0, NULL, ICON_NONE); + uiItemR(layout, &ptr, "angle", 0, NULL, ICON_NONE); + + shaderfx_panel_end(layout, &ptr); +} + +static void panelRegister(ARegionType *region_type) +{ + shaderfx_panel_register(region_type, eShaderFxType_Swirl, panel_draw); +} + ShaderFxTypeInfo shaderfx_Type_Swirl = { /* name */ "Swirl", /* structName */ "SwirlShaderFxData", @@ -93,4 +124,5 @@ ShaderFxTypeInfo shaderfx_Type_Swirl = { /* dependsOnTime */ NULL, /* foreachObjectLink */ foreachObjectLink, /* foreachIDLink */ NULL, + /* panelRegister */ panelRegister, }; |