diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-11-17 18:37:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-11-17 18:37:25 +0300 |
commit | d294509dd845a1cab07cccd2bdcb7797b01cae32 (patch) | |
tree | 03105931251e4b7d511ceca118af9e37b2990971 /source/blender/depsgraph/intern/builder | |
parent | 4dbd61cc64bfa5a545ce07cd6e06f1cfa2f3bd28 (diff) |
Depsgrpah: Fix missing animation update in movie clips
Diffstat (limited to 'source/blender/depsgraph/intern/builder')
6 files changed, 28 insertions, 87 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 4e6ab73b353..f986d5dea46 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -58,6 +58,7 @@ extern "C" { #include "DNA_mask_types.h" #include "DNA_mesh_types.h" #include "DNA_meta_types.h" +#include "DNA_movieclip_types.h" #include "DNA_node_types.h" #include "DNA_particle_types.h" #include "DNA_object_types.h" @@ -1144,4 +1145,10 @@ void DepsgraphNodeBuilder::build_mask(Mask *mask) build_animdata(mask_id); } +void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip) { + ID *clip_id = &clip->id; + add_id_node(clip_id); + build_animdata(clip_id); +} + } // namespace DEG diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 0cfddeed6ef..9cb8bc5d45c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -46,6 +46,7 @@ struct Main; struct Material; struct Mask; struct MTex; +struct MovieClip; struct bNodeTree; struct Object; struct bPoseChannel; @@ -156,6 +157,7 @@ struct DepsgraphNodeBuilder { void build_gpencil(bGPdata *gpd); void build_cachefile(CacheFile *cache_file); void build_mask(Mask *mask); + void build_movieclip(MovieClip *clip); protected: Main *m_bmain; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc index fb243ab0672..bcd4bc51448 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc @@ -149,6 +149,11 @@ void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene *scene) LINKLIST_FOREACH (Mask *, mask, &bmain->mask) { build_mask(mask); } + + /* Movie clips. */ + LINKLIST_FOREACH (MovieClip *, clip, &bmain->movieclip) { + build_movieclip(clip); + } } } // namespace DEG diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 293c14e5dde..dadb7f8917f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -58,6 +58,7 @@ extern "C" { #include "DNA_mask_types.h" #include "DNA_mesh_types.h" #include "DNA_meta_types.h" +#include "DNA_movieclip_types.h" #include "DNA_node_types.h" #include "DNA_particle_types.h" #include "DNA_object_types.h" @@ -338,93 +339,6 @@ void DepsgraphRelationBuilder::add_forcefield_relations(const OperationKey &key, /* **** Functions to build relations between entities **** */ -void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene) -{ - /* LIB_TAG_DOIT is used to indicate whether node for given ID was already - * created or not. - */ - BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); - /* XXX nested node trees are not included in tag-clearing above, - * so we need to do this manually. - */ - FOREACH_NODETREE(bmain, nodetree, id) { - if (id != (ID *)nodetree) - nodetree->id.tag &= ~LIB_TAG_DOIT; - } FOREACH_NODETREE_END - - if (scene->set) { - // TODO: link set to scene, especially our timesource... - } - - /* scene objects */ - LINKLIST_FOREACH (Base *, base, &scene->base) { - Object *ob = base->object; - - /* object itself */ - build_object(bmain, scene, ob); - - /* object that this is a proxy for */ - if (ob->proxy) { - ob->proxy->proxy_from = ob; - build_object(bmain, scene, ob->proxy); - /* TODO(sergey): This is an inverted relation, matches old depsgraph - * behavior and need to be investigated if it still need to be inverted. - */ - ComponentKey ob_pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); - ComponentKey proxy_pose_key(&ob->proxy->id, DEPSNODE_TYPE_EVAL_POSE); - add_relation(ob_pose_key, proxy_pose_key, DEPSREL_TYPE_TRANSFORM, "Proxy"); - } - - /* Object dupligroup. */ - if (ob->dup_group) { - build_group(bmain, scene, ob, ob->dup_group); - } - } - - /* rigidbody */ - if (scene->rigidbody_world) { - build_rigidbody(scene); - } - - /* scene's animation and drivers */ - if (scene->adt) { - build_animdata(&scene->id); - } - - /* world */ - if (scene->world) { - build_world(scene->world); - } - - /* compo nodes */ - if (scene->nodetree) { - build_compositor(scene); - } - - /* grease pencil */ - if (scene->gpd) { - build_gpencil(&scene->id, scene->gpd); - } - - /* Masks. */ - LINKLIST_FOREACH (Mask *, mask, &bmain->mask) { - build_mask(mask); - } - - for (Depsgraph::OperationNodes::const_iterator it_op = m_graph->operations.begin(); - it_op != m_graph->operations.end(); - ++it_op) - { - OperationDepsNode *node = *it_op; - IDDepsNode *id_node = node->owner->owner; - ID *id = id_node->id; - if (GS(id->name) == ID_OB) { - Object *object = (Object *)id; - object->customdata_mask |= node->customdata_mask; - } - } -} - void DepsgraphRelationBuilder::build_group(Main *bmain, Scene *scene, Object *object, @@ -1755,4 +1669,10 @@ void DepsgraphRelationBuilder::build_mask(Mask *mask) build_animdata(&mask->id); } +void DepsgraphRelationBuilder::build_movieclip(MovieClip *clip) +{ + /* Animation. */ + build_animdata(&clip->id); +} + } // namespace DEG diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 1c293aa1508..6e8485bee30 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -58,6 +58,7 @@ struct Main; struct Mask; struct Material; struct MTex; +struct MovieClip; struct bNodeTree; struct Object; struct bPoseChannel; @@ -224,6 +225,7 @@ struct DepsgraphRelationBuilder void build_gpencil(ID *owner, bGPdata *gpd); void build_cachefile(CacheFile *cache_file); void build_mask(Mask *mask); + void build_movieclip(MovieClip *clip); void add_collision_relations(const OperationKey &key, Scene *scene, Object *ob, Group *group, int layer, bool dupli, const char *name); void add_forcefield_relations(const OperationKey &key, Scene *scene, Object *ob, ParticleSystem *psys, EffectorWeights *eff, bool add_absorption, const char *name); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc index 946c9da6cab..6b51a957da0 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc @@ -140,6 +140,11 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene) build_mask(mask); } + /* Movie clips. */ + LINKLIST_FOREACH (MovieClip *, clip, &bmain->movieclip) { + build_movieclip(clip); + } + for (Depsgraph::OperationNodes::const_iterator it_op = m_graph->operations.begin(); it_op != m_graph->operations.end(); ++it_op) |