[Bf-blender-cvs] [36d4a5c] depsgraph_refactor: Code cleanup
Joshua Leung
noreply at git.blender.org
Wed Dec 17 04:41:25 CET 2014
Commit: 36d4a5c75bbde9ced25313ff463263f933e29116
Author: Joshua Leung
Date: Wed Dec 17 14:40:12 2014 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB36d4a5c75bbde9ced25313ff463263f933e29116
Code cleanup
===================================================================
M source/blender/depsgraph/intern/depsgraph_build.h
M source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
M source/blender/depsgraph/intern/depsgraph_type_defines.cpp
M source/blender/depsgraph/intern/depsnode_component.cpp
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_build.h b/source/blender/depsgraph/intern/depsgraph_build.h
index 368a275..f33cb68 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -179,7 +179,8 @@ struct RNAPathKey
PropertyRNA *prop;
};
-struct DepsgraphRelationBuilder {
+struct DepsgraphRelationBuilder
+{
typedef vector<const char*> RootPChanVector;
typedef unordered_map<const char*, RootPChanVector> RootPChanMap;
@@ -236,7 +237,8 @@ private:
Depsgraph *m_graph;
};
-struct DepsNodeHandle {
+struct DepsNodeHandle
+{
DepsNodeHandle(DepsgraphRelationBuilder *builder, OperationDepsNode *node, const string &default_name = "") :
builder(builder),
node(node),
diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
index 7fa386c..afe1b80 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
@@ -512,8 +512,10 @@ void DepsgraphNodeBuilder::build_particles(Object *ob)
void DepsgraphNodeBuilder::build_ik_pose(Scene *scene, Object *ob, bPoseChannel *pchan, bConstraint *con)
{
bKinematicConstraint *data = (bKinematicConstraint *)con->data;
+
/* Find the chain's root. */
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, function_bind(BKE_pose_iktree_evaluate, _1, scene, ob, rootchan),
@@ -524,8 +526,10 @@ void DepsgraphNodeBuilder::build_ik_pose(Scene *scene, Object *ob, bPoseChannel
void DepsgraphNodeBuilder::build_splineik_pose(Scene *scene, Object *ob, bPoseChannel *pchan, bConstraint *con)
{
bSplineIKConstraint *data = (bSplineIKConstraint *)con->data;
+
/* Find the chain's root. */
bPoseChannel *rootchan = BKE_armature_splineik_solver_find_root(pchan, data);
+
/* Operation node for evaluating/running Spline IK Solver.
* Store the "root bone" of this chain in the solver, so it knows where to start.
*/
@@ -571,7 +575,6 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob)
* so that we can redirect those to point at either the the post-IK/
* post-constraint/post-matrix steps, as needed.
*/
- // TODO: rest pose/editmode handling!
/* pose eval context */
add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE,
@@ -584,17 +587,17 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob)
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_INIT, NULL, // XXX
+ DEPSOP_TYPE_INIT, NULL, // XXX: BKE_pose_eval_bone_local
DEG_OPCODE_BONE_LOCAL);
add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
- DEPSOP_TYPE_EXEC, function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), // XXX
+ DEPSOP_TYPE_EXEC, function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), // XXX: BKE_pose_eval_bone_pose
DEG_OPCODE_BONE_POSE_PARENT);
add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
- DEPSOP_TYPE_POST, NULL, // XXX
+ DEPSOP_TYPE_POST, NULL, // XXX: BKE_eval_bone_done ?
DEG_OPCODE_BONE_DONE);
-
+
/* constraints */
if (pchan->constraints.first != NULL) {
build_pose_constraints(ob, pchan);
diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cpp b/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
index 5c3a530..1e43a1a 100644
--- a/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
@@ -158,7 +158,8 @@ void BKE_pose_eval_init(EvaluationContext *eval_ctx,
void BKE_pose_eval_bone(EvaluationContext *eval_ctx,
Scene *scene,
Object *ob,
- bPoseChannel *pchan) {
+ bPoseChannel *pchan)
+{
bArmature *arm = (bArmature *)ob->data;
printf("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
BLI_assert(ob->type == OB_ARMATURE);
diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp b/source/blender/depsgraph/intern/depsnode_component.cpp
index 7e790bb..81b71e7 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -94,7 +94,7 @@ string ComponentDepsNode::identifier() const
char typebuf[5];
sprintf(typebuf, "%d", type);
- return string("Component(") + idname + " : [" + typebuf + "] " + name.c_str() + ")";
+ return string("Component(") + idname + " - " + typebuf + " " + name.c_str() + ")";
}
OperationDepsNode *ComponentDepsNode::find_operation(eDepsOperation_Code opcode, const string &name) const
@@ -221,6 +221,8 @@ DEG_DEPSNODE_DEFINE(ParticlesComponentDepsNode, DEPSNODE_TYPE_EVAL_PARTICLES, "P
static DepsNodeFactoryImpl<ParticlesComponentDepsNode> DNTI_EVAL_PARTICLES;
+/* Node Types Register =================================== */
+
void DEG_register_component_depsnodes()
{
DEG_register_node_typeinfo(&DNTI_PARAMETERS);
More information about the Bf-blender-cvs
mailing list