[Bf-blender-cvs] [8c54c02564c] temp-fracture-modifier-2.8: yay, blender starts again :)

Martin Felke noreply at git.blender.org
Fri Aug 10 14:00:28 CEST 2018


Commit: 8c54c02564c781d60d6597b3d41f79a1a95060fe
Author: Martin Felke
Date:   Tue Aug 7 23:00:32 2018 +0200
Branches: temp-fracture-modifier-2.8
https://developer.blender.org/rB8c54c02564c781d60d6597b3d41f79a1a95060fe

yay, blender starts again :)

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

M	release/scripts/startup/bl_ui/properties_physics_fracture.py
M	release/scripts/startup/bl_ui/properties_physics_rigidbody.py
M	source/blender/blenkernel/BKE_fracture.h
M	source/blender/blenkernel/intern/fracture.c
M	source/blender/blenkernel/intern/fracture_prefractured.c
M	source/blender/blenkernel/intern/rigidbody.c
M	source/blender/editors/object/object_ops.c

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_fracture.py b/release/scripts/startup/bl_ui/properties_physics_fracture.py
index 20efd1f0557..cb180232705 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fracture.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fracture.py
@@ -37,17 +37,7 @@ class PhysicButtonsPanel():
     @classmethod
     def poll(cls, context):
         ob = context.object
-        rd = context.scene.render
-        return (ob and (ob.type == 'MESH' or ob.type == 'CURVE' or ob.type == 'SURFACE' or ob.type == 'FONT')) and (not rd.use_game_engine) and (context.fracture)
-
-#class FRACTURE_UL_fracture_settings(UIList):
-#    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
-#        fl = item
-#        if self.layout_type in {'DEFAULT', 'COMPACT'}:
-#            layout.prop(fl, "name", text="", emboss=False, icon_value=icon)
-#        elif self.layout_type in {'GRID'}:
-#            layout.alignment = 'CENTER'
-#            layout.label(text="", icon_value=icon)
+        return ob and (ob.type == 'MESH') and context.fracture
 
 class PHYSICS_PT_fracture_anim_mesh(PhysicButtonsPanel, Panel):
     bl_label = "Fracture Animated Mesh Settings"
@@ -66,8 +56,6 @@ class PHYSICS_PT_fracture_anim_mesh(PhysicButtonsPanel, Panel):
         row = layout.row()
         row.operator("object.fracture_anim_bind", text="Bind", icon="UV_VERTEXSEL")
 
-#       layout.template_list("FRACTURE_UL_fracture_settings", "", md, "fracture_settings", md, "active_setting", rows=3)
-
 class PHYSICS_PT_fracture(PhysicButtonsPanel, Panel):
     bl_label = "Fracture Settings"
 
@@ -116,10 +104,7 @@ class PHYSICS_PT_fracture(PhysicButtonsPanel, Panel):
         layout.prop(md, "frac_algorithm")
         if md.frac_algorithm in {'BOOLEAN', 'BOOLEAN_FRACTAL'}:
             col = layout.column(align=True)
-            col.label(text="Boolean Solver:")
-            col.prop(md, "boolean_solver", text="")
-            if md.boolean_solver == 'BMESH':
-                col.prop(md, "boolean_double_threshold")
+            col.prop(md, "boolean_double_threshold")
         col = layout.column(align=True)
         col.prop(md, "shard_count")
         col.prop(md, "point_seed")
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
index 7e4982c0b0e..9e3e1759653 100644
--- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
@@ -46,6 +46,14 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
 
         if rbo is not None:
             layout.prop(rbo, "type", text="Type")
+            row = layout.row()
+            if rbo.type == 'ACTIVE':
+                row.prop(rbo, "enabled", text="Dynamic")
+            row.prop(rbo, "kinematic", text="Animated")
+            if rbo.type == 'ACTIVE':
+                row = layout.row()
+                row.prop(rbo, "use_kinematic_deactivation", text="Triggered")
+                row.prop(rbo, "is_trigger")
 
             if rbo.type == 'ACTIVE':
                 layout.prop(rbo, "mass")
@@ -56,6 +64,35 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
             col.prop(rbo, "kinematic", text="Animated")
 
 
+class PHYSICS_PT_rigid_body_trigger_advanced(PHYSICS_PT_rigidbody_panel, Panel):
+    bl_label = "Rigid Body Trigger Advanced"
+    bl_parent_id = 'PHYSICS_PT_rigid_body'
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    @classmethod
+    def poll(cls, context):
+        obj = context.object
+        return (obj and obj.rigid_body and
+        (context.scene.render.engine in cls.COMPAT_ENGINES))
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        ob = context.object
+        rbo = ob.rigid_body
+
+        row = layout.row()
+        row.prop(rbo, "is_ghost")
+        row.prop(rbo, "propagate_trigger")
+        row = layout.row()
+        row.prop(rbo, "constraint_dissolve")
+        row.prop(rbo, "dynamic_trigger")
+        row = layout.row()
+        row.prop(rbo, "plastic_dissolve")
+        row.prop(rbo, "stop_trigger")
+
+
 class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
     bl_label = "Collisions"
     bl_parent_id = 'PHYSICS_PT_rigid_body'
@@ -221,6 +258,8 @@ class PHYSICS_PT_rigid_body_dynamics_deactivation(PHYSICS_PT_rigidbody_panel, Pa
         col.prop(rbo, "deactivate_linear_velocity", text="Linear Velocity")
         col.prop(rbo, "deactivate_angular_velocity", text="Angular Velocity")
         # TODO: other params such as time?
+        col.label(text="Activation:")
+        col.prop(rbo, "force_threshold", text="Force Thresh")
 
 
 classes = (
diff --git a/source/blender/blenkernel/BKE_fracture.h b/source/blender/blenkernel/BKE_fracture.h
index d28ee6b95b0..4fd189af57f 100644
--- a/source/blender/blenkernel/BKE_fracture.h
+++ b/source/blender/blenkernel/BKE_fracture.h
@@ -185,4 +185,7 @@ void BKE_fracture_mesh_island_free(struct FractureModifierData *rmd, struct Mesh
 
 short BKE_fracture_collect_materials(struct Main* bmain, struct Object* o, struct Object* ob, int matstart, struct GHash** mat_index_map);
 
+struct Mesh *BKE_fracture_prefractured_do(struct FractureModifierData *fmd, struct Object *ob, struct Mesh *dm,
+                                          struct Mesh *orig_dm, char names [][66], int count, struct Scene* scene);
+
 #endif /* BKE_FRACTURE_H */
diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index 1d506557530..0be6aa9facd 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -96,7 +96,6 @@ static void parse_cell_neighbors(cell c, int *neighbors, int totpoly);
 static void arrange_shard(FractureModifierData *fmd, ShardID id, bool do_verts, float cent[3]);
 static void fracture_shard_add(FracMesh *fm, Shard *s, float mat[4][4]);
 static Shard* fracture_initial_shard_create(Mesh *dm);
-
 static void fracture_shard_add(FracMesh *fm, Shard *s, float mat[4][4])
 {
 	MVert *mv;
@@ -2925,9 +2924,6 @@ void BKE_fracture_animated_loc_rot(FractureModifierData *fmd, Object *ob, bool d
 
 static void cleanup_arrange_shard(FractureModifierData *fmd, Shard *s, float cent[]);
 static MeshIsland* find_meshisland(ListBase* meshIslands, int id);
-static void do_halving(FractureModifierData *fmd, Object* ob, Mesh *dm, Mesh *orig_dm,
-                       bool is_prehalving, ShardID id, Scene *scene);
-static void free_shards(FractureModifierData *fmd);
 static void do_island_index_map(FractureModifierData *fmd, Object *ob);
 
 FracMesh* BKE_fracture_fracmesh_copy(FracMesh* fm)
@@ -5656,7 +5652,7 @@ static void do_refresh(FractureModifierData *fmd, Object *ob, Mesh* dm, Mesh *or
                 BM_mesh_free(fmd->visible_mesh);
                 fmd->visible_mesh = NULL;
             }
-            do_halving(fmd, ob, dm, orig_dm, false, -1, scene);
+            BKE_fracture_do_halving(fmd, ob, dm, orig_dm, false, -1, scene);
             fmd->explo_shared = false;
         }
     }
@@ -5734,7 +5730,7 @@ static void do_island_index_map(FractureModifierData *fmd, Object* ob)
     }
 }
 
-static Mesh *doSimulate(FractureModifierData *fmd, Object *ob, Mesh *dm, Mesh *orig_dm,
+Mesh *BKE_fracture_prefractured_do(FractureModifierData *fmd, Object *ob, Mesh *dm, Mesh *orig_dm,
                                char names [][66], int count, Scene* scene)
 {
     bool exploOK = false; /* doFracture */
diff --git a/source/blender/blenkernel/intern/fracture_prefractured.c b/source/blender/blenkernel/intern/fracture_prefractured.c
index 7308e6373bc..26d18708fd5 100644
--- a/source/blender/blenkernel/intern/fracture_prefractured.c
+++ b/source/blender/blenkernel/intern/fracture_prefractured.c
@@ -9,11 +9,13 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_fracture_types.h"
 #include "DNA_rigidbody_types.h"
+#include "DNA_scene_types.h"
 
 
 Mesh *BKE_fracture_prefractured_apply(FractureModifierData *fmd, Object *ob, Mesh *derivedData, Depsgraph* depsgraph)
 {
     bool do_refresh = (fmd->auto_execute) || (fmd->dm_group && fmd->use_constraint_group && fmd->refresh_constraints);
+    Scene *scene = DEG_get_evaluated_scene(depsgraph);
 
     Mesh *final_dm = derivedData;
   //  Mesh *group_dm = BKE_fracture_group_dm(fmd, derivedData, ob, do_refresh || fmd->refresh);
@@ -27,16 +29,14 @@ Mesh *BKE_fracture_prefractured_apply(FractureModifierData *fmd, Object *ob, Mes
         BKE_fracture_initialize(fmd, ob, derivedData, depsgraph);
     }
 
-#if 0
     /* TODO_5, get rid of fmd->dm and perhaps of fmd->visible_mesh (BMESH!) too, the latter should be runtime data for creating islands ONLY */
     /* we should ideally only have one cached derivedmesh */
     if (fmd->dm && fmd->frac_mesh && (fmd->dm->totpoly > 0)) {
-        final_dm = doSimulate(fmd, ob, fmd->dm, derivedData, NULL, 0);
+        final_dm = BKE_fracture_prefractured_do(fmd, ob, fmd->dm, derivedData, NULL, 0, scene);
     }
     else {
-        final_dm = doSimulate(fmd, ob, derivedData, derivedData, NULL, 0);
+        final_dm = BKE_fracture_prefractured_do(fmd, ob, derivedData, derivedData, NULL, 0, scene);
     }
-#endif
 
     return final_dm;
 }
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 503585b4cc7..6d66698c839 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -117,7 +117,7 @@ static float box_volume(float size[3]);
 /* Freeing Methods --------------------- */
 
 #ifdef WITH_BULLET
-static void rigidbody_update_ob_array(RigidBodyWorld *rbw);
+//static void rigidbody_update_ob_array(RigidBodyWorld *rbw);
 
 #else
 static void RB_dworld_remove_constraint(void *UNUSED(world), void *UNUSED(con)) {}
@@ -608,6 +608,7 @@ static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool
 	RigidBodyOb *rbo = (ob) ? ob->rigidbody_object : NULL;
 	float loc[3];
 	float rot[4];
+    float size[3] = {1.0f, 1.0f, 1.0f};
 
 	/* san

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list