Commit: b0eed6fe1951bb6bc56eb0eaae52e619caea1854
Author: Joshua Leung
Date: Tue Dec 16 15:48:18 2014 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rBb0eed6fe1951bb6bc56eb0eaae52e619caea1854
Add fancier identifier for components, and a similar debug print for
OperationIDKey
===================================================================
M source/blender/depsgraph/intern/depsnode.cpp
M source/blender/depsgraph/intern/depsnode_component.cpp
M source/blender/depsgraph/intern/depsnode_component.h
===================================================================
diff --git a/source/blender/depsgraph/intern/depsnode.cpp
b/source/blender/depsgraph/intern/depsnode.cpp
index 405548a..828ace9 100644
--- a/source/blender/depsgraph/intern/depsnode.cpp
+++ b/source/blender/depsgraph/intern/depsnode.cpp
@@ -67,7 +67,7 @@ DepsNode::~DepsNode()
/* Generic identifier for Depsgraph Nodes */
-string DepsNode::identifier()
+string DepsNode::identifier() const
{
char typebuf[5];
sprintf(typebuf, "%d", type);
diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp
b/source/blender/depsgraph/intern/depsnode_component.cpp
index 404ef2d..7e790bb 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -87,10 +87,25 @@ ComponentDepsNode::~ComponentDepsNode()
clear_operations();
}
+string ComponentDepsNode::identifier() const
+{
+ const char *idname = this->owner->name.c_str();
+
+ char typebuf[5];
+ sprintf(typebuf, "%d", type);
+
+ return string("Component(") + idname + " : [" + typebuf + "] " +
name.c_str() + ")";
+}
+
OperationDepsNode *ComponentDepsNode::find_operation(eDepsOperation_Code
opcode, const string &name) const
{
OperationIDKey key(opcode, name);
+
+ printf("===\nfind_operation: %s, %d, %s\n", this->identifier().c_str(),
opcode, name.c_str());
+ key.print_info();
+
OperationMap::const_iterator it = this->operations.find(key);
+ printf("found = %p\n===\n", (it != this->operations.end()) ? it->second
: NULL);
return (it != this->operations.end()) ? it->second : NULL;
}
diff --git a/source/blender/depsgraph/intern/depsnode_component.h
b/source/blender/depsgraph/intern/depsnode_component.h
index 9601b18..d29a106 100644
--- a/source/blender/depsgraph/intern/depsnode_component.h
+++ b/source/blender/depsgraph/intern/depsnode_component.h
@@ -66,6 +66,10 @@ struct ComponentDepsNode : public DepsNode {
opcode(opcode), name(name)
{}
+ void print_info() const
+ {
+ printf("OperationIDKey(%d, %s)\n", opcode,
name.c_str());
+ }
bool operator==(const OperationIDKey &other) const
{
@@ -88,10 +92,12 @@ struct ComponentDepsNode : public DepsNode {
ComponentDepsNode();
+ ~ComponentDepsNode();
void init(const ID *id, const string &subdata);
void copy(DepsgraphCopyContext *dcc, const ComponentDepsNode *src);
- ~ComponentDepsNode();
+
+ string identifier() const;
OperationDepsNode *find_operation(eDepsOperation_Code opcode, const
string &name) const;
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs