diff options
author | William Reynish <billreynish> | 2018-06-25 18:04:34 +0300 |
---|---|---|
committer | Pablo Vazquez <venomgfx@gmail.com> | 2018-06-25 18:04:40 +0300 |
commit | 26251282e093d4c0d04c4c667b0b32ad66d329b2 (patch) | |
tree | b8f2e6f84a1745d1499fe7ba17c1fd1d3276618c /release/scripts/startup/bl_ui/properties_particle.py | |
parent | 51e077c5c0cd1f6d9b7e4dd02e2cd738abc7e9bd (diff) |
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.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_particle.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_particle.py | 86 |
1 files changed, 70 insertions, 16 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, |