Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/intern/node_geometry_exec.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "BKE_curves.hh" | #include "BKE_curves.hh" | ||||
| #include "BKE_type_conversions.hh" | #include "BKE_type_conversions.hh" | ||||
| #include "NOD_geometry_exec.hh" | #include "NOD_geometry_exec.hh" | ||||
| #include "BLI_hash_md5.h" | |||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| NodeAnonymousAttributeID::NodeAnonymousAttributeID(const Object &object, | |||||
| const ComputeContext &compute_context, | |||||
| const bNode &bnode, | |||||
| const StringRef identifier) | |||||
| { | |||||
| const ComputeContextHash &hash = compute_context.hash(); | |||||
| { | |||||
| std::stringstream ss; | |||||
| ss << hash << "_" << object.id.name << "_" << bnode.identifier << "_" << identifier; | |||||
| long_name_ = ss.str(); | |||||
| } | |||||
| { | |||||
| uint64_t hash_result[2]; | |||||
| BLI_hash_md5_buffer(long_name_.data(), long_name_.size(), hash_result); | |||||
| std::stringstream ss; | |||||
| ss << ".a_" << std::hex << hash_result[0] << hash_result[1]; | |||||
| name_ = ss.str(); | |||||
| BLI_assert(name_.size() < MAX_CUSTOMDATA_LAYER_NAME); | |||||
| } | |||||
| } | |||||
| void GeoNodeExecParams::error_message_add(const NodeWarningType type, | void GeoNodeExecParams::error_message_add(const NodeWarningType type, | ||||
| const StringRef message) const | const StringRef message) const | ||||
| { | { | ||||
| if (geo_eval_log::GeoTreeLogger *tree_logger = this->get_local_tree_logger()) { | if (geo_eval_log::GeoTreeLogger *tree_logger = this->get_local_tree_logger()) { | ||||
| tree_logger->node_warnings.append( | tree_logger->node_warnings.append( | ||||
| {node_.identifier, {type, tree_logger->allocator->copy_string(message)}}); | {node_.identifier, {type, tree_logger->allocator->copy_string(message)}}); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines | |||||