diff options
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_type_defines.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_type_defines.cc | 74 |
1 files changed, 55 insertions, 19 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cc b/source/blender/depsgraph/intern/depsgraph_type_defines.cc index 41c72d11eac..6d7f86581d9 100644 --- a/source/blender/depsgraph/intern/depsgraph_type_defines.cc +++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cc @@ -71,11 +71,47 @@ DepsNodeFactory *deg_type_get_factory(const eDepsNode_Type type) return depsnode_typeinfo_registry[type]; } -/* Stringified opcodes ------------------------------------- */ +/* Stringified node types ---------------------------------- */ + +const char *nodeTypeAsString(eDepsNode_Type type) +{ + switch (type) { +#define STRINGIFY_TYPE(name) case DEG_NODE_TYPE_##name: return #name + + STRINGIFY_TYPE(UNDEFINED); + STRINGIFY_TYPE(OPERATION); + /* **** Generic Types **** */ + STRINGIFY_TYPE(TIMESOURCE); + STRINGIFY_TYPE(ID_REF); + /* **** Outer Types **** */ + STRINGIFY_TYPE(PARAMETERS); + STRINGIFY_TYPE(PROXY); + STRINGIFY_TYPE(ANIMATION); + STRINGIFY_TYPE(TRANSFORM); + STRINGIFY_TYPE(GEOMETRY); + STRINGIFY_TYPE(SEQUENCER); + STRINGIFY_TYPE(LAYER_COLLECTIONS); + STRINGIFY_TYPE(COPY_ON_WRITE); + STRINGIFY_TYPE(OBJECT_FROM_LAYER); + /* **** Evaluation-Related Outer Types (with Subdata) **** */ + STRINGIFY_TYPE(EVAL_POSE); + STRINGIFY_TYPE(BONE); + STRINGIFY_TYPE(EVAL_PARTICLES); + STRINGIFY_TYPE(SHADING); + STRINGIFY_TYPE(SHADING_PARAMETERS); + STRINGIFY_TYPE(CACHE); + STRINGIFY_TYPE(BATCH_CACHE); + + /* Total number of meaningful node types. */ + case NUM_DEG_NODE_TYPES: return "SpecialCase"; +#undef STRINGIFY_TYPE + } + return "UNKNOWN"; +} -DepsOperationStringifier DEG_OPNAMES; +/* Stringified opcodes ------------------------------------- */ -static const char *stringify_opcode(eDepsOperation_Code opcode) +const char *operationCodeAsString(eDepsOperation_Code opcode) { switch (opcode) { #define STRINGIFY_OPCODE(name) case DEG_OPCODE_##name: return #name @@ -87,6 +123,8 @@ static const char *stringify_opcode(eDepsOperation_Code opcode) /* Animation, Drivers, etc. */ STRINGIFY_OPCODE(ANIMATION); STRINGIFY_OPCODE(DRIVER); + /* Object related. */ + STRINGIFY_OPCODE(OBJECT_BASE_FLAGS); /* Transform. */ STRINGIFY_OPCODE(TRANSFORM_LOCAL); STRINGIFY_OPCODE(TRANSFORM_PARENT); @@ -101,6 +139,9 @@ static const char *stringify_opcode(eDepsOperation_Code opcode) STRINGIFY_OPCODE(GEOMETRY_UBEREVAL); STRINGIFY_OPCODE(GEOMETRY_CLOTH_MODIFIER); STRINGIFY_OPCODE(GEOMETRY_SHAPEKEY); + /* Object data. */ + STRINGIFY_OPCODE(LIGHT_PROBE_EVAL); + STRINGIFY_OPCODE(SPEAKER_EVAL); /* Pose. */ STRINGIFY_OPCODE(POSE_INIT); STRINGIFY_OPCODE(POSE_INIT_IK); @@ -116,11 +157,22 @@ static const char *stringify_opcode(eDepsOperation_Code opcode) /* Particles. */ STRINGIFY_OPCODE(PARTICLE_SYSTEM_EVAL_INIT); STRINGIFY_OPCODE(PARTICLE_SYSTEM_EVAL); + STRINGIFY_OPCODE(PARTICLE_SETTINGS_EVAL); + /* Point Cache. */ + STRINGIFY_OPCODE(POINT_CACHE_RESET); + /* Batch cache. */ + STRINGIFY_OPCODE(GEOMETRY_SELECT_UPDATE); /* Masks. */ STRINGIFY_OPCODE(MASK_ANIMATION); STRINGIFY_OPCODE(MASK_EVAL); + /* Collections. */ + STRINGIFY_OPCODE(VIEW_LAYER_EVAL); + /* Copy on write. */ + STRINGIFY_OPCODE(COPY_ON_WRITE); /* Shading. */ STRINGIFY_OPCODE(SHADING); + STRINGIFY_OPCODE(MATERIAL_UPDATE); + STRINGIFY_OPCODE(WORLD_UPDATE); /* Movie clip. */ STRINGIFY_OPCODE(MOVIECLIP_EVAL); @@ -130,22 +182,6 @@ static const char *stringify_opcode(eDepsOperation_Code opcode) return "UNKNOWN"; } -DepsOperationStringifier::DepsOperationStringifier() -{ - for (int i = 0; i < DEG_NUM_OPCODES; ++i) { - names_[i] = stringify_opcode((eDepsOperation_Code)i); - } -} - -const char *DepsOperationStringifier::operator[](eDepsOperation_Code opcode) -{ - BLI_assert((opcode >= 0) && (opcode < DEG_NUM_OPCODES)); - if (opcode >= 0 && opcode < DEG_NUM_OPCODES) { - return names_[opcode]; - } - return "UnknownOpcode"; -} - } // namespace DEG /* Register all node types */ |