Fix T50060: New depsgraph does not update mask animation

This commit is contained in:
Sergey Sharybin 2016-11-17 15:29:22 +01:00
parent cf60343b06
commit 48a8a20e2a
4 changed files with 37 additions and 2 deletions

View File

@ -55,6 +55,7 @@ extern "C" {
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_mask_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
@ -395,10 +396,15 @@ void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene *scene)
build_gpencil(scene->gpd);
}
/* cache files */
/* Cache file. */
LINKLIST_FOREACH (CacheFile *, cachefile, &bmain->cachefiles) {
build_cachefile(cachefile);
}
/* Masks. */
LINKLIST_FOREACH (Mask *, mask, &bmain->mask) {
build_mask(mask);
}
}
void DepsgraphNodeBuilder::build_group(Scene *scene,
@ -1211,7 +1217,6 @@ void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
ID *cache_file_id = &cache_file->id;
add_component_node(cache_file_id, DEPSNODE_TYPE_CACHE);
add_operation_node(cache_file_id, DEPSNODE_TYPE_CACHE,
DEPSOP_TYPE_EXEC, NULL,
DEG_OPCODE_PLACEHOLDER, "Cache File Update");
@ -1220,4 +1225,11 @@ void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
build_animdata(cache_file_id);
}
void DepsgraphNodeBuilder::build_mask(Mask *mask)
{
ID *mask_id = &mask->id;
add_id_node(mask_id);
build_animdata(mask_id);
}
} // namespace DEG

View File

@ -44,6 +44,7 @@ struct Group;
struct Key;
struct Main;
struct Material;
struct Mask;
struct MTex;
struct bNodeTree;
struct Object;
@ -154,6 +155,7 @@ struct DepsgraphNodeBuilder {
void build_compositor(Scene *scene);
void build_gpencil(bGPdata *gpd);
void build_cachefile(CacheFile *cache_file);
void build_mask(Mask *mask);
protected:
Main *m_bmain;

View File

@ -55,6 +55,7 @@ extern "C" {
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_mask_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
@ -405,6 +406,11 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
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)
@ -1738,4 +1744,15 @@ bool DepsgraphRelationBuilder::needs_animdata_node(ID *id)
return false;
}
void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file) {
/* Animation. */
build_animdata(&cache_file->id);
}
void DepsgraphRelationBuilder::build_mask(Mask *mask)
{
/* Animation. */
build_animdata(&mask->id);
}
} // namespace DEG

View File

@ -47,6 +47,7 @@
struct Base;
struct bGPdata;
struct CacheFile;
struct ListBase;
struct GHash;
struct ID;
@ -54,6 +55,7 @@ struct FCurve;
struct Group;
struct Key;
struct Main;
struct Mask;
struct Material;
struct MTex;
struct bNodeTree;
@ -220,6 +222,8 @@ struct DepsgraphRelationBuilder
void build_texture_stack(ID *owner, MTex **texture_stack);
void build_compositor(Scene *scene);
void build_gpencil(ID *owner, bGPdata *gpd);
void build_cachefile(CacheFile *cache_file);
void build_mask(Mask *mask);
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);