diff options
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 9 |
1 files changed, 8 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 16eacc735d4..f8562e16746 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -1121,7 +1121,14 @@ void DepsgraphNodeBuilder::build_animdata_nlastrip_targets(ListBase *strips) void DepsgraphNodeBuilder::build_animation_images(ID *id) { - if (BKE_image_user_id_has_animation(id)) { + /* GPU materials might use an animated image. However, these materials have no been built yet. We + * could scan the entire node tree recursively to check if any texture node has a video. That is + * quite expensive. For now just always add this operation node, because it is very fast. */ + /* TODO: Add a more precise check when it is cheaper to iterate over all image nodes in a node + * tree. */ + const bool can_have_gpu_material = ELEM(GS(id->name), ID_MA, ID_WO); + + if (BKE_image_user_id_has_animation(id) || can_have_gpu_material) { ID *id_cow = get_cow_id(id); add_operation_node( id, |