Blender V5.3
deg_node_operation.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <functional>
12#include <string>
13
15
17
18namespace blender {
19
20struct Depsgraph;
21
22namespace deg {
23
24struct ComponentNode;
25
26/* Evaluation Operation for atomic operation */
27/* XXX: move this to another header that can be exposed? */
28using DepsEvalOperationCb = std::function<void(blender::Depsgraph *)>;
29
30/* Identifiers for common operations (as an enum). */
31enum class OperationCode {
32 /* Generic Operations. -------------------------------------------------- */
33
34 /* Placeholder for operations which don't need special mention */
36
37 /* Generic parameters evaluation. --------------------------------------- */
43
44 /* Hierarchy. ----------------------------------------------------------- */
46
47 /* Animation, Drivers, etc. --------------------------------------------- */
48 /* NLA + Action */
52 /* Driver */
54 /* Writes to RNA properties to ensure implicitly-shared data is un-shared. */
56
57 /* Scene related. ------------------------------------------------------- */
61
62 /* Object related. ------------------------------------------------------ */
67
68 /* Transform. ----------------------------------------------------------- */
69 /* Transform entry point. */
71 /* Local transforms only */
73 /* Parenting */
75 /* Constraints */
77 /* Handle object-level updates, mainly proxies hacks and recalc flags. */
79 /* Initializes transformation for simulation.
80 * For example, ensures point cache is properly reset before doing rigid
81 * body simulation. */
83 /* Transform exit point */
85
86 /* Rigid body. ---------------------------------------------------------- */
87 /* Perform Simulation */
90 /* Copy results to object */
92
93 /* Geometry. ------------------------------------------------------------ */
94
95 /* Initialize evaluation of the geometry. Is an entry operation of geometry
96 * component. */
98 /* Modifier. */
99 MODIFIER,
100 /* Evaluate the whole geometry, including modifiers. */
102 /* Evaluation of geometry is completely done. */
104 /* Evaluation of a shape key.
105 * NOTE: Currently only for object data data-blocks. */
107
108 /* Object data. --------------------------------------------------------- */
113
114 /* Pose. ---------------------------------------------------------------- */
115 /* Init pose, clear flags, etc. */
117 /* Initialize IK solver related pose stuff. */
119 /* Pose is evaluated, and runtime data can be freed. */
121 /* Pose has been fully evaluated and ready to be used by others. */
123 /* IK/Spline Solvers */
126
127 /* Bone. ---------------------------------------------------------------- */
128 /* Bone local transforms - entry point */
130 /* Pose-space conversion (includes parent + rest-pose). */
132 /* Constraints */
134 /* Bone transforms are ready
135 *
136 * - "READY" This (internal, noop) is used to signal that all pre-IK
137 * operations are done. Its role is to help mediate situations
138 * where cyclic relations may otherwise form (i.e. one bone in
139 * chain targeting another in same chain),
140 *
141 * - "DONE" This noop is used to signal that the bone's final pose
142 * transform can be read by others. */
143 /* TODO: deform mats could get calculated in the final_transform ops... */
146 /* B-Bone segment shape computation (after DONE) */
148 /* Getting the visibility doesn't need evaluation of the pose. */
150
151 /* Particle System. ----------------------------------------------------- */
155
156 /* Particle Settings. --------------------------------------------------- */
160
161 /* Point Cache. --------------------------------------------------------- */
163
164 /* File cache. ---------------------------------------------------------- */
166
167 /* Collections. --------------------------------------------------------- */
169
170 /* Copy on Write. ------------------------------------------------------- */
171 COPY_ON_EVAL,
172
173 /* Shading. ------------------------------------------------------------- */
179
180 /* Light linking. ------------------------------------------------------- */
182
183 /* Node Tree. ----------------------------------------------------------- */
186
187 /* Batch caches. -------------------------------------------------------- */
189
190 /* Masks. --------------------------------------------------------------- */
193
194 /* Movie clips. --------------------------------------------------------- */
196
197 /* Images. -------------------------------------------------------------- */
199
200 /* Synchronization. ----------------------------------------------------- */
202
203 /* Generic data-block --------------------------------------------------- */
205
206 /* Sequencer. ----------------------------------------------------------- */
207
209
210 /* Compositor. ---------------------------------------------------------- */
212
213 /* instancing system. --------------------------------------------------- */
214
215 /* Operation on an instancer object. Relations from instanced objects go here. */
217
218 /* Operation on an object which is being instanced. */
221};
222const char *operationCodeAsString(OperationCode opcode);
223
224/* Flags for Depsgraph Nodes.
225 * NOTE: IS a bit shifts to allow usage as an accumulated. bitmask.
226 */
228 /* Node needs to be updated. */
230
231 /* Node was directly modified, causing need for update. */
233
234 /* Node was updated due to user input. */
236
237 /* Node may not be removed, even when it has no evaluation callback and no outgoing relations.
238 * This is for NO-OP nodes that are purely used to indicate a relation between components/IDs,
239 * and not for connecting to an operation. */
241
242 /* The operation directly or indirectly affects ID node visibility. */
244
245 /* Evaluation of the node is temporarily disabled. */
247
248 /* Set of flags which gets flushed along the relations. */
250
251 /* Set of flags which get cleared upon evaluation. */
254};
255
256/* Atomic Operation - Base type for all operations */
257struct OperationNode : public Node {
259
260 std::string identifier() const override;
265 std::string full_identifier() const;
266
267 void tag_update(Depsgraph *graph, eUpdateSource source) override;
268
269 bool is_noop() const
270 {
271 return bool(evaluate) == false;
272 }
273
275 {
276 return this;
277 }
279 {
280 return this;
281 }
282
283 /* Set this operation as component's entry/exit operation. */
284 void set_as_entry();
285 void set_as_exit();
286
287 /* Component that contains the operation. */
289
290 /* Callback for operation. */
292
293 /* How many inlinks are we still waiting on before we can be evaluated. */
296
297 /* Identifier for the operation being performed. */
300
301 /* (OperationFlag) extra settings affecting evaluation. */
302 int flag;
303
305};
306
308
309} // namespace deg
310} // namespace blender
std::function< void(blender::Depsgraph *)> DepsEvalOperationCb
const char * operationCodeAsString(OperationCode opcode)
void deg_register_operation_depsnodes()
BMesh Iterators.
unsigned int uint32_t
Definition BKE_text.h:81
std::string full_identifier() const
void tag_update(Depsgraph *graph, eUpdateSource source) override
OperationNode * get_exit_operation() override
OperationNode * get_entry_operation() override
std::string identifier() const override