From ff89d101e7cbed7c84349953a789380fee47f839 Mon Sep 17 00:00:00 2001 From: Sriharsha Kotcharlakot Date: Mon, 5 Oct 2020 21:47:11 +0530 Subject: UI: Changes to Viewport Display UI of Volume Object and Fluid - Density, interpolation and slicing options in Volume Object's Viewport Display are now not aligned to each other as they are not closely related. - Changed the enum property for slicing ('Method') to a boolean property 'Slice' and added a sub-panel for slicing options under the 'Viewport Display' panel in Volume Object and Fluid for better clarity. - Renamed `axis_slice_method` to `use_slice` in the python API for Volume Object and Fluid. Reviewed By: brecht Differential Revision: https://developer.blender.org/D9097 --- source/blender/makesrna/intern/rna_fluid.c | 13 +++---------- source/blender/makesrna/intern/rna_volume.c | 16 +++------------- 2 files changed, 6 insertions(+), 23 deletions(-) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index 9d7359bb8f0..cb64d81533f 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -1306,12 +1306,6 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem axis_slice_method_items[] = { - {AXIS_SLICE_FULL, "FULL", 0, "Full", "Slice the whole domain object"}, - {AXIS_SLICE_SINGLE, "SINGLE", 0, "Single", "Perform a single slice of the domain object"}, - {0, NULL, 0, NULL, NULL}, - }; - static const EnumPropertyItem interp_method_item[] = { {FLUID_DISPLAY_INTERP_LINEAR, "LINEAR", 0, "Linear", "Good smoothness and speed"}, {FLUID_DISPLAY_INTERP_CUBIC, @@ -2439,10 +2433,9 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) /* display settings */ - prop = RNA_def_property(srna, "axis_slice_method", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "axis_slice_method"); - RNA_def_property_enum_items(prop, axis_slice_method_items); - RNA_def_property_ui_text(prop, "Method", ""); + prop = RNA_def_property(srna, "use_slice", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "axis_slice_method", AXIS_SLICE_SINGLE); + RNA_def_property_ui_text(prop, "Slice", "Perform a single slice of the domain object"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "slice_axis", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_volume.c b/source/blender/makesrna/intern/rna_volume.c index 054f108099b..8a5e25c52fb 100644 --- a/source/blender/makesrna/intern/rna_volume.c +++ b/source/blender/makesrna/intern/rna_volume.c @@ -406,16 +406,6 @@ static void rna_def_volume_display(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem axis_slice_method_items[] = { - {VOLUME_AXIS_SLICE_FULL, "FULL", 0, "Full", "Slice the whole domain object"}, - {VOLUME_AXIS_SLICE_SINGLE, - "SINGLE", - 0, - "Single", - "Perform a single slice of the domain object"}, - {0, NULL, 0, NULL, NULL}, - }; - static const EnumPropertyItem axis_slice_position_items[] = { {VOLUME_SLICE_AXIS_AUTO, "AUTO", @@ -444,9 +434,9 @@ static void rna_def_volume_display(BlenderRNA *brna) prop, "Interpolation", "Interpolation method to use for volumes in solid mode"); RNA_def_property_update(prop, 0, "rna_Volume_update_display"); - prop = RNA_def_property(srna, "axis_slice_method", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, axis_slice_method_items); - RNA_def_property_ui_text(prop, "Method", ""); + prop = RNA_def_property(srna, "use_slice", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "axis_slice_method", VOLUME_AXIS_SLICE_SINGLE); + RNA_def_property_ui_text(prop, "Slice", "Perform a single slice of the domain object"); RNA_def_property_update(prop, 0, "rna_Volume_update_display"); prop = RNA_def_property(srna, "slice_axis", PROP_ENUM, PROP_NONE); -- cgit v1.2.3