diff options
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph_build.h | 102 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 42 |
2 files changed, 115 insertions, 29 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h b/source/blender/depsgraph/DEG_depsgraph_build.h index 0945da439ef..fdc86540171 100644 --- a/source/blender/depsgraph/DEG_depsgraph_build.h +++ b/source/blender/depsgraph/DEG_depsgraph_build.h @@ -51,8 +51,12 @@ extern "C" { /* 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); +/* 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); /* Tag relations from the given graph for update. */ void DEG_graph_tag_relations_update(struct Depsgraph *graph); @@ -85,31 +89,69 @@ struct CacheFile; struct Object; typedef enum eDepsSceneComponentType { - DEG_SCENE_COMP_PARAMETERS, /* Parameters Component - Default when nothing else fits (i.e. just SDNA property setting) */ - DEG_SCENE_COMP_ANIMATION, /* Animation Component */ // XXX: merge in with parameters? - DEG_SCENE_COMP_SEQUENCER, /* Sequencer Component (Scene Only) */ + /* Parameters Component - Default when nothing else fits + * (i.e. just SDNA property setting). + */ + DEG_SCENE_COMP_PARAMETERS, + /* Animation Component + * TODO(sergey): merge in with parameters? + */ + DEG_SCENE_COMP_ANIMATION, + /* Sequencer Component (Scene Only). */ + DEG_SCENE_COMP_SEQUENCER, } eDepsSceneComponentType; typedef enum eDepsObjectComponentType { - DEG_OB_COMP_PARAMETERS, /* Parameters Component - Default when nothing else fits (i.e. just SDNA property setting) */ - DEG_OB_COMP_PROXY, /* Generic "Proxy-Inherit" Component */ // XXX: Also for instancing of subgraphs? - DEG_OB_COMP_ANIMATION, /* Animation Component */ // XXX: merge in with parameters? - DEG_OB_COMP_TRANSFORM, /* Transform Component (Parenting/Constraints) */ - DEG_OB_COMP_GEOMETRY, /* Geometry Component (DerivedMesh/Displist) */ - + /* Parameters Component - Default when nothing else fits + * (i.e. just SDNA property setting). + */ + DEG_OB_COMP_PARAMETERS, + /* Generic "Proxy-Inherit" Component. + * TODO(sergey): Also for instancing of subgraphs? + */ + DEG_OB_COMP_PROXY, + /* Animation Component. + * + * TODO(sergey): merge in with parameters? + */ + DEG_OB_COMP_ANIMATION, + /* Transform Component (Parenting/Constraints) */ + DEG_OB_COMP_TRANSFORM, + /* Geometry Component (DerivedMesh/Displist) */ + DEG_OB_COMP_GEOMETRY, + /* Evaluation-Related Outer Types (with Subdata) */ - DEG_OB_COMP_EVAL_POSE, /* Pose Component - Owner/Container of Bones Eval */ - DEG_OB_COMP_BONE, /* Bone Component - Child/Subcomponent of Pose */ - - DEG_OB_COMP_EVAL_PARTICLES, /* Particle Systems Component */ - DEG_OB_COMP_SHADING, /* Material Shading Component */ - DEG_OB_COMP_CACHE, /* Cache Component */ + + /* Pose Component - Owner/Container of Bones Eval */ + DEG_OB_COMP_EVAL_POSE, + /* 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, struct Scene *scene, eDepsSceneComponentType component, const char *description); -void DEG_add_object_relation(struct DepsNodeHandle *node, struct Object *ob, eDepsObjectComponentType component, const char *description); -void DEG_add_bone_relation(struct DepsNodeHandle *handle, struct Object *ob, const char *bone_name, eDepsObjectComponentType component, const char *description); -void DEG_add_object_cache_relation(struct DepsNodeHandle *handle, struct CacheFile *cache_file, eDepsObjectComponentType component, const char *description); +void DEG_add_scene_relation(struct DepsNodeHandle *node, + struct Scene *scene, + eDepsSceneComponentType component, + const char *description); +void DEG_add_object_relation(struct DepsNodeHandle *node, struct + Object *ob, + eDepsObjectComponentType component, + const char *description); +void DEG_add_bone_relation(struct DepsNodeHandle *handle, + struct Object *ob, + const char *bone_name, + eDepsObjectComponentType component, + const char *description); +void DEG_add_object_cache_relation(struct DepsNodeHandle *handle, + struct CacheFile *cache_file, + eDepsObjectComponentType component, + const char *description); /* TODO(sergey): Remove once all geometry update is granular. */ void DEG_add_special_eval_flag(struct Depsgraph *graph, struct ID *id, short flag); @@ -117,8 +159,22 @@ void DEG_add_special_eval_flag(struct Depsgraph *graph, struct ID *id, short fla /* 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, Object *ob, 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, Object *ob, struct EffectorWeights *eff, bool add_absorption, int skip_forcefield, const char *name); +void DEG_add_collision_relations(struct DepsNodeHandle *handle, + struct Scene *scene, + Object *ob, + 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, + Object *ob, + struct EffectorWeights *eff, + bool add_absorption, + int skip_forcefield, + const char *name); /* ************************************************ */ diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 7b3922a2eaf..9952f714145 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -324,7 +324,15 @@ void DEG_scene_graph_free(Scene *scene) } } -void DEG_add_collision_relations(DepsNodeHandle *handle, Scene *scene, Object *ob, Group *group, int layer, unsigned int modifier_type, DEG_CollobjFilterFunction fn, bool dupli, const char *name) +void DEG_add_collision_relations(DepsNodeHandle *handle, + Scene *scene, + Object *ob, + Group *group, + int layer, + unsigned int modifier_type, + DEG_CollobjFilterFunction fn, + bool dupli, + const char *name) { unsigned int numcollobj; Object **collobjs = get_collisionobjects_ext(scene, ob, group, layer, &numcollobj, modifier_type, dupli); @@ -342,7 +350,13 @@ void DEG_add_collision_relations(DepsNodeHandle *handle, Scene *scene, Object *o MEM_freeN(collobjs); } -void DEG_add_forcefield_relations(DepsNodeHandle *handle, Scene *scene, Object *ob, EffectorWeights *effector_weights, bool add_absorption, int skip_forcefield, const char *name) +void DEG_add_forcefield_relations(DepsNodeHandle *handle, + Scene *scene, + Object *ob, + EffectorWeights *effector_weights, + bool add_absorption, + int skip_forcefield, + const char *name) { ListBase *effectors = pdInitEffectors(scene, ob, NULL, effector_weights, false); @@ -354,17 +368,33 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle, Scene *scene, Object * if (eff->psys) { DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_EVAL_PARTICLES, name); - /* TODO: remove this when/if EVAL_PARTICLES is sufficient for up to date particles */ + /* TODO: remove this when/if EVAL_PARTICLES is sufficient + * for up to date particles. + */ DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_GEOMETRY, name); } if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) { - DEG_add_object_relation(handle, eff->pd->f_source, DEG_OB_COMP_TRANSFORM, "Smoke Force Domain"); - DEG_add_object_relation(handle, eff->pd->f_source, DEG_OB_COMP_GEOMETRY, "Smoke Force Domain"); + DEG_add_object_relation(handle, + eff->pd->f_source, + DEG_OB_COMP_TRANSFORM, + "Smoke Force Domain"); + DEG_add_object_relation(handle, + eff->pd->f_source, + DEG_OB_COMP_GEOMETRY, + "Smoke Force Domain"); } if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) { - DEG_add_collision_relations(handle, scene, ob, NULL, eff->ob->lay, eModifierType_Collision, NULL, true, "Force Absorption"); + DEG_add_collision_relations(handle, + scene, + ob, + NULL, + eff->ob->lay, + eModifierType_Collision, + NULL, + true, + "Force Absorption"); } } } |