[Bf-blender-cvs] [7da0f0671a8] fracture_modifier: crash fix for compound collision + expose constraint rules ui for compound mode

Martin Felke noreply at git.blender.org
Thu Nov 8 15:09:32 CET 2018


Commit: 7da0f0671a838560748739381ea1ad5ab339acf7
Author: Martin Felke
Date:   Thu Nov 8 15:08:59 2018 +0100
Branches: fracture_modifier
https://developer.blender.org/rB7da0f0671a838560748739381ea1ad5ab339acf7

crash fix for compound collision + expose constraint rules ui for compound mode

parts of the constraint rules can influence compound simulation behavior too, especially
clustering. You can either simulate compounds with our without triggers. First method might be slower than with constraints, but no bending. With triggers its faster, but objects always fall apart entirely (clusters can control this a bit)

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

M	intern/rigidbody/rb_bullet_api.cpp
M	release/scripts/startup/bl_ui/properties_physics_fracture.py

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

diff --git a/intern/rigidbody/rb_bullet_api.cpp b/intern/rigidbody/rb_bullet_api.cpp
index a0f22a23b01..ef8a75665d2 100644
--- a/intern/rigidbody/rb_bullet_api.cpp
+++ b/intern/rigidbody/rb_bullet_api.cpp
@@ -761,6 +761,10 @@ struct rbFilterCallback : public btOverlapFilterCallback
 		           (proxy0->m_collisionFilterMask | btBroadphaseProxy::StaticFilter |
 		            btBroadphaseProxy::KinematicFilter));
 
+		if (!rb0 || !rb1) {
+			return collides;
+		}
+
 		//no self collisions between kinematic shards in own object allowed
 		collides = collides && ((!rb0->body->isStaticOrKinematicObject() || !rb1->body->isStaticOrKinematicObject()) ||
 		           ((rb0->body->isStaticOrKinematicObject() && rb1->body->isStaticOrKinematicObject()) &&
diff --git a/release/scripts/startup/bl_ui/properties_physics_fracture.py b/release/scripts/startup/bl_ui/properties_physics_fracture.py
index ebae07bb0ad..cd6fd1acf7b 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fracture.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fracture.py
@@ -248,32 +248,32 @@ class PHYSICS_PT_fracture_simulation(PhysicButtonsPanel, Panel):
             #col.prop(md, "impulse_dampening")
             #col.prop(md, "directional_factor")
             col.prop(md, "mass_threshold_factor")
-        else:
-            layout.label("Constraint Special Breaking Settings")
-            col = layout.column(align=True)
-            row = col.row(align=True)
-            row.prop(md, "breaking_percentage", text="Percentage")
-            row.prop(md, "cluster_breaking_percentage", text="Cluster Percentage")
 
-            row = col.row(align=True)
-            row.prop(md, "breaking_angle", text="Angle")
-            row.prop(md, "cluster_breaking_angle", text="Cluster Angle")
+        layout.label("Constraint Special Breaking Settings")
+        col = layout.column(align=True)
+        row = col.row(align=True)
+        row.prop(md, "breaking_percentage", text="Percentage")
+        row.prop(md, "cluster_breaking_percentage", text="Cluster Percentage")
 
-            row = col.row(align=True)
-            row.prop(md, "breaking_distance", text="Distance")
-            row.prop(md, "cluster_breaking_distance", text="Cluster Distance")
+        row = col.row(align=True)
+        row.prop(md, "breaking_angle", text="Angle")
+        row.prop(md, "cluster_breaking_angle", text="Cluster Angle")
 
-            col = layout.column(align=True)
-            col.prop(md, "solver_iterations_override")
-            col.prop(md, "cluster_solver_iterations_override")
+        row = col.row(align=True)
+        row.prop(md, "breaking_distance", text="Distance")
+        row.prop(md, "cluster_breaking_distance", text="Cluster Distance")
 
-            row = layout.row(align=True)
-            row.prop(md, "breaking_angle_weighted")
-            row.prop(md, "breaking_distance_weighted")
+        col = layout.column(align=True)
+        col.prop(md, "solver_iterations_override")
+        col.prop(md, "cluster_solver_iterations_override")
 
-            row = layout.row(align=True)
-            row.prop(md, "breaking_percentage_weighted")
-            row.prop(md, "use_mass_dependent_thresholds", text="Mass Dependent Thresholds")
+        row = layout.row(align=True)
+        row.prop(md, "breaking_angle_weighted")
+        row.prop(md, "breaking_distance_weighted")
+
+        row = layout.row(align=True)
+        row.prop(md, "breaking_percentage_weighted")
+        row.prop(md, "use_mass_dependent_thresholds", text="Mass Dependent Thresholds")
 
         if not md.use_compounds:
             layout.label("Constraint Deform Settings")



More information about the Bf-blender-cvs mailing list