diff options
author | Sriharsha Kotcharlakot <k.venkatsriharsha@gmail.com> | 2020-09-15 18:51:14 +0300 |
---|---|---|
committer | Sriharsha Kotcharlakot <k.venkatsriharsha@gmail.com> | 2020-09-15 20:43:01 +0300 |
commit | f137022f9919f4dd315ec6b325a08e1bf5aec6fb (patch) | |
tree | 4b15aa230eb100e77b41dfffb8ef5e7501c55db5 /source/blender/makesrna/intern/rna_volume.c | |
parent | bedbd8655ed1d331aeaf756874c46dbed93168a1 (diff) |
Liquid Simulation Display Options (GSoC 2020)
All the changes made in the branch `soc-2020-fluid-tools` are included in this patch.
**Major changes:**
=== Viewport Display ===
- //Raw voxel display// or //closest (nearest-neighbor)// interpolation for displaying the underlying voxel data of the simulation grids more clearly.
- An option to display //gridlines// when the slicing method is //single//.
==== Grid Display ====
- Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Manta GUI.
==== Vector Display ====
- //**M**arker **A**nd **C**ell// grid visualization options for vector grids like velocity or external forces.
- Made vector display options available for external forces.
==== Coloring options for //gridlines// ====
- Range highlighting and cell filtering options for displaying the simulation grid data more precisely.
- Color gridlines with flags.
- Also, made slicing and interpolation options available for Volume Object.
Reviewed By: JacquesLucke, sebbas
Differential Revision: https://developer.blender.org/D8705
Diffstat (limited to 'source/blender/makesrna/intern/rna_volume.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_volume.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_volume.c b/source/blender/makesrna/intern/rna_volume.c index b03d6082cea..054f108099b 100644 --- a/source/blender/makesrna/intern/rna_volume.c +++ b/source/blender/makesrna/intern/rna_volume.c @@ -395,6 +395,39 @@ static void rna_def_volume_display(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem interpolation_method_items[] = { + {VOLUME_DISPLAY_INTERP_LINEAR, "LINEAR", 0, "Linear", "Good smoothness and speed"}, + {VOLUME_DISPLAY_INTERP_CUBIC, + "CUBIC", + 0, + "Cubic", + "Smoothed high quality interpolation, but slower"}, + {VOLUME_DISPLAY_INTERP_CLOSEST, "CLOSEST", 0, "Closest", "No interpolation"}, + {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", + 0, + "Auto", + "Adjust slice direction according to the view direction"}, + {VOLUME_SLICE_AXIS_X, "X", 0, "X", "Slice along the X axis"}, + {VOLUME_SLICE_AXIS_Y, "Y", 0, "Y", "Slice along the Y axis"}, + {VOLUME_SLICE_AXIS_Z, "Z", 0, "Z", "Slice along the Z axis"}, + {0, NULL, 0, NULL, NULL}, + }; + prop = RNA_def_property(srna, "wireframe_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, wireframe_type_items); RNA_def_property_ui_text(prop, "Wireframe", "Type of wireframe display"); @@ -404,6 +437,27 @@ static void rna_def_volume_display(BlenderRNA *brna) RNA_def_property_enum_items(prop, wireframe_detail_items); RNA_def_property_ui_text(prop, "Wireframe Detail", "Amount of detail for wireframe display"); RNA_def_property_update(prop, 0, "rna_Volume_update_display"); + + prop = RNA_def_property(srna, "interpolation_method", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, interpolation_method_items); + RNA_def_property_ui_text( + 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", ""); + RNA_def_property_update(prop, 0, "rna_Volume_update_display"); + + prop = RNA_def_property(srna, "slice_axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, axis_slice_position_items); + RNA_def_property_ui_text(prop, "Axis", ""); + + prop = RNA_def_property(srna, "slice_depth", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 3); + RNA_def_property_ui_text(prop, "Position", "Position of the slice"); + RNA_def_property_update(prop, 0, "rna_Volume_update_display"); } static void rna_def_volume_render(BlenderRNA *brna) |