[Bf-blender-cvs] [a9ac87be369] master: Fix T73842: UI: add cloth collision settings to Hair Dynamics panel

Philipp Oeser noreply at git.blender.org
Fri Mar 6 15:01:25 CET 2020


Commit: a9ac87be36984b89d95bb6ba6ee095465429400e
Author: Philipp Oeser
Date:   Wed Mar 4 17:31:36 2020 +0100
Branches: master
https://developer.blender.org/rBa9ac87be36984b89d95bb6ba6ee095465429400e

Fix T73842: UI: add cloth collision settings to Hair Dynamics panel

Since hair collisions were integrated with the cloth solver
(rBd42a7bbd6ea5), there are a couple of relevant settings which were not
exposed to the User:
- Collision Quality
- Minimum Distance (this was reported in T73842, default of 0.015m was
still limiting in certain scenarios - this can now be made smaller)
- Impulse clamping
- Collision collection

This will add a 'Collisions' panel to Hair Dynamics with those settings

Note: in contrast to 'real' cloth, self-collisions are not supported for
hair

Maniphest Tasks: T73842

Differential Revision: https://developer.blender.org/D7032

===================================================================

M	release/scripts/startup/bl_ui/properties_particle.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 3384032e332..7eb173c88bb 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -413,6 +413,38 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
             box.label(text="Error: %.5f .. %.5f (avg. %.5f)" % (result.min_error, result.max_error, result.avg_error))
 
 
+class PARTICLE_PT_hair_dynamics_collision(ParticleButtonsPanel, Panel):
+    bl_label = "Collisions"
+    bl_parent_id = "PARTICLE_PT_hair_dynamics"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.particle_system.cloth is not None
+
+    def draw(self, context):
+        layout = self.layout
+
+        psys = context.particle_system
+        cloth_md = psys.cloth
+        cloth_collision = cloth_md.collision_settings
+
+        layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
+
+        layout.use_property_split = True
+
+        col = layout.column()
+        col.prop(cloth_collision, "collision_quality", text="Quality")
+
+        layout.separator()
+
+        col = layout.column()
+        col.prop(cloth_collision, "distance_min", slider=True, text="Distance")
+        col.prop(cloth_collision, "impulse_clamp")
+        col.prop(cloth_collision, "collection")
+
+
 class PARTICLE_PT_hair_dynamics_structure(ParticleButtonsPanel, Panel):
     bl_label = "Structure"
     bl_parent_id = "PARTICLE_PT_hair_dynamics"
@@ -1986,6 +2018,7 @@ classes = (
     PARTICLE_PT_emission,
     PARTICLE_PT_emission_source,
     PARTICLE_PT_hair_dynamics,
+    PARTICLE_PT_hair_dynamics_collision,
     PARTICLE_PT_hair_dynamics_structure,
     PARTICLE_PT_hair_dynamics_volume,
     PARTICLE_PT_cache,



More information about the Bf-blender-cvs mailing list