Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSriharsha Kotcharlakot <k.venkatsriharsha@gmail.com>2020-10-05 19:17:11 +0300
committerSriharsha Kotcharlakot <k.venkatsriharsha@gmail.com>2020-10-05 20:42:48 +0300
commitff89d101e7cbed7c84349953a789380fee47f839 (patch)
treead12737ea5ffdd75a9e744fb783fce1ff327a3d3
parentffd46014470567fa75a5b6492677137f07936428 (diff)
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
-rw-r--r--release/scripts/modules/rna_manual_reference.py4
-rw-r--r--release/scripts/startup/bl_operators/object_quick_effects.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_data_volume.py37
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py51
-rw-r--r--source/blender/makesrna/intern/rna_fluid.c13
-rw-r--r--source/blender/makesrna/intern/rna_volume.c16
6 files changed, 77 insertions, 48 deletions
diff --git a/release/scripts/modules/rna_manual_reference.py b/release/scripts/modules/rna_manual_reference.py
index a7d338f3b53..9c4d2530674 100644
--- a/release/scripts/modules/rna_manual_reference.py
+++ b/release/scripts/modules/rna_manual_reference.py
@@ -138,7 +138,6 @@ url_manual_mapping = (
("bpy.types.view3doverlay.sculpt_mode_mask_opacity*", "sculpt_paint/sculpting/hide_mask.html#bpy-types-view3doverlay-sculpt-mode-mask-opacity"),
("bpy.ops.outliner.collection_indirect_only_clear*", "render/layers/layers.html#bpy-ops-outliner-collection-indirect-only-clear"),
("bpy.types.cyclesrendersettings.max_subdivisions*", "render/cycles/render_settings/subdivision.html#bpy-types-cyclesrendersettings-max-subdivisions"),
- ("bpy.types.fluiddomainsettings.axis_slice_method*", "physics/fluid/type/domain/gas/viewport_display.html#bpy-types-fluiddomainsettings-axis-slice-method"),
("bpy.types.fluiddomainsettings.cache_data_format*", "physics/fluid/type/domain/cache.html#bpy-types-fluiddomainsettings-cache-data-format"),
("bpy.types.fluiddomainsettings.cache_frame_start*", "physics/fluid/type/domain/cache.html#bpy-types-fluiddomainsettings-cache-frame-start"),
("bpy.types.fluiddomainsettings.cache_mesh_format*", "physics/fluid/type/domain/cache.html#bpy-types-fluiddomainsettings-cache-mesh-format"),
@@ -278,7 +277,6 @@ url_manual_mapping = (
("bpy.types.sequenceeditor.use_overlay_lock*", "video_editing/preview/properties.html#bpy-types-sequenceeditor-use-overlay-lock"),
("bpy.types.spaceuveditor.show_pixel_coords*", "editors/uv/display_panel.html#bpy-types-spaceuveditor-show-pixel-coords"),
("bpy.types.toolsettings.gpencil_selectmode*", "grease_pencil/selecting.html#bpy-types-toolsettings-gpencil-selectmode"),
- ("bpy.types.volumedisplay.axis_slice_method*", "modeling/volumes/properties.html#bpy-types-volumedisplay-axis-slice-method"),
("bpy.ops.gpencil.active_frames_delete_all*", "grease_pencil/animation/tools.html#bpy-ops-gpencil-active-frames-delete-all"),
("bpy.ops.gpencil.stroke_merge_by_distance*", "grease_pencil/modes/edit/grease_pencil_menu.html#bpy-ops-gpencil-stroke-merge-by-distance"),
("bpy.ops.object.anim_transforms_to_deltas*", "scene_layout/object/editing/apply.html#bpy-ops-object-anim-transforms-to-deltas"),
@@ -323,6 +321,7 @@ url_manual_mapping = (
("bpy.types.compositornodemoviedistortion*", "compositing/types/distort/movie_distortion.html#bpy-types-compositornodemoviedistortion"),
("bpy.types.fluiddomainsettings.use_guide*", "physics/fluid/type/domain/guides.html#bpy-types-fluiddomainsettings-use-guide"),
("bpy.types.fluiddomainsettings.use_noise*", "physics/fluid/type/domain/gas/noise.html#bpy-types-fluiddomainsettings-use-noise"),
+ ("bpy.types.fluiddomainsettings.use_slice*", "physics/fluid/type/domain/gas/viewport_display.html#bpy-types-fluiddomainsettings-use-slice"),
("bpy.types.fluiddomainsettings.vorticity*", "physics/fluid/type/domain/settings.html#bpy-types-fluiddomainsettings-vorticity"),
("bpy.types.fluidflowsettings.flow_source*", "physics/fluid/type/flow.html#bpy-types-fluidflowsettings-flow-source"),
("bpy.types.fluidflowsettings.fuel_amount*", "physics/fluid/type/flow.html#bpy-types-fluidflowsettings-fuel-amount"),
@@ -575,6 +574,7 @@ url_manual_mapping = (
("bpy.types.toolsettings.annotation*", "interface/annotate_tool.html#bpy-types-toolsettings-annotation"),
("bpy.types.vertexweightmixmodifier*", "modeling/modifiers/modify/weight_mix.html#bpy-types-vertexweightmixmodifier"),
("bpy.types.viewlayer.use_freestyle*", "render/freestyle/view_layer.html#bpy-types-viewlayer-use-freestyle"),
+ ("bpy.types.volumedisplay.use_slice*", "modeling/volumes/properties.html#bpy-types-volumedisplay-use-slice"),
("bpy.ops.armature.armature_layers*", "animation/armatures/bones/editing/change_layers.html#bpy-ops-armature-armature-layers"),
("bpy.ops.gpencil.frame_clean_fill*", "grease_pencil/modes/edit/grease_pencil_menu.html#bpy-ops-gpencil-frame-clean-fill"),
("bpy.ops.gpencil.stroke_subdivide*", "grease_pencil/modes/edit/stroke_menu.html#bpy-ops-gpencil-stroke-subdivide"),
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 62d522fabd7..8ac1262645b 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -528,8 +528,8 @@ class QuickLiquid(Operator):
# set color mapping field to show phi grid for liquid
liquid_domain.domain_settings.color_ramp_field = 'PHI'
- # set slicing method to single
- liquid_domain.domain_settings.axis_slice_method = 'SINGLE'
+ # perform a single slice of the domain
+ liquid_domain.domain_settings.use_slice = True
# set display thickness to a lower value for more detailed display of phi grids
liquid_domain.domain_settings.display_thickness = 0.02
diff --git a/release/scripts/startup/bl_ui/properties_data_volume.py b/release/scripts/startup/bl_ui/properties_data_volume.py
index af2c94ad423..0a8bbd19b63 100644
--- a/release/scripts/startup/bl_ui/properties_data_volume.py
+++ b/release/scripts/startup/bl_ui/properties_data_volume.py
@@ -142,9 +142,6 @@ class DATA_PT_volume_viewport_display(DataButtonsPanel, Panel):
volume = context.volume
display = volume.display
- axis_slice_method = display.axis_slice_method
-
- do_full_slicing = (axis_slice_method == 'FULL')
col = layout.column(align=True)
col.prop(display, "wireframe_type")
@@ -152,14 +149,37 @@ class DATA_PT_volume_viewport_display(DataButtonsPanel, Panel):
sub.active = display.wireframe_type in {'BOXES', 'POINTS'}
sub.prop(display, "wireframe_detail", text="Detail")
- col = layout.column(align=True)
+ col = layout.column()
col.prop(display, "density")
col.prop(display, "interpolation_method")
- col.prop(display, "axis_slice_method")
- if not do_full_slicing:
- col.prop(display, "slice_axis")
- col.prop(display, "slice_depth")
+
+class DATA_PT_volume_viewport_display_slicing(DataButtonsPanel, Panel):
+ bl_label = ""
+ bl_parent_id = 'DATA_PT_volume_viewport_display'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+
+ def draw_header(self, context):
+ layout = self.layout
+
+ volume = context.volume
+ display = volume.display
+
+ layout.prop(display, "use_slice")
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ volume = context.volume
+ display = volume.display
+
+ layout.active = display.use_slice
+
+ col = layout.column()
+ col.prop(display, "slice_axis")
+ col.prop(display, "slice_depth")
class DATA_PT_custom_props_volume(DataButtonsPanel, PropertyPanel, Panel):
@@ -173,6 +193,7 @@ classes = (
DATA_PT_volume_grids,
DATA_PT_volume_file,
DATA_PT_volume_viewport_display,
+ DATA_PT_volume_viewport_display_slicing,
DATA_PT_volume_render,
DATA_PT_custom_props_volume,
VOLUME_UL_grids,
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index cdbd7f75193..1f5a96f2705 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -1301,9 +1301,6 @@ class PHYSICS_PT_viewport_display(PhysicButtonsPanel, Panel):
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
domain = context.fluid.domain_settings
- axis_slice_method = domain.axis_slice_method
-
- do_full_slicing = (axis_slice_method == 'FULL')
col = flow.column(align=False)
col.prop(domain, "display_thickness")
@@ -1314,19 +1311,43 @@ class PHYSICS_PT_viewport_display(PhysicButtonsPanel, Panel):
if domain.use_color_ramp and domain.color_ramp_field == 'FLAGS':
sub.enabled = False
- col.prop(domain, "axis_slice_method")
-
- if not do_full_slicing:
- col.prop(domain, "slice_axis")
- col.prop(domain, "slice_depth")
- if domain.display_interpolation == 'CLOSEST' or domain.color_ramp_field == 'FLAGS':
- col.prop(domain, "show_gridlines")
-
col = col.column()
- col.active = do_full_slicing
+ col.active = not domain.use_slice
col.prop(domain, "slice_per_voxel")
+class PHYSICS_PT_viewport_display_slicing(PhysicButtonsPanel, Panel):
+ bl_label = "Slice"
+ bl_parent_id = 'PHYSICS_PT_viewport_display'
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ return (PhysicButtonsPanel.poll_fluid_domain(context))
+
+ def draw_header(self, context):
+ md = context.fluid.domain_settings
+
+ self.layout.prop(md, "use_slice", text="")
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+
+ domain = context.fluid.domain_settings
+
+ layout.active = domain.use_slice
+
+ col = layout.column()
+ col.prop(domain, "slice_axis")
+ col.prop(domain, "slice_depth")
+
+ sub = col.column()
+ sub.prop(domain, "show_gridlines")
+
+ sub.active = domain.display_interpolation == 'CLOSEST' or domain.color_ramp_field == 'FLAGS'
+
+
class PHYSICS_PT_viewport_display_color(PhysicButtonsPanel, Panel):
bl_label = "Grid Display"
bl_parent_id = 'PHYSICS_PT_viewport_display'
@@ -1408,7 +1429,8 @@ class PHYSICS_PT_viewport_display_advanced(PhysicButtonsPanel, Panel):
@classmethod
def poll(cls, context):
- return PhysicButtonsPanel.poll_fluid_domain(context) and context.fluid.domain_settings.show_gridlines
+ domain = context.fluid.domain_settings
+ return PhysicButtonsPanel.poll_fluid_domain(context) and domain.use_slice and domain.show_gridlines
def draw(self, context):
layout = self.layout
@@ -1416,6 +1438,8 @@ class PHYSICS_PT_viewport_display_advanced(PhysicButtonsPanel, Panel):
domain = context.fluid.domain_settings
+ layout.active = domain.display_interpolation == 'CLOSEST' or domain.color_ramp_field == 'FLAGS'
+
col = layout.column()
col.prop(domain, "gridlines_color_field", text="Color Gridlines")
@@ -1456,6 +1480,7 @@ classes = (
PHYSICS_PT_flow_initial_velocity,
PHYSICS_PT_flow_texture,
PHYSICS_PT_viewport_display,
+ PHYSICS_PT_viewport_display_slicing,
PHYSICS_PT_viewport_display_color,
PHYSICS_PT_viewport_display_debug,
PHYSICS_PT_viewport_display_advanced,
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);