Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/eval/deg_eval_flush.cc
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| #include "intern/node/deg_node_component.h" | #include "intern/node/deg_node_component.h" | ||||
| #include "intern/node/deg_node_factory.h" | #include "intern/node/deg_node_factory.h" | ||||
| #include "intern/node/deg_node_id.h" | #include "intern/node/deg_node_id.h" | ||||
| #include "intern/node/deg_node_operation.h" | #include "intern/node/deg_node_operation.h" | ||||
| #include "intern/node/deg_node_time.h" | #include "intern/node/deg_node_time.h" | ||||
| #include "intern/eval/deg_eval_copy_on_write.h" | #include "intern/eval/deg_eval_copy_on_write.h" | ||||
| // Invalidate data-block data when update is flushed on it. | /* Invalidate data-block data when update is flushed on it. | ||||
| // | * | ||||
| // The idea of this is to help catching cases when area is accessing data which | * The idea of this is to help catching cases when area is accessing data which | ||||
| // is not yet evaluated, which could happen due to missing relations. The issue | * is not yet evaluated, which could happen due to missing relations. The issue | ||||
| // is that usually that data will be kept from previous frame, and it looks to | * is that usually that data will be kept from previous frame, and it looks to | ||||
| // be plausible. | * be plausible. | ||||
| // | * | ||||
| // This ensures that data does not look plausible, making it much easier to | * This ensures that data does not look plausible, making it much easier to | ||||
| // catch usage of invalid state. | * catch usage of invalid state. */ | ||||
| #undef INVALIDATE_ON_FLUSH | #undef INVALIDATE_ON_FLUSH | ||||
| namespace blender::deg { | namespace blender::deg { | ||||
| enum { | enum { | ||||
| ID_STATE_NONE = 0, | ID_STATE_NONE = 0, | ||||
| ID_STATE_MODIFIED = 1, | ID_STATE_MODIFIED = 1, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | inline void flush_handle_component_node(IDNode *id_node, | ||||
| if (comp_node->custom_flags == COMPONENT_STATE_DONE) { | if (comp_node->custom_flags == COMPONENT_STATE_DONE) { | ||||
| return; | return; | ||||
| } | } | ||||
| comp_node->custom_flags = COMPONENT_STATE_DONE; | comp_node->custom_flags = COMPONENT_STATE_DONE; | ||||
| /* Tag all required operations in component for update, unless this is a | /* Tag all required operations in component for update, unless this is a | ||||
| * special component where we don't want all operations to be tagged. | * special component where we don't want all operations to be tagged. | ||||
| * | * | ||||
| * TODO(sergey): Make this a more generic solution. */ | * TODO(sergey): Make this a more generic solution. */ | ||||
| if (!ELEM(comp_node->type, | if (!ELEM(comp_node->type, NodeType::PARTICLE_SETTINGS, NodeType::PARTICLE_SYSTEM)) { | ||||
| NodeType::PARTICLE_SETTINGS, | |||||
| NodeType::PARTICLE_SYSTEM, | |||||
| NodeType::BATCH_CACHE)) { | |||||
| for (OperationNode *op : comp_node->operations) { | for (OperationNode *op : comp_node->operations) { | ||||
| op->flag |= DEPSOP_FLAG_NEEDS_UPDATE; | op->flag |= DEPSOP_FLAG_NEEDS_UPDATE; | ||||
| } | } | ||||
| } | } | ||||
| /* when some target changes bone, we might need to re-run the | /* when some target changes bone, we might need to re-run the | ||||
| * whole IK solver, otherwise result might be unpredictable. */ | * whole IK solver, otherwise result might be unpredictable. */ | ||||
| if (comp_node->type == NodeType::BONE) { | if (comp_node->type == NodeType::BONE) { | ||||
| ComponentNode *pose_comp = id_node->find_component(NodeType::EVAL_POSE); | ComponentNode *pose_comp = id_node->find_component(NodeType::EVAL_POSE); | ||||
| ▲ Show 20 Lines • Show All 257 Lines • Show Last 20 Lines | |||||