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 /* Material Shading Component */
130 /* Cache Component */
132 } eDepsObjectComponentType;
134 void DEG_add_scene_relation(struct DepsNodeHandle *node_handle,
136 eDepsSceneComponentType component,
137 const char *description);
138 void DEG_add_object_relation(struct DepsNodeHandle *node_handle,
139 struct Object *object,
140 eDepsObjectComponentType component,
141 const char *description);
142 void DEG_add_object_relation_with_customdata(struct DepsNodeHandle *node_handle,
143 struct Object *object,
144 eDepsObjectComponentType component,
145 uint64_t customdata_mask,
146 const char *description);
147 void DEG_add_bone_relation(struct DepsNodeHandle *handle,
148 struct Object *object,
149 const char *bone_name,
150 eDepsObjectComponentType component,
151 const char *description);
152 void DEG_add_object_cache_relation(struct DepsNodeHandle *handle,
153 struct CacheFile *cache_file,
154 eDepsObjectComponentType component,
155 const char *description);
157 /* Adds relations from the given component of a given object to the given node
158 * handle AND the component to the point cache component of the node's ID.
160 void DEG_add_object_pointcache_relation(struct DepsNodeHandle *node_handle,
161 struct Object *object,
162 eDepsObjectComponentType component,
163 const char *description);
165 void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, struct ID *id, uint32_t flag);
167 struct ID *DEG_get_id_from_handle(struct DepsNodeHandle *node_handle);
168 struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *node_handle);
170 /* ************************************************ */
176 #endif /* __DEG_DEPSGRAPH_BUILD_H__ */