Blender V5.0
deg_builder_key.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
12
13#include "RNA_access.hh"
14#include "RNA_path.hh"
15
16namespace blender::deg {
17
18/* -------------------------------------------------------------------- */
21
22std::string TimeSourceKey::identifier() const
23{
24 return std::string("TimeSourceKey");
25}
26
28
29/* -------------------------------------------------------------------- */
32
33std::string ComponentKey::identifier() const
34{
35 const char *idname = (id) ? id->name : "<None>";
36 std::string result = std::string("ComponentKey(");
37 result += idname;
38 result += ", " + std::string(nodeTypeAsString(type));
39 if (name[0] != '\0') {
40 result += ", '" + std::string(name) + "'";
41 }
42 result += ')';
43 return result;
44}
45
47
48/* -------------------------------------------------------------------- */
51
52std::string OperationKey::identifier() const
53{
54 std::string result = std::string("OperationKey(");
55 result += "type: " + std::string(nodeTypeAsString(component_type));
56 result += ", component name: '" + std::string(component_name) + "'";
57 result += ", operation code: " + std::string(operationCodeAsString(opcode));
58 if (name[0] != '\0') {
59 result += ", '" + std::string(name) + "'";
60 }
61 result += ")";
62 return result;
63}
64
66
67/* -------------------------------------------------------------------- */
70
72{
73 /* Create ID pointer for root of path lookup. */
75 /* Try to resolve path. */
76 int index;
77 if (!RNA_path_resolve_full(&id_ptr, path, &ptr, &prop, &index)) {
79 prop = nullptr;
80 }
81}
82
87
89 const char *rna_path_from_target_prop,
91 : id(target_prop.owner_id), source(source)
92{
93 /* Try to resolve path. */
94 int index;
95 if (!RNA_path_resolve_full(&target_prop, rna_path_from_target_prop, &ptr, &prop, &index)) {
97 prop = nullptr;
98 }
99}
100
101std::string RNAPathKey::identifier() const
102{
103 const char *id_name = (id) ? id->name : "<No ID>";
104 const char *prop_name = (prop) ? RNA_property_identifier(prop) : "<No Prop>";
105 return std::string("RnaPathKey(") + "id: " + id_name + ", prop: '" + prop_name + "')";
106}
107
109
110} // namespace blender::deg
const char * operationCodeAsString(OperationCode opcode)
const char * nodeTypeAsString(NodeType type)
Definition deg_node.cc:35
const PointerRNA PointerRNA_NULL
const char * RNA_property_identifier(const PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
bool RNA_path_resolve_full(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
Definition rna_path.cc:544
Definition DNA_ID.h:414
std::string identifier() const
std::string identifier() const
RNAPathKey(ID *id, const char *path, RNAPointerSource source)
std::string identifier() const
std::string identifier() const