Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-18 15:23:49 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-18 18:52:01 +0300
commit0e3a2acbfa6998b3a1ec967f3c25f7e12e0cf8fb (patch)
treedde289c6fbe219951ae5618866b33dfcfa3325e4 /source/blender/depsgraph
parent286c34b4abb0436fb370c8d49fd73738dabc0fcf (diff)
Fix T57457: animated image sequences not working in Eevee.
The dependency graph now handles updating image users to point to the current frame, and tags images to be refreshed on the GPU. The image editor user is still updated outside of the dependency graph. We still do not support multiple image users using a different current frame in the same image, same as 2.7. This may require adding a GPU image texture cache to keep memory usage under control. Things like rendering an animation while the viewport stays fixed at the current frame works though.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc19
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.h1
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc15
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.h1
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.cc2
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.h3
6 files changed, 40 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 524462793fc..59c024e8a3e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -73,6 +73,7 @@ extern "C" {
#include "BKE_gpencil.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_idcode.h"
+#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_mask.h"
@@ -825,11 +826,13 @@ void DepsgraphNodeBuilder::build_object_pointcache(Object *object)
}
/**
- * Build graph nodes for AnimData block
+ * Build graph nodes for AnimData block and any animated images used.
* \param id: ID-Block which hosts the AnimData
*/
void DepsgraphNodeBuilder::build_animdata(ID *id)
{
+ build_animation_images(id);
+
AnimData *adt = BKE_animdata_from_id(id);
if (adt == NULL) {
return;
@@ -886,6 +889,20 @@ void DepsgraphNodeBuilder::build_animdata_nlastrip_targets(ListBase *strips)
}
}
+/**
+ * Build graph nodes to update the current frame in image users.
+ */
+void DepsgraphNodeBuilder::build_animation_images(ID *id)
+{
+ if (BKE_image_user_id_has_animation(id)) {
+ ID *id_cow = get_cow_id(id);
+ add_operation_node(id,
+ NodeType::ANIMATION,
+ OperationCode::IMAGE_ANIMATION,
+ function_bind(BKE_image_user_id_eval_animation, _1, id_cow));
+ }
+}
+
void DepsgraphNodeBuilder::build_action(bAction *action)
{
if (built_map_.checkIsBuiltAndTag(action)) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 3b55131d7e2..ce3c6995fe7 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@ -187,6 +187,7 @@ struct DepsgraphNodeBuilder {
void build_particle_settings(ParticleSettings *part);
void build_animdata(ID *id);
void build_animdata_nlastrip_targets(ListBase *strips);
+ void build_animation_images(ID *id);
void build_action(bAction *action);
void build_driver(ID *id, FCurve *fcurve, int driver_index);
void build_driver_variables(ID *id, FCurve *fcurve);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 2b77f8c2587..e3b2614ca05 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -72,6 +72,7 @@ extern "C" {
#include "BKE_effect.h"
#include "BKE_collision.h"
#include "BKE_fcurve.h"
+#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_material.h"
#include "BKE_mball.h"
@@ -1199,6 +1200,8 @@ void DepsgraphRelationBuilder::build_constraints(ID *id,
void DepsgraphRelationBuilder::build_animdata(ID *id)
{
+ /* Images. */
+ build_animation_images(id);
/* Animation curves and NLA. */
build_animdata_curves(id);
/* Drivers. */
@@ -1391,6 +1394,18 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id)
}
}
+void DepsgraphRelationBuilder::build_animation_images(ID *id)
+{
+ /* TODO: can we check for existance of node for performance? */
+ if (BKE_image_user_id_has_animation(id)) {
+ OperationKey image_animation_key(id,
+ NodeType::ANIMATION,
+ OperationCode::IMAGE_ANIMATION);
+ TimeSourceKey time_src_key;
+ add_relation(time_src_key, image_animation_key, "TimeSrc -> Image Animation");
+ }
+}
+
void DepsgraphRelationBuilder::build_action(bAction *action)
{
if (built_map_.checkIsBuiltAndTag(action)) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index 7170eb29f0b..b8dee11bebd 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -238,6 +238,7 @@ struct DepsgraphRelationBuilder
OperationNode *operation_from,
ListBase *strips);
void build_animdata_drivers(ID *id);
+ void build_animation_images(ID *id);
void build_action(bAction *action);
void build_driver(ID *id, FCurve *fcurve);
void build_driver_data(ID *id, FCurve *fcurve);
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc
index a407a3ed99e..0d3ec70d22c 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc
@@ -119,6 +119,8 @@ const char *operationCodeAsString(OperationCode opcode)
case OperationCode::MOVIECLIP_EVAL: return "MOVIECLIP_EVAL";
case OperationCode::MOVIECLIP_SELECT_UPDATE:
return "MOVIECLIP_SELECT_UPDATE";
+ /* Image. */
+ case OperationCode::IMAGE_ANIMATION: return "IMAGE_ANIMATION";
/* Synchronization. */
case OperationCode::SYNCHRONIZE_TO_ORIGINAL:
return "SYNCHRONIZE_TO_ORIGINAL";
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h
index 909f535a789..da823595705 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.h
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.h
@@ -173,6 +173,9 @@ enum class OperationCode {
MOVIECLIP_EVAL,
MOVIECLIP_SELECT_UPDATE,
+ /* Images. -------------------------------------------------------------- */
+ IMAGE_ANIMATION,
+
/* Synchronization clips. ----------------------------------------------- */
SYNCHRONIZE_TO_ORIGINAL,