Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-15 13:32:45 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-11-15 13:43:12 +0300
commit4a3a4eef14eaf760c09e004b33e675dc3682fab8 (patch)
tree0971247e2109030e59732d59783b3d425d2ae1f2 /source
parent48c137ad5d5ac0cff7b2427d52c418ab6f24ba3f (diff)
Depsgraph: Use more human readable relation keys identifier
Diffstat (limited to 'source')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc30
-rw-r--r--source/blender/depsgraph/intern/depsgraph_types.h1
2 files changed, 18 insertions, 13 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
index a965d890496..3aae358dda3 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
@@ -72,10 +72,14 @@ ComponentKey::ComponentKey(ID *id, eDepsNode_Type type, const char *name)
string ComponentKey::identifier() const
{
const char *idname = (id) ? id->name : "<None>";
- char typebuf[5];
- BLI_snprintf(typebuf, sizeof(typebuf), "%d", type);
- return string("ComponentKey(") +
- idname + ", " + typebuf + ", '" + name + "')";
+ string result = string("ComponentKey(");
+ result += idname;
+ result += ", " + string(nodeTypeAsString(type));
+ if (name[0] != '\0') {
+ result += ", '" + string(name) + "'";
+ }
+ result += ')';
+ return result;
}
/////////////////////////////////////////
@@ -174,13 +178,15 @@ OperationKey::OperationKey(ID *id,
string OperationKey::identifier() const
{
- char typebuf[5];
- BLI_snprintf(typebuf, sizeof(typebuf), "%d", component_type);
- return string("OperationKey(") +
- "t: " + typebuf +
- ", cn: '" + component_name +
- "', c: " + operationCodeAsString(opcode) +
- ", n: '" + name + "')";
+ string result = string("OperationKey(");
+ result += "type: " + string(nodeTypeAsString(component_type));
+ result += ", component name: '" + string(component_name) + "'";
+ result += ", operation code: " + string(operationCodeAsString(opcode));
+ if (name[0] != '\0') {
+ result += ", '" + string(name) + "'";
+ }
+ result += ")";
+ return result;
}
/////////////////////////////////////////
@@ -212,7 +218,7 @@ string RNAPathKey::identifier() const
const char *id_name = (id) ? id->name : "<No ID>";
const char *prop_name = (prop) ? RNA_property_identifier(prop) : "<No Prop>";
return string("RnaPathKey(") + "id: " + id_name +
- ", prop: " + prop_name + "')";
+ ", prop: '" + prop_name + "')";
}
} // namespace DEG
diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h
index 32ffcd79c74..d81483526ed 100644
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@ -166,7 +166,6 @@ typedef enum eDepsNode_Type {
/* Total number of meaningful node types. */
NUM_DEG_NODE_TYPES,
} eDepsNode_Type;
-
const char *nodeTypeAsString(eDepsNode_Type type);
/* Identifiers for common operations (as an enum). */