Page MenuHome

UI: Changes to Viewport Display UI of Volume Object and Fluid
ClosedPublic

Authored by Sriharsha Kotcharlakot (Sriharsha) on Oct 2 2020, 7:14 PM.

Details

Summary
  • 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' in the 'Viewport Display' options of Volume Object and Fluid for better clarity.
  • Renamed axis_slice_method to use_slice in the python API for Volume Object and Fluid.
  • Added a sub-panel for slicing options under 'Viewport Display' panel in Volume Object and Fluid.

Volume Object's 'Viewport Display' panel (before | after)

Fluid 'Viewport Display' panel (before | after)

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 10547
Build 10547: arc lint + arc unit

Event Timeline

Sriharsha Kotcharlakot (Sriharsha) created this revision.
Sriharsha Kotcharlakot (Sriharsha) retitled this revision from 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... to UI: Changes to Viewport Display UI of Volume Object and Fluid.Oct 2 2020, 7:27 PM
Sriharsha Kotcharlakot (Sriharsha) edited the summary of this revision. (Show Details)
Sriharsha Kotcharlakot (Sriharsha) edited the summary of this revision. (Show Details)

What about this? It takes basically the same amount of space because the "Slice" property already had its own line, and it's much more explicit about the hierarchy of options.

Code:

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, "axis_slice_method")

    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.axis_slice_method
        
        col = layout.column()
        col.prop(display, "slice_axis")
        col.prop(display, "slice_depth")
source/blender/makesrna/intern/rna_volume.c
437

This property should probably be renamed to "use_slice" since it's now a boolean. Unless @Brecht Van Lommel (brecht) prefers maintaining API compatibility here.

Aaron Carlisle (Blendify) added inline comments.
source/blender/makesrna/intern/rna_volume.c
437

API compatibility is already broken if you have to change

liquid_domain.domain_settings.axis_slice_method = 'SINGLE'

to

liquid_domain.domain_settings.axis_slice_method = True

What about this? It takes basically the same amount of space because the "Slice" property already had its own line, and it's much more explicit about the hierarchy of options.

I agree that is much better.

source/blender/makesrna/intern/rna_volume.c
437

Ah right, of course

@Hans Goudey (HooglyBoogly) Yes, a sub-panel for slicing options brings so much more clarity. Will incorporate that for Volume Object.
For the same in fluid, placing the 'Slice Per Voxel' slider would be tricky as it should be usable only when single-slicing is disabled.

source/blender/makesrna/intern/rna_volume.c
437

Well, then I think it is better to rename it to use_slice

@Hans Goudey (HooglyBoogly) Yes, a sub-panel for slicing options brings so much more clarity. Will incorporate that for Volume Object.
For the same in fluid, placing the 'Slice Per Voxel' slider would be tricky as it should be usable only when single-slicing is disabled.

That's fine, just put "Slice Per Voxel" above the subpanel and gray it out when "use_slice" is on with col.active.

source/blender/makesrna/intern/rna_volume.c
437

Yes, you could include that in this patch.

@Hans Goudey (HooglyBoogly) Yes, a sub-panel for slicing options brings so much more clarity. Will incorporate that for Volume Object.
For the same in fluid, placing the 'Slice Per Voxel' slider would be tricky as it should be usable only when single-slicing is disabled.

That's fine, just put "Slice Per Voxel" above the subpanel and gray it out when "use_slice" is on with col.active.

Ah right, will do that, thanks

source/blender/makesrna/intern/rna_volume.c
437

Yes, will include that

  • Renamed axis_slice_method to use_slice in the python API for Volume Object and Fluid.
  • Updated RNA references.
  • Added a sub-panel for slicing options under 'Viewport Display' panel in Volume Object and Fluid.
Sriharsha Kotcharlakot (Sriharsha) marked 4 inline comments as done.

Looks great, thanks!

This revision is now accepted and ready to land.Oct 5 2020, 2:21 PM