Merge branch 'blender2.7'
[blender.git] / source / blender / depsgraph / DEG_depsgraph_build.h
index 76eca029eea82960a37003df7b716df0bfbcfc08..62315391e95c2c0c451ff634248e95e118d23e2b 100644 (file)
@@ -17,8 +17,8 @@
  * All rights reserved.
  */
 
-/** \file blender/depsgraph/DEG_depsgraph_build.h
- *  \ingroup depsgraph
+/** \file
+ * \ingroup depsgraph
  *
  * Public API for Depsgraph
  */
@@ -33,44 +33,45 @@ struct Depsgraph;
 
 /* ------------------------------------------------ */
 
+struct CacheFile;
+struct Collection;
+struct CustomData_MeshMasks;
 struct EffectorWeights;
-struct Group;
+struct ID;
 struct Main;
 struct ModifierData;
 struct Object;
 struct Scene;
+struct ViewLayer;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#include "BLI_sys_types.h"
+
 /* Graph Building -------------------------------- */
 
 /* Build depsgraph for the given scene, and dump results in given
  * graph container.
  */
-void DEG_graph_build_from_scene(struct Depsgraph *graph,
-                                struct Main *bmain,
-                                struct Scene *scene);
+void DEG_graph_build_from_view_layer(struct Depsgraph *graph,
+                                      struct Main *bmain,
+                                      struct Scene *scene,
+                                      struct ViewLayer *view_layer);
 
 /* Tag relations from the given graph for update. */
 void DEG_graph_tag_relations_update(struct Depsgraph *graph);
 
+/* Create or update relations in the specified graph. */
+void DEG_graph_relations_update(struct Depsgraph *graph,
+                                struct Main *bmain,
+                                struct Scene *scene,
+                                struct ViewLayer *view_layer);
+
 /* Tag all relations in the database for update.*/
 void DEG_relations_tag_update(struct Main *bmain);
 
-/* Create new graph if didn't exist yet,
- * or update relations if graph was tagged for update.
- */
-void DEG_scene_relations_update(struct Main *bmain, struct Scene *scene);
-
-/* Rebuild dependency graph only for a given scene. */
-void DEG_scene_relations_rebuild(struct Main *bmain,
-                                 struct Scene *scene);
-
-/* Delete scene graph. */
-void DEG_scene_graph_free(struct Scene *scene);
-
 /* Add Dependencies  ----------------------------- */
 
 /* Handle for components to define their dependencies from callbacks.
@@ -80,17 +81,12 @@ void DEG_scene_graph_free(struct Scene *scene);
  */
 struct DepsNodeHandle;
 
-struct CacheFile;
-struct Object;
-
 typedef enum eDepsSceneComponentType {
        /* Parameters Component - Default when nothing else fits
-        * (i.e. just SDNA property setting).
-        */
+        * (i.e. just SDNA property setting). */
        DEG_SCENE_COMP_PARAMETERS,
        /* Animation Component
-        * TODO(sergey): merge in with parameters?
-        */
+        * TODO(sergey): merge in with parameters?  */
        DEG_SCENE_COMP_ANIMATION,
        /* Sequencer Component (Scene Only). */
        DEG_SCENE_COMP_SEQUENCER,
@@ -98,21 +94,18 @@ typedef enum eDepsSceneComponentType {
 
 typedef enum eDepsObjectComponentType {
        /* Parameters Component - Default when nothing else fits
-        * (i.e. just SDNA property setting).
-        */
+        * (i.e. just SDNA property setting). */
        DEG_OB_COMP_PARAMETERS,
        /* Generic "Proxy-Inherit" Component.
-        * TODO(sergey): Also for instancing of subgraphs?
-        */
+        * TODO(sergey): Also for instancing of subgraphs? */
        DEG_OB_COMP_PROXY,
        /* Animation Component.
         *
-        * TODO(sergey): merge in with parameters?
-        */
+        * TODO(sergey): merge in with parameters? */
        DEG_OB_COMP_ANIMATION,
        /* Transform Component (Parenting/Constraints) */
        DEG_OB_COMP_TRANSFORM,
-       /* Geometry Component (DerivedMesh/Displist) */
+       /* Geometry Component (Mesh/Displist) */
        DEG_OB_COMP_GEOMETRY,
 
        /* Evaluation-Related Outer Types (with Subdata) */
@@ -122,19 +115,17 @@ typedef enum eDepsObjectComponentType {
        /* Bone Component - Child/Subcomponent of Pose */
        DEG_OB_COMP_BONE,
 
-       /* Particle Systems Component */
-       DEG_OB_COMP_EVAL_PARTICLES,
        /* Material Shading Component */
        DEG_OB_COMP_SHADING,
        /* Cache Component */
        DEG_OB_COMP_CACHE,
 } eDepsObjectComponentType;
 
-void DEG_add_scene_relation(struct DepsNodeHandle *node,
+void DEG_add_scene_relation(struct DepsNodeHandle *node_handle,
                             struct Scene *scene,
                             eDepsSceneComponentType component,
                             const char *description);
-void DEG_add_object_relation(struct DepsNodeHandle *node,
+void DEG_add_object_relation(struct DepsNodeHandle *node_handle,
                              struct Object *object,
                              eDepsObjectComponentType component,
                              const char *description);
@@ -147,30 +138,34 @@ void DEG_add_object_cache_relation(struct DepsNodeHandle *handle,
                                    struct CacheFile *cache_file,
                                    eDepsObjectComponentType component,
                                    const char *description);
-
-
-struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *handle);
-void DEG_add_special_eval_flag(struct Depsgraph *graph, struct ID *id, short flag);
-
-/* Utility functions for physics modifiers */
-typedef bool (*DEG_CollobjFilterFunction)(struct Object *obj, struct ModifierData *md);
-
-void DEG_add_collision_relations(struct DepsNodeHandle *handle,
-                                 struct Scene *scene,
-                                 struct Object *object,
-                                 struct Group *group,
-                                 int layer,
-                                 unsigned int modifier_type,
-                                 DEG_CollobjFilterFunction fn,
-                                 bool dupli,
-                                 const char *name);
-void DEG_add_forcefield_relations(struct DepsNodeHandle *handle,
-                                  struct Scene *scene,
-                                  struct Object *object,
-                                  struct EffectorWeights *eff,
-                                  bool add_absorption,
-                                  int skip_forcefield,
-                                  const char *name);
+/* Adds relation from DEG_OPCODE_GENERIC_DATABLOCK_UPDATE of a given ID.
+ * Is used for such entities as textures and images. */
+void DEG_add_generic_id_relation(struct DepsNodeHandle *node_handle,
+                                 struct ID *id,
+                                 const char *description);
+
+/* Special function which is used from modifiers' updateDepsgraph() callback
+ * to indicate that the modifietr needs to know transformation of the object
+ * which that modifier belongs to.
+ * This function will take care of checking which operation is required to
+ * have transformation for the modifier, taking into account possible simulation
+ * solvers. */
+void DEG_add_modifier_to_transform_relation(
+        struct DepsNodeHandle *node_handle,
+        const char *description);
+
+/* Adds relations from the given component of a given object to the given node
+ * handle AND the component to the point cache component of the node's ID. */
+void DEG_add_object_pointcache_relation(struct DepsNodeHandle *node_handle,
+                                        struct Object *object,
+                                        eDepsObjectComponentType component,
+                                        const char *description);
+
+void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, struct ID *id, uint32_t flag);
+void DEG_add_customdata_mask(struct DepsNodeHandle *handle, struct Object *object, const struct CustomData_MeshMasks *masks);
+
+struct ID *DEG_get_id_from_handle(struct DepsNodeHandle *node_handle);
+struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *node_handle);
 
 /* ************************************************ */