diff options
Diffstat (limited to 'source/blender/depsgraph')
5 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index a739e9cc46b..a04a33d8cfa 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -1200,7 +1200,7 @@ void DepsgraphNodeBuilder::build_particle_systems(Object *object, bool is_object /* Keyed particle targets. */ if (ELEM(part->phystype, PART_PHYS_KEYED, PART_PHYS_BOIDS)) { LISTBASE_FOREACH (ParticleTarget *, particle_target, &psys->targets) { - if (particle_target->ob == nullptr || particle_target->ob == object) { + if (ELEM(particle_target->ob, nullptr, object)) { continue; } build_object(-1, particle_target->ob, DEG_ID_LINKED_INDIRECTLY, is_object_visible); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index af281c3f0cf..40b856b1896 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -743,7 +743,7 @@ void DepsgraphRelationBuilder::build_object_proxy_from(Object *object) void DepsgraphRelationBuilder::build_object_proxy_group(Object *object) { - if (object->proxy_group == nullptr || object->proxy_group == object->proxy) { + if (ELEM(object->proxy_group, nullptr, object->proxy)) { return; } /* Object is local here (local in .blend file, users interacts with it). */ @@ -1854,7 +1854,7 @@ void DepsgraphRelationBuilder::build_particle_systems(Object *object) /* Keyed particle targets. */ if (ELEM(part->phystype, PART_PHYS_KEYED, PART_PHYS_BOIDS)) { LISTBASE_FOREACH (ParticleTarget *, particle_target, &psys->targets) { - if (particle_target->ob == nullptr || particle_target->ob == object) { + if (ELEM(particle_target->ob, nullptr, object)) { continue; } /* Make sure target object is pulled into the graph. */ @@ -2814,8 +2814,7 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDNode *id_node) * to preserve that cache in copy-on-write, but for the time being * we allow flush to layer collections component which will ensure * that cached array of bases exists and is up-to-date. */ - if (comp_node->type == NodeType::PARAMETERS || - comp_node->type == NodeType::LAYER_COLLECTIONS) { + if (ELEM(comp_node->type, NodeType::PARAMETERS, NodeType::LAYER_COLLECTIONS)) { rel_flag &= ~RELATION_FLAG_NO_FLUSH; } /* All entry operations of each component should wait for a proper diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 868f88d8fcd..8055e65595b 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -308,7 +308,7 @@ void depsgraph_tag_component(Depsgraph *graph, void deg_graph_id_tag_legacy_compat( Main *bmain, Depsgraph *depsgraph, ID *id, IDRecalcFlag tag, eUpdateSource update_source) { - if (tag == ID_RECALC_GEOMETRY || tag == 0) { + if (ELEM(tag, ID_RECALC_GEOMETRY, 0)) { switch (GS(id->name)) { case ID_OB: { Object *object = (Object *)id; diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 5ccdcbec858..73e35b4c77a 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -145,8 +145,7 @@ inline void flush_handle_component_node(IDNode *id_node, * special component where we don't want all operations to be tagged. * * TODO(sergey): Make this a more generic solution. */ - if (comp_node->type != NodeType::PARTICLE_SETTINGS && - comp_node->type != NodeType::PARTICLE_SYSTEM) { + if (!ELEM(comp_node->type, NodeType::PARTICLE_SETTINGS, NodeType::PARTICLE_SYSTEM)) { for (OperationNode *op : comp_node->operations) { op->flag |= DEPSOP_FLAG_NEEDS_UPDATE; } diff --git a/source/blender/depsgraph/intern/node/deg_node_id.cc b/source/blender/depsgraph/intern/node/deg_node_id.cc index 8d19949adc8..53269544afa 100644 --- a/source/blender/depsgraph/intern/node/deg_node_id.cc +++ b/source/blender/depsgraph/intern/node/deg_node_id.cc @@ -137,7 +137,7 @@ void IDNode::destroy() } /* Free memory used by this CoW ID. */ - if (id_cow != id_orig && id_cow != nullptr) { + if (!ELEM(id_cow, id_orig, nullptr)) { deg_free_copy_on_write_datablock(id_cow); MEM_freeN(id_cow); id_cow = nullptr; |