2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2013 Blender Foundation.
19 * All rights reserved.
21 * Original Author: Joshua Leung
22 * Contributor(s): Lukas Toenne
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file blender/depsgraph/DEG_depsgraph_build.h
30 * Public API for Depsgraph
33 #ifndef __DEG_DEPSGRAPH_BUILD_H__
34 #define __DEG_DEPSGRAPH_BUILD_H__
36 /* ************************************************* */
38 /* Dependency Graph */
41 /* ------------------------------------------------ */
44 struct EffectorWeights;
56 #include "BLI_sys_types.h"
58 /* Graph Building -------------------------------- */
60 /* Build depsgraph for the given scene, and dump results in given
63 void DEG_graph_build_from_view_layer(struct Depsgraph *graph,
66 struct ViewLayer *view_layer);
68 /* Tag relations from the given graph for update. */
69 void DEG_graph_tag_relations_update(struct Depsgraph *graph);
71 /* Create or update relations in the specified graph. */
72 void DEG_graph_relations_update(struct Depsgraph *graph,
75 struct ViewLayer *view_layer);
77 /* Tag all relations in the database for update.*/
78 void DEG_relations_tag_update(struct Main *bmain);
80 /* Add Dependencies ----------------------------- */
82 /* Handle for components to define their dependencies from callbacks.
83 * This is generated by the depsgraph and passed to dependency callbacks
84 * as a symbolic reference to the current DepsNode.
85 * All relations will be defined in reference to that node.
87 struct DepsNodeHandle;
89 typedef enum eDepsSceneComponentType {
90 /* Parameters Component - Default when nothing else fits
91 * (i.e. just SDNA property setting).
93 DEG_SCENE_COMP_PARAMETERS,
94 /* Animation Component
95 * TODO(sergey): merge in with parameters?
97 DEG_SCENE_COMP_ANIMATION,
98 /* Sequencer Component (Scene Only). */
99 DEG_SCENE_COMP_SEQUENCER,
100 } eDepsSceneComponentType;
102 typedef enum eDepsObjectComponentType {
103 /* Parameters Component - Default when nothing else fits
104 * (i.e. just SDNA property setting).
106 DEG_OB_COMP_PARAMETERS,
107 /* Generic "Proxy-Inherit" Component.
108 * TODO(sergey): Also for instancing of subgraphs?
111 /* Animation Component.
113 * TODO(sergey): merge in with parameters?
115 DEG_OB_COMP_ANIMATION,
116 /* Transform Component (Parenting/Constraints) */
117 DEG_OB_COMP_TRANSFORM,
118 /* Geometry Component (Mesh/Displist) */
119 DEG_OB_COMP_GEOMETRY,
121 /* Evaluation-Related Outer Types (with Subdata) */
123 /* Pose Component - Owner/Container of Bones Eval */
124 DEG_OB_COMP_EVAL_POSE,
125 /* Bone Component - Child/Subcomponent of Pose */
128 /* Particle Systems Component */
129 DEG_OB_COMP_EVAL_PARTICLES,
130 /* Material Shading Component */
132 /* Cache Component */
134 } eDepsObjectComponentType;
136 void DEG_add_scene_relation(struct DepsNodeHandle *node,
138 eDepsSceneComponentType component,
139 const char *description);
140 void DEG_add_object_relation(struct DepsNodeHandle *node,
141 struct Object *object,
142 eDepsObjectComponentType component,
143 const char *description);
144 void DEG_add_object_relation_with_customdata(struct DepsNodeHandle *node,
145 struct Object *object,
146 eDepsObjectComponentType component,
147 uint64_t customdata_mask,
148 const char *description);
149 void DEG_add_bone_relation(struct DepsNodeHandle *handle,
150 struct Object *object,
151 const char *bone_name,
152 eDepsObjectComponentType component,
153 const char *description);
154 void DEG_add_object_cache_relation(struct DepsNodeHandle *handle,
155 struct CacheFile *cache_file,
156 eDepsObjectComponentType component,
157 const char *description);
159 void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, struct ID *id, uint32_t flag);
161 struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *handle);
163 /* ************************************************ */
169 #endif /* __DEG_DEPSGRAPH_BUILD_H__ */