[Bf-blender-cvs] [340798f] fracture_modifier: reduced a performance bottleneck when adding many constraints in a loop, do not trigger modifier updates or set validate flags or even call bullet functions... but todo is to keep a useful update mechanism

Martin Felke noreply at git.blender.org
Wed Jan 20 18:43:23 CET 2016


Commit: 340798fe56b38a09daff294f585247282594d7c3
Author: Martin Felke
Date:   Wed Jan 20 18:42:49 2016 +0100
Branches: fracture_modifier
https://developer.blender.org/rB340798fe56b38a09daff294f585247282594d7c3

reduced a performance bottleneck when adding many constraints in a loop, do not trigger modifier updates or set validate flags or even call bullet functions... but todo is to keep a useful update mechanism

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

M	source/blender/makesrna/intern/rna_modifier.c

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

diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 2435302..00f4cd0 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -5291,328 +5291,328 @@ static void rna_def_mesh_constraint(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
 	RNA_def_property_float_sdna(prop, NULL, "pos");
 	RNA_def_property_array(prop, 3);
-	RNA_def_property_float_funcs(prop, NULL, "rna_MeshCon_position_set", NULL);
+	//RNA_def_property_float_funcs(prop, NULL, "rna_MeshCon_position_set", NULL);
 	RNA_def_property_ui_text(prop, "Location", "Position of the mesh constraint");
 
 	prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
 	RNA_def_property_float_sdna(prop, NULL, "orn");
 	RNA_def_property_array(prop, 4);
-	RNA_def_property_float_funcs(prop, NULL, "rna_MeshCon_orientation_set", NULL);
+	//RNA_def_property_float_funcs(prop, NULL, "rna_MeshCon_orientation_set", NULL);
 	RNA_def_property_ui_text(prop, "Rotation", "Quaternion rotation of the mesh constraint");
 
 	prop = RNA_def_property(srna, "plastic", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_PLASTIC);
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_plastic_set");
+	//RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_plastic_set");
 	RNA_def_property_ui_text(prop, "Plastic", "This constraint belongs to a plastic connection");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "type");
 	RNA_def_property_enum_items(prop, rigidbody_constraint_type_items);
-	RNA_def_property_enum_funcs(prop, NULL, "rna_MeshCon_type_set", NULL);
+	//RNA_def_property_enum_funcs(prop, NULL, "rna_MeshCon_type_set", NULL);
 	RNA_def_property_ui_text(prop, "Type", "Type of Rigid Body Constraint");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "island1", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "mi1");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "Mesh Island 1", "First Mesh Island to be constrained");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "island2", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "mi2");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "Mesh Island 2", "Second MeshIsland to be constrained");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_ENABLED);
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_enabled_set");
+	//RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_enabled_set");
 	RNA_def_property_ui_text(prop, "Enabled", "Enable this constraint");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "disable_collisions", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_DISABLE_COLLISIONS);
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_disable_collisions_set");
+	//RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_disable_collisions_set");
 	RNA_def_property_ui_text(prop, "Disable Collisions", "Disable collisions between constrained rigid bodies");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	/* Breaking Threshold */
 	prop = RNA_def_property(srna, "use_breaking", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_BREAKING);
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_use_breaking_set");
+	//RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_use_breaking_set");
 	RNA_def_property_ui_text(prop, "Breakable",
 	                         "Constraint can be broken if it receives an impulse above the threshold");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "breaking_threshold", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "breaking_threshold");
 	RNA_def_property_range(prop, 0.0f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 100.0, 2);
 	RNA_def_property_float_default(prop, 10.0f);
-	RNA_def_property_float_funcs(prop, NULL, "rna_MeshCon_breaking_threshold_set", NULL);
+	//RNA_def_property_float_funcs(prop, NULL, "rna_MeshCon_breaking_threshold_set", NULL);
 	RNA_def_property_ui_text(prop, "Breaking Threshold",
 	                         "Impulse threshold that must be reached for the constraint to break");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	/* Solver Iterations */
 	prop = RNA_def_property(srna, "use_override_solver_iterations", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS);
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_override_solver_iterations_set");
+	//RNA_def_property_boolean_funcs(prop, NULL, "rna_MeshCon_override_solver_iterations_set");
 	RNA_def_property_ui_text(prop, "Override Solver Iterations",
 	                         "Override the number of solver iterations for this constraint");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "solver_iterations", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "num_solver_iterations");
 	RNA_def_property_range(prop, 1, 1000);
 	RNA_def_property_ui_range(prop, 1, 100, 1, 0);
 	RNA_def_property_int_default(prop, 10);
-	RNA_def_property_int_funcs(prop, NULL, "rna_MeshCon_num_solver_iterations_set", NULL);
+	//RNA_def_property_int_funcs(prop, NULL, "rna_MeshCon_num_solver_iterations_set", NULL);
 	RNA_def_property_ui_text(prop, "Solver Iterations",
 	                         "Number of constraint solver iterations made per simulation step (higher values are more "
 	                         "accurate but slower)");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	/* Limits */
 	prop = RNA_def_property(srna, "use_limit_lin_x", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_X);
 	RNA_def_property_ui_text(prop, "X Axis", "Limit translation on X axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_limit_lin_y", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_Y);
 	RNA_def_property_ui_text(prop, "Y Axis", "Limit translation on Y axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_limit_lin_z", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_Z);
 	RNA_def_property_ui_text(prop, "Z Axis", "Limit translation on Z axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_limit_ang_x", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_X);
 	RNA_def_property_ui_text(prop, "X Angle", "Limit rotation around X axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_limit_ang_y", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_Y);
 	RNA_def_property_ui_text(prop, "Y Angle", "Limit rotation around Y axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_limit_ang_z", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_Z);
 	RNA_def_property_ui_text(prop, "Z Angle", "Limit rotation around Z axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_spring_x", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_X);
 	RNA_def_property_ui_text(prop, "X Spring", "Enable spring on X axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_spring_y", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_Y);
 	RNA_def_property_ui_text(prop, "Y Spring", "Enable spring on Y axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_spring_z", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_Z);
 	RNA_def_property_ui_text(prop, "Z Spring", "Enable spring on Z axis");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+	//RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "use_motor_lin", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_MOTOR_LIN);
-	RNA_def_property_bool

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list