[Bf-blender-cvs] [475132e0cea] temp-fracture-modifier-2.8: added separate activation shard size for dynamic fracture

Martin Felke noreply at git.blender.org
Wed Nov 21 23:37:50 CET 2018


Commit: 475132e0cea33a108217fdff0331564fe4bd7a25
Author: Martin Felke
Date:   Wed Nov 21 23:37:35 2018 +0100
Branches: temp-fracture-modifier-2.8
https://developer.blender.org/rB475132e0cea33a108217fdff0331564fe4bd7a25

added separate activation shard size for dynamic fracture

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

M	release/scripts/startup/bl_ui/properties_physics_fracture.py
M	source/blender/blenkernel/intern/fracture_prefractured.c
M	source/blender/blenkernel/intern/fracture_rigidbody.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/makesdna/DNA_fracture_types.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_fracture.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 ce5e33928f0..64fb42321ef 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fracture.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fracture.py
@@ -128,8 +128,10 @@ class PHYSICS_PT_fracture_dynamic(PhysicButtonsPanel, Panel):
           col = layout.column(align=True)
           col.prop(md, "dynamic_new_constraints")
           row = col.row(align=True)
-          row.prop(md, "limit_impact")
+          row.prop(md, "dynamic_activation_size")
           row.prop(md, "dynamic_min_size")
+          row = col.row()
+          row.prop(md, "limit_impact")
 
 class PHYSICS_PT_fracture(PhysicButtonsPanel, Panel):
     bl_label = "Fracture"
diff --git a/source/blender/blenkernel/intern/fracture_prefractured.c b/source/blender/blenkernel/intern/fracture_prefractured.c
index 174968c1e0e..eabee0bf840 100644
--- a/source/blender/blenkernel/intern/fracture_prefractured.c
+++ b/source/blender/blenkernel/intern/fracture_prefractured.c
@@ -139,7 +139,7 @@ Mesh* BKE_fracture_apply(FractureModifierData *fmd, Object *ob, Mesh *me_orig, D
 		/*free old stuff here */
 		BKE_fracture_constraints_free(fmd, scene);
 
-		if (/*!fmd->use_dynamic && */fmd->dm_group && !BLI_listbase_is_empty(&fmd->shared->mesh_islands))
+		if ((fmd->dm_group || fmd->use_dynamic) && !BLI_listbase_is_empty(&fmd->shared->mesh_islands))
 		{
 			int i = 0;
 			int count = BLI_listbase_count(&fmd->shared->mesh_islands);
@@ -161,7 +161,7 @@ Mesh* BKE_fracture_apply(FractureModifierData *fmd, Object *ob, Mesh *me_orig, D
 		}
 		else
 		{
-			BKE_fracture_meshislands_free(fmd, /*fmd->use_dynamic ? NULL :*/ scene);
+			BKE_fracture_meshislands_free(fmd, scene);
 			me_tmp = BKE_fracture_mesh_copy(me, ob);
 
 			mi = BKE_fracture_mesh_island_create(me_tmp, bmain, scene, ob, frame);
diff --git a/source/blender/blenkernel/intern/fracture_rigidbody.c b/source/blender/blenkernel/intern/fracture_rigidbody.c
index 80024c8b614..c897f0a6201 100644
--- a/source/blender/blenkernel/intern/fracture_rigidbody.c
+++ b/source/blender/blenkernel/intern/fracture_rigidbody.c
@@ -1356,7 +1356,8 @@ bool BKE_check_island_size(FractureModifierData *fmd, MeshIsland *mi, bool check
 	sub_v3_v3v3(diff, max, min);
 
 	if (check_min) {
-		size = 4.0f * size;
+		//size = 4.0f * size;
+		size = fmd->dynamic_activation_size;
 
 		if ((diff[max_axis_v3(diff)] < size))// && (diff[1] < size) && (diff[2] < size))
 		{
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ec4ea0c7a73..39fa95b0e2c 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5445,7 +5445,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
 				fmd->shared->last_cache_start = 0;
 				fmd->shared->last_cache_end = 250;
 				fmd->shared->refresh = true;
-				fmd->shared->reset_shards = true;
+				fmd->shared->reset_shards = false;
 			}
 		}
 	}
diff --git a/source/blender/makesdna/DNA_fracture_types.h b/source/blender/makesdna/DNA_fracture_types.h
index 00144733036..5bef098a944 100644
--- a/source/blender/makesdna/DNA_fracture_types.h
+++ b/source/blender/makesdna/DNA_fracture_types.h
@@ -72,10 +72,10 @@ enum {
 	MOD_FRACTURE_OWN_PARTICLES   = (1 << 1),
 	MOD_FRACTURE_EXTRA_VERTS     = (1 << 2),
 	MOD_FRACTURE_EXTRA_PARTICLES = (1 << 3),
-	MOD_FRACTURE_CUSTOM          = (1 << 4),
 	//MOD_FRACTURE_GREASEPENCIL    = (1 << 4),
 	MOD_FRACTURE_UNIFORM         = (1 << 5),
 	MOD_FRACTURE_GRID            = (1 << 6),
+	MOD_FRACTURE_CUSTOM          = (1 << 7),
 };
 
 enum {
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 6976c517713..f57b62015bc 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1637,6 +1637,7 @@ typedef struct FractureModifierData {
 	float mass_threshold_factor;
 	float boolean_double_threshold;
 	float dynamic_min_size;
+	float dynamic_activation_size;
 	float inner_crease;
 	float orthogonality_factor;
 	float anim_bind_limit;
@@ -1692,7 +1693,7 @@ typedef struct FractureModifierData {
 	short mat_ofs_intersect;
 	short mat_ofs_difference;
 
-	//char pad[4];
+	char pad[4];
 } FractureModifierData;
 
 typedef struct DataTransferModifierData {
diff --git a/source/blender/makesrna/intern/rna_fracture.c b/source/blender/makesrna/intern/rna_fracture.c
index dbaf7964b15..7b5c76e16e4 100644
--- a/source/blender/makesrna/intern/rna_fracture.c
+++ b/source/blender/makesrna/intern/rna_fracture.c
@@ -428,29 +428,29 @@ static void rna_FractureModifier_frac_algorithm_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->frac_algorithm = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_point_source_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->point_source = value;
-	printf("PointSource\n");
-	rmd->shared->reset_shards = true;
+	//printf("PointSource\n");
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_point_seed_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->point_seed = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_percentage_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->percentage = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 
@@ -458,70 +458,70 @@ static void rna_FractureModifier_extra_group_set(PointerRNA* ptr, PointerRNA val
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->extra_group = value.data;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_split_islands_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->split_islands = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_fix_normals_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->fix_normals = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_inner_material_set(PointerRNA* ptr, PointerRNA value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->inner_material = value.data;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_use_particle_birth_coordinates_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->use_particle_birth_coordinates = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_splinter_length_set(PointerRNA* ptr, float value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->splinter_length = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_splinter_axis_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->splinter_axis = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_cutter_axis_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->cutter_axis = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_nor_range_set(PointerRNA* ptr, float value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->nor_range = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_use_smooth_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->use_smooth = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 
@@ -529,14 +529,14 @@ static void rna_FractureModifier_fractal_cuts_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->fractal_cuts = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_fractal_amount_set(PointerRNA* ptr, float value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->fractal_amount = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 
@@ -544,49 +544,49 @@ static void rna_FractureModifier_physics_mesh_scale_set(PointerRNA* ptr, float v
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->physics_mesh_scale = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_fractal_iterations_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->fractal_iterations = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_cutter_group_set(PointerRNA* ptr, PointerRNA value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->cutter_group = value.data;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_use_greasepencil_edges_set(PointerRNA* ptr, int value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->use_greasepencil_edges = value;
-	rmd->shared->reset_shards = true;
+	//rmd->shared->reset_shards = true;
 }
 
 static void rna_FractureModifier_grease_offset_set(PointerRNA* ptr, float value)
 {
 	FractureModifierData *rmd = (FractureModifierData*)ptr->data;
 	rmd->grease_offset = value;
-	rmd->shared->reset_shards = true;
+	//

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list