From 26251282e093d4c0d04c4c667b0b32ad66d329b2 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Mon, 25 Jun 2018 17:04:34 +0200 Subject: UI: Single-column layout for Force Fields and Particles Force Fields and Falloff are now simpler and more compact by removing unnecesary labels (there was a text label just for one option) Particle Force Fields Falloff is now a sub-panel of each effector type, rather than just as a section with label. --- .../scripts/startup/bl_ui/properties_particle.py | 86 ++++++++++++++++++---- .../startup/bl_ui/properties_physics_common.py | 21 +++--- 2 files changed, 81 insertions(+), 26 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 8b4104a6c04..c521c59a79d 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -500,6 +500,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel): bl_label = "Velocity" + bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod @@ -626,6 +627,7 @@ class PARTICLE_PT_rotation_angular_velocity(ParticleButtonsPanel, Panel): class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): bl_label = "Physics" + bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod @@ -1012,6 +1014,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): class PARTICLE_PT_render(ParticleButtonsPanel, Panel): bl_label = "Render" + bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod @@ -1710,30 +1713,77 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True part = particle_get_settings(context) - row = layout.row() - row.prop(part, "use_self_effect") - row.prop(part, "effector_amount", text="Amount") + col = layout.column() + col.prop(part, "use_self_effect") + col.prop(part, "effector_amount", text="Effector Amount") + + +class PARTICLE_PT_force_fields_type1(ParticleButtonsPanel, Panel): + bl_label = "Type 1" + bl_parent_id = "PARTICLE_PT_force_fields" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + layout.use_property_split = True - split = layout.split(percentage=0.2) - split.label(text="Type 1:") - split.prop(part.force_field_1, "type", text="") + part = particle_get_settings(context) + + col = layout.column() + col.prop(part.force_field_1, "type", text="Type 1") basic_force_field_settings_ui(self, context, part.force_field_1) - if part.force_field_1.type != 'NONE': - layout.label(text="Falloff:") - basic_force_field_falloff_ui(self, context, part.force_field_1) - if part.force_field_1.type != 'NONE': - layout.label(text="") - split = layout.split(percentage=0.2) - split.label(text="Type 2:") - split.prop(part.force_field_2, "type", text="") + +class PARTICLE_PT_force_fields_type2(ParticleButtonsPanel, Panel): + bl_label = "Type 2" + bl_parent_id = "PARTICLE_PT_force_fields" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + part = particle_get_settings(context) + + col = layout.column() + col.prop(part.force_field_2, "type", text="Type 2") basic_force_field_settings_ui(self, context, part.force_field_2) - if part.force_field_2.type != 'NONE': - layout.label(text="Falloff:") + + +class PARTICLE_PT_force_fields_type1_falloff(ParticleButtonsPanel, Panel): + bl_label = "Falloff" + bl_options = {'DEFAULT_CLOSED'} + bl_parent_id = "PARTICLE_PT_force_fields_type1" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + part = particle_get_settings(context) + + basic_force_field_falloff_ui(self, context, part.force_field_1) + + + +class PARTICLE_PT_force_fields_type2_falloff(ParticleButtonsPanel, Panel): + bl_label = "Falloff" + bl_options = {'DEFAULT_CLOSED'} + bl_parent_id = "PARTICLE_PT_force_fields_type2" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + part = particle_get_settings(context) + basic_force_field_falloff_ui(self, context, part.force_field_2) @@ -1916,6 +1966,10 @@ classes = ( PARTICLE_PT_hair_shape, PARTICLE_PT_field_weights, PARTICLE_PT_force_fields, + PARTICLE_PT_force_fields_type1, + PARTICLE_PT_force_fields_type1_falloff, + PARTICLE_PT_force_fields_type2, + PARTICLE_PT_force_fields_type2_falloff, PARTICLE_PT_vertexgroups, PARTICLE_PT_textures, PARTICLE_PT_custom_props, diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 46cb7d0761f..08197293700 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -244,6 +244,7 @@ def effector_weights_ui(self, context, weights, weight_type): def basic_force_field_settings_ui(self, context, field): layout = self.layout + layout.use_property_split = True if not field or field.type == 'NONE': return @@ -279,11 +280,9 @@ def basic_force_field_settings_ui(self, context, field): if field.type == 'FORCE': col.prop(field, "use_gravity_falloff", text="Gravitation") - col.label(text="Effect point") - col.prop(field, "apply_to_location") - col.prop(field, "apply_to_rotation") - col.label(text="Collision") + col.prop(field, "apply_to_location", text="Affect Location") + col.prop(field, "apply_to_rotation", text="Affect Rotation") col.prop(field, "use_absorption") @@ -298,15 +297,17 @@ def basic_force_field_falloff_ui(self, context, field): col.prop(field, "falloff_power", text="Power") - col.prop(field, "use_min_distance", text="Min Min Distance") - sub = col.column(align=True) + split = layout.split() + split.prop(field, "use_min_distance", text="Min Distance") + sub = split.column(align=True) sub.active = field.use_min_distance - sub.prop(field, "distance_min", text="Min Distance") + sub.prop(field, "distance_min", text="") - col.prop(field, "use_max_distance", text="Use Max Distance") - sub = col.column(align=True) + split = layout.split() + split.prop(field, "use_max_distance", text="Max Distance") + sub = split.column(align=True) sub.active = field.use_max_distance - sub.prop(field, "distance_max", text="Max Distance") + sub.prop(field, "distance_max", text="") classes = ( -- cgit v1.2.3