Commit: 4a3a4eef14eaf760c09e004b33e675dc3682fab8 Author: Sergey Sharybin Date: Thu Nov 15 11:32:45 2018 +0100 Branches: blender2.8 https://developer.blender.org/rB4a3a4eef14eaf760c09e004b33e675dc3682fab8
Depsgraph: Use more human readable relation keys identifier =================================================================== M source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc M source/blender/depsgraph/intern/depsgraph_types.h =================================================================== 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). */ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs