Blender  V3.3
deg_node_operation.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2013 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "intern/node/deg_node.h"
11 
12 #include "intern/depsgraph_type.h"
13 
14 struct Depsgraph;
15 
16 namespace blender::deg {
17 
18 struct ComponentNode;
19 
20 /* Evaluation Operation for atomic operation */
21 /* XXX: move this to another header that can be exposed? */
23 
24 /* Identifiers for common operations (as an enum). */
25 enum class OperationCode {
26  /* Generic Operations. -------------------------------------------------- */
27 
28  /* Placeholder for operations which don't need special mention */
29  OPERATION = 0,
30 
31  /* Generic parameters evaluation. */
36  VISIBILITY,
37 
38  /* Animation, Drivers, etc. --------------------------------------------- */
39  /* NLA + Action */
43  /* Driver */
44  DRIVER,
45 
46  /* Scene related. ------------------------------------------------------- */
47  SCENE_EVAL,
50 
51  /* Object related. ------------------------------------------------------ */
55  DIMENSIONS,
56 
57  /* Transform. ----------------------------------------------------------- */
58  /* Transform entry point. */
60  /* Local transforms only */
62  /* Parenting */
64  /* Constraints */
66  /* Handle object-level updates, mainly proxies hacks and recalc flags. */
68  /* Initializes transformation for simulation.
69  * For example, ensures point cache is properly reset before doing rigid
70  * body simulation. */
72  /* Transform exit point */
74 
75  /* Rigid body. ---------------------------------------------------------- */
76  /* Perform Simulation */
79  /* Copy results to object */
81 
82  /* Geometry. ------------------------------------------------------------ */
83 
84  /* Initialize evaluation of the geometry. Is an entry operation of geometry
85  * component. */
87  /* Evaluate the whole geometry, including modifiers. */
89  /* Evaluation of geometry is completely done. */
91  /* Evaluation of a shape key.
92  * NOTE: Currently only for object data data-blocks. */
94 
95  /* Object data. --------------------------------------------------------- */
98  SOUND_EVAL,
100 
101  /* Pose. ---------------------------------------------------------------- */
102  /* Init pose, clear flags, etc. */
103  POSE_INIT,
104  /* Initialize IK solver related pose stuff. */
105  POSE_INIT_IK,
106  /* Pose is evaluated, and runtime data can be freed. */
107  POSE_CLEANUP,
108  /* Pose has been fully evaluated and ready to be used by others. */
109  POSE_DONE,
110  /* IK/Spline Solvers */
113 
114  /* Bone. ---------------------------------------------------------------- */
115  /* Bone local transforms - entry point */
116  BONE_LOCAL,
117  /* Pose-space conversion (includes parent + restpose, */
119  /* Constraints */
121  /* Bone transforms are ready
122  *
123  * - "READY" This (internal, noop is used to signal that all pre-IK
124  * operations are done. Its role is to help mediate situations
125  * where cyclic relations may otherwise form (i.e. one bone in
126  * chain targeting another in same chain,
127  *
128  * - "DONE" This noop is used to signal that the bone's final pose
129  * transform can be read by others. */
130  /* TODO: deform mats could get calculated in the final_transform ops... */
131  BONE_READY,
132  BONE_DONE,
133  /* B-Bone segment shape computation (after DONE) */
135 
136  /* Particle System. ----------------------------------------------------- */
140 
141  /* Particle Settings. --------------------------------------------------- */
145 
146  /* Point Cache. --------------------------------------------------------- */
148 
149  /* File cache. ---------------------------------------------------------- */
151 
152  /* Collections. --------------------------------------------------------- */
154 
155  /* Copy on Write. ------------------------------------------------------- */
157 
158  /* Shading. ------------------------------------------------------------- */
159  SHADING,
161  LIGHT_UPDATE,
162  WORLD_UPDATE,
163 
164  /* Node Tree. ----------------------------------------------------------- */
165  NTREE_OUTPUT,
166 
167  /* Batch caches. -------------------------------------------------------- */
169 
170  /* Masks. --------------------------------------------------------------- */
172  MASK_EVAL,
173 
174  /* Movie clips. --------------------------------------------------------- */
177 
178  /* Images. -------------------------------------------------------------- */
180 
181  /* Synchronization. ----------------------------------------------------- */
183 
184  /* Generic data-block --------------------------------------------------- */
186 
187  /* Sequencer. ----------------------------------------------------------- */
188 
190 
191  /* Duplication/instancing system. --------------------------------------- */
192  DUPLI,
193 
194  /* Simulation. ---------------------------------------------------------- */
196 };
197 const char *operationCodeAsString(OperationCode opcode);
198 
199 /* Flags for Depsgraph Nodes.
200  * NOTE: IS a bit shifts to allow usage as an accumulated. bitmask.
201  */
203  /* Node needs to be updated. */
205 
206  /* Node was directly modified, causing need for update. */
208 
209  /* Node was updated due to user input. */
211 
212  /* Node may not be removed, even when it has no evaluation callback and no outgoing relations.
213  * This is for NO-OP nodes that are purely used to indicate a relation between components/IDs,
214  * and not for connecting to an operation. */
215  DEPSOP_FLAG_PINNED = (1 << 3),
216 
217  /* The operation directly or indirectly affects ID node visibility. */
219 
220  /* Set of flags which gets flushed along the relations. */
222 };
223 
224 /* Atomic Operation - Base type for all operations */
225 struct OperationNode : public Node {
226  OperationNode();
227 
228  virtual string identifier() const override;
233  string full_identifier() const;
234 
235  virtual void tag_update(Depsgraph *graph, eUpdateSource source) override;
236 
237  bool is_noop() const
238  {
239  return (bool)evaluate == false;
240  }
241 
242  virtual OperationNode *get_entry_operation() override
243  {
244  return this;
245  }
246  virtual OperationNode *get_exit_operation() override
247  {
248  return this;
249  }
250 
251  /* Set this operation as component's entry/exit operation. */
252  void set_as_entry();
253  void set_as_exit();
254 
255  /* Component that contains the operation. */
257 
258  /* Callback for operation. */
260 
261  /* How many inlinks are we still waiting on before we can be evaluated. */
263  bool scheduled;
264 
265  /* Identifier for the operation being performed. */
267  int name_tag;
268 
269  /* (OperationFlag) extra settings affecting evaluation. */
270  int flag;
271 
273 };
274 
276 
277 } // namespace blender::deg
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
Depsgraph * graph
SyclQueue void void size_t num_bytes void
const char * operationCodeAsString(OperationCode opcode)
void deg_register_operation_depsnodes()
function< void(struct ::Depsgraph *)> DepsEvalOperationCb
unsigned int uint32_t
Definition: stdint.h:80
virtual OperationNode * get_exit_operation() override
virtual void tag_update(Depsgraph *graph, eUpdateSource source) override
virtual string identifier() const override
virtual OperationNode * get_entry_operation() override