[Bf-blender-cvs] [1e47a77] depsgraph_refactor: Depsgraph: Avoid creating anim->parameters relation when there's no anim node
Sergey Sharybin
noreply at git.blender.org
Wed Apr 1 15:52:54 CEST 2015
Commit: 1e47a7761b5afaadd256463a7d5af40fe7fa18f2
Author: Sergey Sharybin
Date: Wed Apr 1 18:22:45 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB1e47a7761b5afaadd256463a7d5af40fe7fa18f2
Depsgraph: Avoid creating anim->parameters relation when there's no anim node
===================================================================
M source/blender/depsgraph/intern/depsgraph_build.h
M source/blender/depsgraph/intern/depsgraph_build_relations.cpp
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_build.h b/source/blender/depsgraph/intern/depsgraph_build.h
index 7682248..bd7f26b 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -292,6 +292,8 @@ protected:
template <typename KeyType>
DepsNodeHandle create_node_handle(const KeyType &key, const string &default_name = "");
+ bool needs_animdata_node(ID *id);
+
private:
Depsgraph *m_graph;
};
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index ae9e3eb..08aba93 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -1615,7 +1615,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje
build_shapekeys(obdata, key);
}
- if (BKE_animdata_from_id(obdata) != NULL) {
+ if (needs_animdata_node(obdata)) {
ComponentKey animation_key(obdata, DEPSNODE_TYPE_ANIMATION);
ComponentKey parameters_key(obdata, DEPSNODE_TYPE_PARAMETERS);
add_relation(animation_key, parameters_key,
@@ -1636,7 +1636,7 @@ void DepsgraphRelationBuilder::build_camera(Object *ob)
ComponentKey parameters_key(camera_id, DEPSNODE_TYPE_PARAMETERS);
- if (BKE_animdata_from_id(camera_id) != NULL) {
+ if (needs_animdata_node(camera_id)) {
ComponentKey animation_key(camera_id, DEPSNODE_TYPE_ANIMATION);
add_relation(animation_key, parameters_key,
DEPSREL_TYPE_COMPONENT_ORDER, "Camera Parameters");
@@ -1662,7 +1662,7 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob)
ComponentKey parameters_key(lamp_id, DEPSNODE_TYPE_PARAMETERS);
- if (BKE_animdata_from_id(lamp_id) != NULL) {
+ if (needs_animdata_node(lamp_id)) {
ComponentKey animation_key(lamp_id, DEPSNODE_TYPE_ANIMATION);
add_relation(animation_key, parameters_key,
DEPSREL_TYPE_COMPONENT_ORDER, "Lamp Parameters");
@@ -1708,7 +1708,7 @@ void DepsgraphRelationBuilder::build_nodetree(ID *owner, bNodeTree *ntree)
}
}
- if (BKE_animdata_from_id(ntree_id) != NULL) {
+ if (needs_animdata_node(ntree_id)) {
ComponentKey parameters_key(ntree_id, DEPSNODE_TYPE_PARAMETERS);
ComponentKey animation_key(ntree_id, DEPSNODE_TYPE_ANIMATION);
add_relation(animation_key, parameters_key,
@@ -1779,3 +1779,15 @@ void DepsgraphRelationBuilder::build_gpencil(ID *UNUSED(owner), bGPdata *gpd)
// TODO: parent object (when that feature is implemented)
}
+
+bool DepsgraphRelationBuilder::needs_animdata_node(ID *id)
+{
+ AnimData *adt = BKE_animdata_from_id(id);
+ if (adt != NULL) {
+ return adt->action != NULL ||
+ adt->nla_tracks.first != NULL ||
+ adt->drivers.first != NULL;
+ }
+ return false;
+}
+
More information about the Bf-blender-cvs
mailing list