[Bf-blender-cvs] [edb418a] depsgraph_refactor: Depsgraph: Fallback to boost's function binding if C++11 is disabled

Sergey Sharybin noreply at git.blender.org
Fri Dec 12 11:48:09 CET 2014


Commit: edb418ada3a8c99e737b144ef9577602b7a34b3e
Author: Sergey Sharybin
Date:   Fri Dec 12 15:45:10 2014 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rBedb418ada3a8c99e737b144ef9577602b7a34b3e

Depsgraph: Fallback to boost's function binding if C++11 is disabled

C++11 appears to be quite tricky to support in a clean fashion with all
the libraries we want blender to compile with. Making those libraries
friendly with C++11 could take a bit of time, and meanwhile instead of
having hacks all over the code we'll be able to just use boost.

This would help avoiding merging crappyness to the master branch, but
idea;;y we'll need to make all the libs being nice with C++11 and zap
boost from the sources.

Consider this as a safety backup plan commit.

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

M	source/blender/depsgraph/CMakeLists.txt
M	source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
M	source/blender/depsgraph/util/depsgraph_util_function.h

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

diff --git a/source/blender/depsgraph/CMakeLists.txt b/source/blender/depsgraph/CMakeLists.txt
index 311f8f3..5231ae4 100644
--- a/source/blender/depsgraph/CMakeLists.txt
+++ b/source/blender/depsgraph/CMakeLists.txt
@@ -39,6 +39,7 @@ set(INC
 )
 
 set(INC_SYS
+	${BOOST_INCLUDE_DIR}
 )
 
 set(SRC
diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
index 9ee04f6..eb9d248 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
@@ -220,7 +220,7 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
 	/* object parent */
 	if (ob->parent) {
 		add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
-		                   DEPSOP_TYPE_EXEC, bind(BKE_object_eval_parent, _1, ob),
+		                   DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_parent, _1, ob),
 		                   deg_op_name_object_parent);
 	}
 	
@@ -237,7 +237,7 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
 	 * TODO(sergey): Get rid of this node.
 	 */
 	add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
-	                   DEPSOP_TYPE_EXEC, bind(BKE_object_eval_uber_transform, _1, scene, ob),
+	                   DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_uber_transform, _1, scene, ob),
 	                   "Object UberEval");
 
 	/* object data */
@@ -288,7 +288,7 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
 	if (ob->type != OB_ARMATURE) {
 		/* Armatures does no longer require uber node. */
 		add_operation_node(&ob->id, DEPSNODE_TYPE_GEOMETRY,
-		                   DEPSOP_TYPE_EXEC, bind(BKE_object_eval_uber_data, _1, scene, ob),
+		                   DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_uber_data, _1, scene, ob),
 		                   "Object Data UberEval");
 	}
 
@@ -297,6 +297,7 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
 void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob)
 {
 	/* init operation */
+
 	add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
 	                   DEPSOP_TYPE_INIT, bind(BKE_object_eval_local_transform, _1, scene, ob),
 	                   deg_op_name_object_local_transform);
@@ -321,7 +322,7 @@ void DepsgraphNodeBuilder::build_object_constraints(Scene *scene, Object *ob)
 {
 	/* create node for constraint stack */
 	add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
-	                   DEPSOP_TYPE_EXEC, bind(BKE_object_eval_constraints, _1, scene, ob),
+	                   DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_constraints, _1, scene, ob),
 	                   deg_op_name_constraint_stack);
 }
 
@@ -329,7 +330,7 @@ void DepsgraphNodeBuilder::build_pose_constraints(Object *ob, bPoseChannel *pcha
 {
 	/* create node for constraint stack */
 	add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
-	                   DEPSOP_TYPE_EXEC, bind(BKE_pose_constraints_evaluate, _1, ob, pchan),
+	                   DEPSOP_TYPE_EXEC, function_bind(BKE_pose_constraints_evaluate, _1, ob, pchan),
 	                   deg_op_name_constraint_stack);
 }
 
@@ -353,7 +354,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 		/* actions and NLA - as a single unit for now, as it gets complicated to schedule otherwise */
 		if ((adt->action) || (adt->nla_tracks.first)) {
 			add_operation_node(id, DEPSNODE_TYPE_ANIMATION,
-			                   DEPSOP_TYPE_EXEC, bind(BKE_animsys_eval_animdata, _1, id, time_src),
+			                   DEPSOP_TYPE_EXEC, function_bind(BKE_animsys_eval_animdata, _1, id, time_src),
 			                   deg_op_name_animdata(id));
 			
 			// TODO: for each channel affected, we might also want to add some support for running RNA update callbacks on them
@@ -382,7 +383,7 @@ OperationDepsNode *DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcu)
 	/* create data node for this driver ..................................... */
 	TimeSourceDepsNode *time_src = m_graph->find_time_source();
 	OperationDepsNode *driver_op = add_operation_node(id, DEPSNODE_TYPE_PARAMETERS,
-	                                                  DEPSOP_TYPE_EXEC, bind(BKE_animsys_eval_driver, _1, id, fcu, time_src),
+	                                                  DEPSOP_TYPE_EXEC, function_bind(BKE_animsys_eval_driver, _1, id, fcu, time_src),
 	                                                  deg_op_name_driver(fcu));
 	
 	/* tag "scripted expression" drivers as needing Python (due to GIL issues, etc.) */
@@ -446,13 +447,13 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
 	
 	/* init/rebuild operation */
 	/*OperationDepsNode *init_node =*/ add_operation_node(&scene->id, DEPSNODE_TYPE_TRANSFORM,
-	                                                      DEPSOP_TYPE_REBUILD, bind(BKE_rigidbody_rebuild_sim, _1, scene),
+	                                                      DEPSOP_TYPE_REBUILD, function_bind(BKE_rigidbody_rebuild_sim, _1, scene),
 	                                                      deg_op_name_rigidbody_world_rebuild);
 	
 	/* do-sim operation */
 	// XXX: what happens if we need to split into several groups?
 	/*OperationDepsNode *sim_node =*/ add_operation_node(&scene->id, DEPSNODE_TYPE_TRANSFORM,
-	                                                     DEPSOP_TYPE_SIM, bind(BKE_rigidbody_eval_simulation, _1, scene),
+	                                                     DEPSOP_TYPE_SIM, function_bind(BKE_rigidbody_eval_simulation, _1, scene),
 	                                                     deg_op_name_rigidbody_world_simulate);
 	
 	/* objects - simulation participants */
@@ -466,7 +467,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
 			/* 2) create operation for flushing results */
 			/* object's transform component - where the rigidbody operation lives */
 			add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM,
-			                   DEPSOP_TYPE_EXEC, bind(BKE_rigidbody_object_sync_transforms, _1, scene, ob), /* xxx: function name */
+			                   DEPSOP_TYPE_EXEC, function_bind(BKE_rigidbody_object_sync_transforms, _1, scene, ob), /* xxx: function name */
 			                   deg_op_name_rigidbody_object_sync);
 		}
 	}
@@ -499,7 +500,7 @@ void DepsgraphNodeBuilder::build_particles(Object *ob)
 		
 		/* this particle system */
 		add_operation_node(psys_comp,
-		                   DEPSOP_TYPE_EXEC, bind(BKE_particle_system_eval, _1, ob, psys),
+		                   DEPSOP_TYPE_EXEC, function_bind(BKE_particle_system_eval, _1, ob, psys),
 		                   deg_op_name_psys_eval);
 	}
 	
@@ -515,7 +516,7 @@ void DepsgraphNodeBuilder::build_ik_pose(Scene *scene, Object *ob, bPoseChannel
 	bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data);
 	/* Operation node for evaluating/running IK Solver. */
 	add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name,
-	                   DEPSOP_TYPE_SIM, bind(BKE_pose_iktree_evaluate, _1, scene, ob, rootchan),
+	                   DEPSOP_TYPE_SIM, function_bind(BKE_pose_iktree_evaluate, _1, scene, ob, rootchan),
 	                   deg_op_name_ik_solver);
 }
 
@@ -529,7 +530,7 @@ void DepsgraphNodeBuilder::build_splineik_pose(Scene *scene, Object *ob, bPoseCh
 	 * Store the "root bone" of this chain in the solver, so it knows where to start.
 	 */
 	add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name,
-	                   DEPSOP_TYPE_SIM, bind(BKE_pose_splineik_evaluate, _1, scene, ob, rootchan),
+	                   DEPSOP_TYPE_SIM, function_bind(BKE_pose_splineik_evaluate, _1, scene, ob, rootchan),
 	                   deg_op_name_spline_ik_solver);
 	// XXX: what sort of ID-data is needed?
 }
@@ -575,16 +576,16 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob)
 	
 	/* pose eval context */
 	add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE,
-	                   DEPSOP_TYPE_INIT, bind(BKE_pose_eval_init, _1, scene, ob, ob->pose), deg_op_name_pose_eval_init);
+	                   DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_init, _1, scene, ob, ob->pose), deg_op_name_pose_eval_init);
 	
 	add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE,
-	                   DEPSOP_TYPE_POST, bind(BKE_pose_eval_flush, _1, scene, ob, ob->pose), deg_op_name_pose_eval_flush);
+	                   DEPSOP_TYPE_POST, function_bind(BKE_pose_eval_flush, _1, scene, ob, ob->pose), deg_op_name_pose_eval_flush);
 	
 	/* bones */
 	for (bPoseChannel *pchan = (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan = pchan->next) {
 		/* node for bone eval */
 		add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
-		                   DEPSOP_TYPE_EXEC, bind(BKE_pose_eval_bone, _1, scene, ob, pchan),
+		                   DEPSOP_TYPE_EXEC, function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan),
 		                   "Bone Transforms");
 
 		add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
@@ -643,7 +644,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 			
 			/* evaluation operations */
 			add_operation_node(&ob->id, DEPSNODE_TYPE_GEOMETRY,
-			                   DEPSOP_TYPE_EXEC, bind(BKE_mesh_eval_geometry, _1, (Mesh *)obdata),
+			                   DEPSOP_TYPE_EXEC, function_bind(BKE_mesh_eval_geometry, _1, (Mesh *)obdata),
 			                   "Geometry Eval");
 		}
 		break;
@@ -657,7 +658,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 				/* metaball evaluation operations */
 				/* NOTE: only the motherball gets evaluated! */
 				add_operation_node(&ob->id, DEPSNODE_TYPE_GEOMETRY,
-				                   DEPSOP_TYPE_EXEC, bind(BKE_mball_eval_geometry, _1, (MetaBall *)obdata),
+				                   DEPSOP_TYPE_EXEC, function_bind(BKE_mball_eval_geometry, _1, (MetaBall *)obdata),
 				                   "Geometry Eval");
 			}
 		}
@@ -669,12 +670,12 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 			/* curve evaluation operations */
 			/* - calculate curve geometry (including path) */
 			add_operation_node(&ob->id, DEPSNODE_TYPE_GEOMETRY,
-			                   DEPSOP_TYPE_EXEC, bind(BKE_curve_eval_ge

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list