diff options
author | Joshua Leung <aligorith@gmail.com> | 2017-01-18 06:43:17 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2017-01-18 09:41:58 +0300 |
commit | 224ae234439727628ec5c260d1fd4e22e6566e29 (patch) | |
tree | a157004e6c6d7f273c09588d038a6d80f28f1dce /source/blender/makesrna/intern/rna_scene.c | |
parent | 4903a83235524d852dec52d189c6744d4794d613 (diff) |
GP Interpolate: Move settings from "gp_sculpt" to a new toolsettings struct - "gp_interpolate"
The "gp_sculpt" settings should be strictly for stroke sculpting, and not abused by
other tools. (Similarly, if other general GP tools need one-off options, those should
go into the normal toolsettings->gpencil_flag)
Furthermore, this paves the way for introducing new settings for controlling the way
that GP interpolation takes place (e.g. with easing equations, or a custom curvemap)
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 6947a4104c8..8f5304c8f0c 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -447,6 +447,12 @@ EnumPropertyItem rna_enum_bake_pass_filter_type_items[] = { #include "FRS_freestyle.h" #endif +/* Grease Pencil Interpolation settings */ +static char *rna_GPencilInterpolateSettings_path(PointerRNA *UNUSED(ptr)) +{ + return BLI_strdup("tool_settings.gpencil_interpolate"); +} + /* Grease pencil Drawing Brushes */ static bGPDbrush *rna_GPencil_brush_new(ToolSettings *ts, const char *name, int setactive) { @@ -2138,6 +2144,30 @@ static int rna_gpu_is_hq_supported_get(PointerRNA *UNUSED(ptr)) #else +/* Grease Pencil Interpolation tool settings */ +static void rna_def_gpencil_interpolate(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "GPencilInterpolateSettings", NULL); + RNA_def_struct_sdna(srna, "GP_Interpolate_Settings"); + RNA_def_struct_path_func(srna, "rna_GPencilInterpolateSettings_path"); + RNA_def_struct_ui_text(srna, "Grease Pencil Interpolate Settings", + "Settings for Grease Pencil interpolation tools"); + + /* flags */ + prop = RNA_def_property(srna, "interpolate_all_layers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS); + RNA_def_property_ui_text(prop, "Interpolate All Layers", "Interpolate all layers, not only active"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + + prop = RNA_def_property(srna, "interpolate_selected_only", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED); + RNA_def_property_ui_text(prop, "Interpolate Selected Strokes", "Interpolate only selected strokes in the original frame"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); +} + /* Grease Pencil Drawing Brushes */ static void rna_def_gpencil_brush(BlenderRNA *brna) { @@ -2673,7 +2703,14 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gp_sculpt"); RNA_def_property_struct_type(prop, "GPencilSculptSettings"); - RNA_def_property_ui_text(prop, "Grease Pencil Sculpt", ""); + RNA_def_property_ui_text(prop, "Grease Pencil Sculpt", + "Settings for stroke sculpting tools and brushes"); + + prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "gp_interpolate"); + RNA_def_property_struct_type(prop, "GPencilInterpolateSettings"); + RNA_def_property_ui_text(prop, "Grease Pencil Interpolate", + "Settings for Grease Pencil Interpolation tools"); /* Grease Pencil - Drawing brushes */ prop = RNA_def_property(srna, "gpencil_brushes", PROP_COLLECTION, PROP_NONE); @@ -7267,6 +7304,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_define_animate_sdna(false); rna_def_tool_settings(brna); rna_def_gpencil_brush(brna); + rna_def_gpencil_interpolate(brna); rna_def_unified_paint_settings(brna); rna_def_curve_paint_settings(brna); rna_def_statvis(brna); |