Blender V5.0
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
18struct Depsgraph;
19
20namespace blender::deg {
21
22struct ComponentNode;
23
24/* Evaluation Operation for atomic operation */
25/* XXX: move this to another header that can be exposed? */
26using DepsEvalOperationCb = std::function<void(::Depsgraph *)>;
27
28/* Identifiers for common operations (as an enum). */
29enum class OperationCode {
30 /* Generic Operations. -------------------------------------------------- */
31
32 /* Placeholder for operations which don't need special mention */
34
35 /* Generic parameters evaluation. --------------------------------------- */
41
42 /* Hierarchy. ----------------------------------------------------------- */
44
45 /* Animation, Drivers, etc. --------------------------------------------- */
46 /* NLA + Action */
50 /* Driver */
52 /* Writes to RNA properties to ensure implicitly-shared data is un-shared. */
54
55 /* Scene related. ------------------------------------------------------- */
59
60 /* Object related. ------------------------------------------------------ */
65
66 /* Transform. ----------------------------------------------------------- */
67 /* Transform entry point. */
69 /* Local transforms only */
71 /* Parenting */
73 /* Constraints */
75 /* Handle object-level updates, mainly proxies hacks and recalc flags. */
77 /* Initializes transformation for simulation.
78 * For example, ensures point cache is properly reset before doing rigid
79 * body simulation. */
81 /* Transform exit point */
83
84 /* Rigid body. ---------------------------------------------------------- */
85 /* Perform Simulation */
88 /* Copy results to object */
90
91 /* Geometry. ------------------------------------------------------------ */
92
93 /* Initialize evaluation of the geometry. Is an entry operation of geometry
94 * component. */
96 /* Modifier. */
98 /* Evaluate the whole geometry, including modifiers. */
100 /* Evaluation of geometry is completely done. */
102 /* Evaluation of a shape key.
103 * NOTE: Currently only for object data data-blocks. */
105
106 /* Object data. --------------------------------------------------------- */
111
112 /* Pose. ---------------------------------------------------------------- */
113 /* Init pose, clear flags, etc. */
115 /* Initialize IK solver related pose stuff. */
117 /* Pose is evaluated, and runtime data can be freed. */
119 /* Pose has been fully evaluated and ready to be used by others. */
121 /* IK/Spline Solvers */
124
125 /* Bone. ---------------------------------------------------------------- */
126 /* Bone local transforms - entry point */
128 /* Pose-space conversion (includes parent + rest-pose. */
130 /* Constraints */
132 /* Bone transforms are ready
133 *
134 * - "READY" This (internal, noop is used to signal that all pre-IK
135 * operations are done. Its role is to help mediate situations
136 * where cyclic relations may otherwise form (i.e. one bone in
137 * chain targeting another in same chain,
138 *
139 * - "DONE" This noop is used to signal that the bone's final pose
140 * transform can be read by others. */
141 /* TODO: deform mats could get calculated in the final_transform ops... */
144 /* B-Bone segment shape computation (after DONE) */
146
147 /* Particle System. ----------------------------------------------------- */
151
152 /* Particle Settings. --------------------------------------------------- */
156
157 /* Point Cache. --------------------------------------------------------- */
159
160 /* File cache. ---------------------------------------------------------- */
162
163 /* Collections. --------------------------------------------------------- */
165
166 /* Copy on Write. ------------------------------------------------------- */
168
169 /* Shading. ------------------------------------------------------------- */
175
176 /* Light linking. ------------------------------------------------------- */
178
179 /* Node Tree. ----------------------------------------------------------- */
182
183 /* Batch caches. -------------------------------------------------------- */
185
186 /* Masks. --------------------------------------------------------------- */
189
190 /* Movie clips. --------------------------------------------------------- */
192
193 /* Images. -------------------------------------------------------------- */
195
196 /* Synchronization. ----------------------------------------------------- */
198
199 /* Generic data-block --------------------------------------------------- */
201
202 /* Sequencer. ----------------------------------------------------------- */
203
205
206 /* instancing system. --------------------------------------------------- */
207
208 /* Operation on an instancer object. Relations from instanced objects go here. */
210
211 /* Operation on an object which is being instanced. */
214};
215const char *operationCodeAsString(OperationCode opcode);
216
217/* Flags for Depsgraph Nodes.
218 * NOTE: IS a bit shifts to allow usage as an accumulated. bitmask.
219 */
221 /* Node needs to be updated. */
223
224 /* Node was directly modified, causing need for update. */
226
227 /* Node was updated due to user input. */
229
230 /* Node may not be removed, even when it has no evaluation callback and no outgoing relations.
231 * This is for NO-OP nodes that are purely used to indicate a relation between components/IDs,
232 * and not for connecting to an operation. */
234
235 /* The operation directly or indirectly affects ID node visibility. */
237
238 /* Evaluation of the node is temporarily disabled. */
240
241 /* Set of flags which gets flushed along the relations. */
243
244 /* Set of flags which get cleared upon evaluation. */
247};
248
249/* Atomic Operation - Base type for all operations */
250struct OperationNode : public Node {
252
253 std::string identifier() const override;
258 std::string full_identifier() const;
259
260 void tag_update(Depsgraph *graph, eUpdateSource source) override;
261
262 bool is_noop() const
263 {
264 return (bool)evaluate == false;
265 }
266
268 {
269 return this;
270 }
272 {
273 return this;
274 }
275
276 /* Set this operation as component's entry/exit operation. */
277 void set_as_entry();
278 void set_as_exit();
279
280 /* Component that contains the operation. */
282
283 /* Callback for operation. */
285
286 /* How many inlinks are we still waiting on before we can be evaluated. */
289
290 /* Identifier for the operation being performed. */
293
294 /* (OperationFlag) extra settings affecting evaluation. */
295 int flag;
296
298};
299
301
302} // namespace blender::deg
@ POSE_DONE
@ BONE_DONE
const char * operationCodeAsString(OperationCode opcode)
void deg_register_operation_depsnodes()
std::function< void(::Depsgraph *)> DepsEvalOperationCb
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