Blender V4.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
9#pragma once
10
12
14
15struct Depsgraph;
16
17namespace blender::deg {
18
19struct ComponentNode;
20
21/* Evaluation Operation for atomic operation */
22/* XXX: move this to another header that can be exposed? */
23using DepsEvalOperationCb = function<void(::Depsgraph *)>;
24
25/* Identifiers for common operations (as an enum). */
26enum class OperationCode {
27 /* Generic Operations. -------------------------------------------------- */
28
29 /* Placeholder for operations which don't need special mention */
30 OPERATION = 0,
31
32 /* Generic parameters evaluation. --------------------------------------- */
38
39 /* Hierarchy. ----------------------------------------------------------- */
41
42 /* Animation, Drivers, etc. --------------------------------------------- */
43 /* NLA + Action */
47 /* Driver */
48 DRIVER,
49
50 /* Scene related. ------------------------------------------------------- */
54
55 /* Object related. ------------------------------------------------------ */
60
61 /* Transform. ----------------------------------------------------------- */
62 /* Transform entry point. */
64 /* Local transforms only */
66 /* Parenting */
68 /* Constraints */
70 /* Handle object-level updates, mainly proxies hacks and recalc flags. */
72 /* Initializes transformation for simulation.
73 * For example, ensures point cache is properly reset before doing rigid
74 * body simulation. */
76 /* Transform exit point */
78
79 /* Rigid body. ---------------------------------------------------------- */
80 /* Perform Simulation */
83 /* Copy results to object */
85
86 /* Geometry. ------------------------------------------------------------ */
87
88 /* Initialize evaluation of the geometry. Is an entry operation of geometry
89 * component. */
91 /* Modifier. */
93 /* Evaluate the whole geometry, including modifiers. */
95 /* Evaluation of geometry is completely done. */
97 /* Evaluation of a shape key.
98 * NOTE: Currently only for object data data-blocks. */
100
101 /* Object data. --------------------------------------------------------- */
106
107 /* Pose. ---------------------------------------------------------------- */
108 /* Init pose, clear flags, etc. */
109 POSE_INIT,
110 /* Initialize IK solver related pose stuff. */
112 /* Pose is evaluated, and runtime data can be freed. */
114 /* Pose has been fully evaluated and ready to be used by others. */
115 POSE_DONE,
116 /* IK/Spline Solvers */
119
120 /* Bone. ---------------------------------------------------------------- */
121 /* Bone local transforms - entry point */
123 /* Pose-space conversion (includes parent + rest-pose. */
125 /* Constraints */
127 /* Bone transforms are ready
128 *
129 * - "READY" This (internal, noop is used to signal that all pre-IK
130 * operations are done. Its role is to help mediate situations
131 * where cyclic relations may otherwise form (i.e. one bone in
132 * chain targeting another in same chain,
133 *
134 * - "DONE" This noop is used to signal that the bone's final pose
135 * transform can be read by others. */
136 /* TODO: deform mats could get calculated in the final_transform ops... */
138 BONE_DONE,
139 /* B-Bone segment shape computation (after DONE) */
141
142 /* Particle System. ----------------------------------------------------- */
146
147 /* Particle Settings. --------------------------------------------------- */
151
152 /* Point Cache. --------------------------------------------------------- */
154
155 /* File cache. ---------------------------------------------------------- */
157
158 /* Collections. --------------------------------------------------------- */
160
161 /* Copy on Write. ------------------------------------------------------- */
163
164 /* Shading. ------------------------------------------------------------- */
165 SHADING,
170
171 /* Light linking. ------------------------------------------------------- */
173
174 /* Node Tree. ----------------------------------------------------------- */
177
178 /* Batch caches. -------------------------------------------------------- */
180
181 /* Masks. --------------------------------------------------------------- */
183 MASK_EVAL,
184
185 /* Movie clips. --------------------------------------------------------- */
187
188 /* Images. -------------------------------------------------------------- */
190
191 /* Synchronization. ----------------------------------------------------- */
193
194 /* Generic data-block --------------------------------------------------- */
196
197 /* Sequencer. ----------------------------------------------------------- */
198
200
201 /* instancing system. --------------------------------------------------- */
202
203 /* Operation on an instancer object. Relations from instanced objects go here. */
204 INSTANCER,
205
206 /* Operation on an object which is being instanced. */
207 INSTANCE,
209};
210const char *operationCodeAsString(OperationCode opcode);
211
212/* Flags for Depsgraph Nodes.
213 * NOTE: IS a bit shifts to allow usage as an accumulated. bitmask.
214 */
216 /* Node needs to be updated. */
218
219 /* Node was directly modified, causing need for update. */
221
222 /* Node was updated due to user input. */
224
225 /* Node may not be removed, even when it has no evaluation callback and no outgoing relations.
226 * This is for NO-OP nodes that are purely used to indicate a relation between components/IDs,
227 * and not for connecting to an operation. */
229
230 /* The operation directly or indirectly affects ID node visibility. */
232
233 /* Evaluation of the node is temporarily disabled. */
235
236 /* Set of flags which gets flushed along the relations. */
238
239 /* Set of flags which get cleared upon evaluation. */
242};
243
244/* Atomic Operation - Base type for all operations */
245struct OperationNode : public Node {
247
248 virtual string identifier() const override;
253 string full_identifier() const;
254
255 virtual void tag_update(Depsgraph *graph, eUpdateSource source) override;
256
257 bool is_noop() const
258 {
259 return (bool)evaluate == false;
260 }
261
263 {
264 return this;
265 }
267 {
268 return this;
269 }
270
271 /* Set this operation as component's entry/exit operation. */
272 void set_as_entry();
273 void set_as_exit();
274
275 /* Component that contains the operation. */
277
278 /* Callback for operation. */
280
281 /* How many inlinks are we still waiting on before we can be evaluated. */
284
285 /* Identifier for the operation being performed. */
288
289 /* (OperationFlag) extra settings affecting evaluation. */
290 int flag;
291
293};
294
296
297} // namespace blender::deg
function< void(::Depsgraph *)> DepsEvalOperationCb
const char * operationCodeAsString(OperationCode opcode)
void deg_register_operation_depsnodes()
unsigned int uint32_t
Definition stdint.h:80
virtual OperationNode * get_entry_operation() override
virtual void tag_update(Depsgraph *graph, eUpdateSource source) override
virtual OperationNode * get_exit_operation() override
virtual string identifier() const override