Blender V4.3
deg_builder_rna.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
13
14struct ID;
15struct PointerRNA;
16struct PropertyRNA;
17
18namespace blender::deg {
19
20struct Depsgraph;
21struct Node;
22class RNANodeQueryIDData;
23class DepsgraphBuilder;
24
25/* For queries which gives operation node or key defines whether we are
26 * interested in a result of the given property or whether we are linking some
27 * dependency to that property. */
28enum class RNAPointerSource {
29 /* Query will return pointer to an entry operation of component which is
30 * responsible for evaluation of the given property. */
31 ENTRY,
32 /* Query will return pointer to an exit operation of component which is
33 * responsible for evaluation of the given property.
34 * More precisely, it will return operation at which the property is known
35 * to be evaluated. */
36 EXIT,
37};
38
39/* A helper structure which wraps all fields needed to find a node inside of
40 * the dependency graph. */
42 public:
44
45 /* Check whether this identifier is valid and usable. */
46 bool is_valid() const;
47
50 const char *component_name;
52 const char *operation_name;
54};
55
56/* Helper class which performs optimized lookups of a node within a given
57 * dependency graph which satisfies given RNA pointer or RAN path. */
59 public:
62
63 Node *find_node(const PointerRNA *ptr, const PropertyRNA *prop, RNAPointerSource source);
64
65 protected:
68
69 /* Indexed by an ID, returns RNANodeQueryIDData associated with that ID. */
71
72 /* Construct identifier of the node which corresponds given configuration
73 * of RNA property. */
75 const PropertyRNA *prop,
76 RNAPointerSource source);
77
78 /* Make sure ID data exists for the given ID, and returns it. */
80
81 /* Check whether prop_identifier contains rna_path_component.
82 *
83 * This checks more than a sub-string:
84 *
85 * prop_identifier contains(prop_identifier, "location")
86 * ------------------------ -------------------------------------
87 * location true
88 * ["test_location"] false
89 * pose["bone"].location true
90 * pose["bone"].location.x true
91 */
92 static bool contains(const char *prop_identifier, const char *rna_path_component);
93};
94
96
97} // namespace blender::deg
Node * find_node(const PointerRNA *ptr, const PropertyRNA *prop, RNAPointerSource source)
RNANodeIdentifier construct_node_identifier(const PointerRNA *ptr, const PropertyRNA *prop, RNAPointerSource source)
static bool contains(const char *prop_identifier, const char *rna_path_component)
DepsgraphBuilder * builder_
RNANodeQuery(Depsgraph *depsgraph, DepsgraphBuilder *builder)
RNANodeQueryIDData * ensure_id_data(const ID *id)
Map< const ID *, unique_ptr< RNANodeQueryIDData > > id_data_map_
const Depsgraph * depsgraph
bool rna_prop_affects_parameters_node(const PointerRNA *ptr, const PropertyRNA *prop)
Definition DNA_ID.h:413
PointerRNA * ptr
Definition wm_files.cc:4126