[Bf-blender-cvs] [5bac7e5ac7] fracture_modifier: fix for loading cutter group fractures and allow all algorithms now in combination with cuttergroup

Martin Felke noreply at git.blender.org
Wed Mar 15 17:36:45 CET 2017


Commit: 5bac7e5ac797b7c5d87b2d2827cdc5154fd788f7
Author: Martin Felke
Date:   Wed Mar 15 17:36:25 2017 +0100
Branches: fracture_modifier
https://developer.blender.org/rB5bac7e5ac797b7c5d87b2d2827cdc5154fd788f7

fix for loading cutter group fractures and allow all algorithms now in combination with cuttergroup

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

M	release/scripts/startup/bl_ui/properties_physics_fracture.py
M	source/blender/blenkernel/intern/fracture.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/modifiers/intern/MOD_fracture.c

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_fracture.py b/release/scripts/startup/bl_ui/properties_physics_fracture.py
index 20d5e96dbc..0efbac9c38 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fracture.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fracture.py
@@ -147,14 +147,13 @@ class PHYSICS_PT_fracture(PhysicButtonsPanel, Panel):
                 col.prop(md, "cutter_axis")
             col.prop(md, "extra_group")
             col.prop(md, "dm_group")
-            if md.frac_algorithm == 'BOOLEAN':
-                col.prop(md, "cutter_group")
-                if (md.cutter_group):
-                   col.prop(md, "keep_cutter_shards")
-                   col.label("Material Index Offset")
-                   row = col.row(align=True)
-                   row.prop(md, "material_offset_intersect", text="Intersect")
-                   row.prop(md, "material_offset_difference", text="Difference")
+            col.prop(md, "cutter_group")
+            if (md.cutter_group):
+                col.prop(md, "keep_cutter_shards")
+                col.label("Material Index Offset")
+                row = col.row(align=True)
+                row.prop(md, "material_offset_intersect", text="Intersect")
+                row.prop(md, "material_offset_difference", text="Difference")
             col.prop(md, "use_particle_birth_coordinates")
 
             box.prop(md, "percentage")
diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index 3d267e662f..5ac7530d96 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -1568,7 +1568,7 @@ void BKE_fracture_shard_by_greasepencil(FractureModifierData *fmd, Object *obj,
 
 void BKE_fracture_shard_by_planes(FractureModifierData *fmd, Object *obj, short inner_material_index, float mat[4][4])
 {
-	if (fmd->frac_algorithm == MOD_FRACTURE_BOOLEAN && fmd->cutter_group != NULL && obj->type == OB_MESH)
+	if (/*fmd->frac_algorithm == MOD_FRACTURE_BOOLEAN && */fmd->cutter_group != NULL && obj->type == OB_MESH)
 	{
 		GroupObject* go;
 		float imat[4][4];
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e5b0cc81a6..ab142ab42c 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5212,6 +5212,8 @@ static void load_fracture_modifier(FileData* fd, FractureModifierData *fmd)
 	bool autoexec = false;
 
 	fm = fmd->frac_mesh = newdataadr(fd, fmd->frac_mesh);
+	fm->last_expected_shards = 0;
+	fm->progress_counter = 0;
 
 	autoexec = fmd->auto_execute;
 	fmd->auto_execute = false;
@@ -5306,7 +5308,8 @@ static void load_fracture_modifier(FileData* fd, FractureModifierData *fmd)
 			link_list(fd, &fmd->frac_mesh->shard_map);
 			link_list(fd, &fmd->islandShards);
 			islandShardCount = BLI_listbase_count(&fmd->islandShards);
-			count = BLI_listbase_count(&fmd->frac_mesh->shard_map) + islandShardCount;
+			fm->shard_count = BLI_listbase_count(&fmd->frac_mesh->shard_map);
+			count = fm->shard_count + islandShardCount;
 
 			shards = MEM_callocN(sizeof(Shard*) * count, "readfile shard_lookup_array");
 			for (s = fmd->frac_mesh->shard_map.first; s; s = s->next) {
diff --git a/source/blender/modifiers/intern/MOD_fracture.c b/source/blender/modifiers/intern/MOD_fracture.c
index 7e258e3587..83442f0c89 100644
--- a/source/blender/modifiers/intern/MOD_fracture.c
+++ b/source/blender/modifiers/intern/MOD_fracture.c
@@ -1656,7 +1656,7 @@ static void do_fracture(FractureModifierData *fmd, ShardID id, Object *obj, Deri
 	short mat_index = 0;
 	ShardID* ids = NULL;
 
-	if (fmd->frac_algorithm == MOD_FRACTURE_BOOLEAN && fmd->cutter_group != NULL) {
+	if (/*fmd->frac_algorithm == MOD_FRACTURE_BOOLEAN && */fmd->cutter_group != NULL) {
 		//attempt to combine fracture by cutter group with regular fracture
 		float mat[4][4];
 		Shard* s = NULL;




More information about the Bf-blender-cvs mailing list