Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
| Show First 20 Lines • Show All 1,072 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (NlaStrip *, strip, strips) { | ||||
| else if (strip->strips.first != nullptr) { | else if (strip->strips.first != nullptr) { | ||||
| build_animdata_nlastrip_targets(&strip->strips); | build_animdata_nlastrip_targets(&strip->strips); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphNodeBuilder::build_animation_images(ID *id) | void DepsgraphNodeBuilder::build_animation_images(ID *id) | ||||
| { | { | ||||
| /* GPU materials might use an animated image. However, these materials have no been built yet. We | /* GPU materials might use an animated image. However, these materials have no been built yet so | ||||
| * could scan the entire node tree recursively to check if any texture node has a video. That is | * we have to check if they might be created during evaluation. */ | ||||
| * quite expensive. For now just always add this operation node, because it is very fast. */ | bool has_image_animation = false; | ||||
| /* TODO: Add a more precise check when it is cheaper to iterate over all image nodes in a node | if (ELEM(GS(id->name), ID_MA, ID_WO)) { | ||||
| * tree. */ | bNodeTree *ntree = *BKE_ntree_ptr_from_id(id); | ||||
| const bool can_have_gpu_material = ELEM(GS(id->name), ID_MA, ID_WO); | if (ntree != nullptr && ntree->runtime_flag & NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION) { | ||||
| has_image_animation = true; | |||||
| } | |||||
| } | |||||
| if (can_have_gpu_material || BKE_image_user_id_has_animation(id)) { | if (has_image_animation || BKE_image_user_id_has_animation(id)) { | ||||
| ID *id_cow = get_cow_id(id); | ID *id_cow = get_cow_id(id); | ||||
| add_operation_node( | add_operation_node( | ||||
| id, | id, | ||||
| NodeType::IMAGE_ANIMATION, | NodeType::IMAGE_ANIMATION, | ||||
| OperationCode::IMAGE_ANIMATION, | OperationCode::IMAGE_ANIMATION, | ||||
| [id_cow](::Depsgraph *depsgraph) { BKE_image_user_id_eval_animation(depsgraph, id_cow); }); | [id_cow](::Depsgraph *depsgraph) { BKE_image_user_id_eval_animation(depsgraph, id_cow); }); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,013 Lines • Show Last 20 Lines | |||||