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/makesrna | |
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/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_shader_fx.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 71f767fa93b..d0565bb3aab 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -424,7 +424,7 @@ static void rna_def_shader_fx_shadow(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Offset", "Offset of the shadow"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); - prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_text(prop, "Scale", "Offset of the shadow"); @@ -681,9 +681,9 @@ void RNA_def_shader_fx(BlenderRNA *brna) prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", eShaderFxMode_Expanded); + RNA_def_property_boolean_sdna(prop, NULL, "ui_expand_flag", 0); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); - RNA_def_property_ui_text(prop, "Expanded", "Set effect expanded in the user interface"); + RNA_def_property_ui_text(prop, "Expanded", "Set effect expansion in the user interface"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); /* types */ diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 974daa51f99..906732c5fca 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -1229,11 +1229,7 @@ void RNA_api_ui_layout(StructRNA *srna) func = RNA_def_function(srna, "template_shaderfx", "uiTemplateShaderFx"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Generates the UI layout for shader effect"); - parm = RNA_def_pointer(func, "data", "ShaderFx", "", "Shader data"); - RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); - parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); - RNA_def_function_return(func, parm); + RNA_def_function_ui_description(func, "Generates the panels for the shader effect stack"); func = RNA_def_function(srna, "template_greasepencil_color", "uiTemplateGpencilColorPreview"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); |