Blender V4.3
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
12
13#include "RNA_path.hh"
14
15namespace blender::deg {
16
17/* -------------------------------------------------------------------- */
22{
23 return string("TimeSourceKey");
24}
25
28/* -------------------------------------------------------------------- */
33{
34 const char *idname = (id) ? id->name : "<None>";
35 string result = string("ComponentKey(");
36 result += idname;
37 result += ", " + string(nodeTypeAsString(type));
38 if (name[0] != '\0') {
39 result += ", '" + string(name) + "'";
40 }
41 result += ')';
42 return result;
43}
44
47/* -------------------------------------------------------------------- */
52{
53 string result = string("OperationKey(");
54 result += "type: " + string(nodeTypeAsString(component_type));
55 result += ", component name: '" + string(component_name) + "'";
56 result += ", operation code: " + string(operationCodeAsString(opcode));
57 if (name[0] != '\0') {
58 result += ", '" + string(name) + "'";
59 }
60 result += ")";
61 return result;
62}
63
66/* -------------------------------------------------------------------- */
70RNAPathKey::RNAPathKey(ID *id, const char *path, RNAPointerSource source) : id(id), source(source)
71{
72 /* Create ID pointer for root of path lookup. */
74 /* Try to resolve path. */
75 int index;
76 if (!RNA_path_resolve_full(&id_ptr, path, &ptr, &prop, &index)) {
78 prop = nullptr;
79 }
80}
81
83 : id(id), ptr(ptr), prop(prop), source(source)
84{
85}
86
88 const char *rna_path_from_target_prop,
89 const RNAPointerSource source)
90 : id(target_prop.owner_id), source(source)
91{
92 /* Try to resolve path. */
93 int index;
94 if (!RNA_path_resolve_full(&target_prop, rna_path_from_target_prop, &ptr, &prop, &index)) {
96 prop = nullptr;
97 }
98}
99
101{
102 const char *id_name = (id) ? id->name : "<No ID>";
103 const char *prop_name = (prop) ? RNA_property_identifier(prop) : "<No Prop>";
104 return string("RnaPathKey(") + "id: " + id_name + ", prop: '" + prop_name + "')";
105}
106
109} // namespace blender::deg
constexpr PointerRNA PointerRNA_NULL
Definition RNA_types.hh:45
std::string id_name(void *id)
const char * operationCodeAsString(OperationCode opcode)
const char * nodeTypeAsString(NodeType type)
Definition deg_node.cc:40
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:537
Definition DNA_ID.h:413
RNAPathKey(ID *id, const char *path, RNAPointerSource source)
PointerRNA * ptr
Definition wm_files.cc:4126