diff options
Diffstat (limited to 'source/blender')
9 files changed, 51 insertions, 55 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 5ae71dd1792..6d76829fa1d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -254,9 +254,8 @@ TimeSourceNode *DepsgraphRelationBuilder::get_node(const TimeSourceKey &key) con /* XXX TODO */ return nullptr; } - else { - return graph_->time_source; - } + + return graph_->time_source; } ComponentNode *DepsgraphRelationBuilder::get_node(const ComponentKey &key) const @@ -353,16 +352,16 @@ Relation *DepsgraphRelationBuilder::add_time_relation(TimeSourceNode *timesrc, if (timesrc && node_to) { return graph_->add_new_relation(timesrc, node_to, description, flags); } - else { - DEG_DEBUG_PRINTF((::Depsgraph *)graph_, - BUILD, - "add_time_relation(%p = %s, %p = %s, %s) Failed\n", - timesrc, - (timesrc) ? timesrc->identifier().c_str() : "<None>", - node_to, - (node_to) ? node_to->identifier().c_str() : "<None>", - description); - } + + DEG_DEBUG_PRINTF((::Depsgraph *)graph_, + BUILD, + "add_time_relation(%p = %s, %p = %s, %s) Failed\n", + timesrc, + (timesrc) ? timesrc->identifier().c_str() : "<None>", + node_to, + (node_to) ? node_to->identifier().c_str() : "<None>", + description); + return nullptr; } @@ -374,16 +373,16 @@ Relation *DepsgraphRelationBuilder::add_operation_relation(OperationNode *node_f if (node_from && node_to) { return graph_->add_new_relation(node_from, node_to, description, flags); } - else { - DEG_DEBUG_PRINTF((::Depsgraph *)graph_, - BUILD, - "add_operation_relation(%p = %s, %p = %s, %s) Failed\n", - node_from, - (node_from) ? node_from->identifier().c_str() : "<None>", - node_to, - (node_to) ? node_to->identifier().c_str() : "<None>", - description); - } + + DEG_DEBUG_PRINTF((::Depsgraph *)graph_, + BUILD, + "add_operation_relation(%p = %s, %p = %s, %s) Failed\n", + node_from, + (node_from) ? node_from->identifier().c_str() : "<None>", + node_to, + (node_to) ? node_to->identifier().c_str() : "<None>", + description); + return nullptr; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index e3b667427a2..ec18b429c2e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -190,7 +190,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, reinterpret_cast<const PropertyRNA *>(prop)); return node_identifier; } - else if (ptr->type == &RNA_PoseBone) { + if (ptr->type == &RNA_PoseBone) { const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr->data); /* Bone - generally, we just want the bone component. */ node_identifier.type = NodeType::BONE; @@ -222,7 +222,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } return node_identifier; } - else if (ptr->type == &RNA_Bone) { + if (ptr->type == &RNA_Bone) { /* Armature-level bone mapped to Armature Eval, and thus Pose Init. * Drivers have special code elsewhere that links them to the pose * bone components, instead of using this generic code. */ @@ -236,7 +236,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } return node_identifier; } - else if (RNA_struct_is_a(ptr->type, &RNA_Constraint)) { + if (RNA_struct_is_a(ptr->type, &RNA_Constraint)) { const Object *object = reinterpret_cast<const Object *>(ptr->owner_id); const bConstraint *constraint = static_cast<const bConstraint *>(ptr->data); RNANodeQueryIDData *id_data = ensure_id_data(&object->id); @@ -256,7 +256,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } return node_identifier; } - else if (ELEM(ptr->type, &RNA_ConstraintTarget, &RNA_ConstraintTargetBone)) { + if (ELEM(ptr->type, &RNA_ConstraintTarget, &RNA_ConstraintTargetBone)) { Object *object = reinterpret_cast<Object *>(ptr->owner_id); bConstraintTarget *tgt = (bConstraintTarget *)ptr->data; /* Check whether is object or bone constraint. */ @@ -315,17 +315,17 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, node_identifier.type = NodeType::TRANSFORM; return node_identifier; } - else if (contains(prop_identifier, "data")) { + if (contains(prop_identifier, "data")) { /* We access object.data, most likely a geometry. * Might be a bone tho. */ node_identifier.type = NodeType::GEOMETRY; return node_identifier; } - else if (STREQ(prop_identifier, "hide_viewport") || STREQ(prop_identifier, "hide_render")) { + if (STREQ(prop_identifier, "hide_viewport") || STREQ(prop_identifier, "hide_render")) { node_identifier.type = NodeType::OBJECT_FROM_LAYER; return node_identifier; } - else if (STREQ(prop_identifier, "dimensions")) { + if (STREQ(prop_identifier, "dimensions")) { node_identifier.type = NodeType::PARAMETERS; node_identifier.operation_code = OperationCode::DIMENSIONS; return node_identifier; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc index bd6a364e08a..c5e020b3242 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc @@ -96,7 +96,7 @@ void deg_graph_transitive_reduction(Depsgraph *graph) * need modifying. */ continue; } - else if (rel->from->custom_flags & OP_REACHABLE) { + if (rel->from->custom_flags & OP_REACHABLE) { relations_to_remove.append(rel); } } diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc index 814f467e3d5..048c0125f53 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc @@ -282,15 +282,14 @@ void DEG_iterator_objects_next(BLI_Iterator *iter) if (deg_objects_dupli_iterator_next(iter)) { return; } - else { - verify_id_properties_freed(data); - free_object_duplilist(data->dupli_list); - data->dupli_parent = nullptr; - data->dupli_list = nullptr; - data->dupli_object_next = nullptr; - data->dupli_object_current = nullptr; - deg_invalidate_iterator_work_data(data); - } + + verify_id_properties_freed(data); + free_object_duplilist(data->dupli_list); + data->dupli_parent = nullptr; + data->dupli_list = nullptr; + data->dupli_object_next = nullptr; + data->dupli_object_current = nullptr; + deg_invalidate_iterator_work_data(data); } ++data->id_node_index; @@ -324,7 +323,7 @@ static void DEG_iterator_ids_step(BLI_Iterator *iter, deg::IDNode *id_node, bool iter->skip = true; return; } - else if (only_updated && !(id_cow->recalc & ID_RECALC_ALL)) { + if (only_updated && !(id_cow->recalc & ID_RECALC_ALL)) { bNodeTree *ntree = ntreeFromID(id_cow); /* Nodetree is considered part of the datablock. */ diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 7c201de66f2..4a2d47f9379 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -372,7 +372,7 @@ void graph_id_tag_update_single_flag(Main *bmain, } return; } - else if (tag == ID_RECALC_TIME) { + if (tag == ID_RECALC_TIME) { if (graph != nullptr) { graph->need_update_time = true; } diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index 6ca30a67f1f..1ede2cf914a 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -353,9 +353,8 @@ static TaskPool *deg_evaluate_task_pool_create(DepsgraphEvalState *state) if (G.debug & G_DEBUG_DEPSGRAPH_NO_THREADS) { return BLI_task_pool_create_no_threads(state); } - else { - return BLI_task_pool_create_suspended(state, TASK_PRIORITY_HIGH); - } + + return BLI_task_pool_create_suspended(state, TASK_PRIORITY_HIGH); } /** diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 89df41944e5..d76f5991dac 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -348,7 +348,7 @@ ViewLayer *get_original_view_layer(const Depsgraph *depsgraph, const IDNode *id_ if (id_node->linked_state == DEG_ID_LINKED_DIRECTLY) { return depsgraph->view_layer; } - else if (id_node->linked_state == DEG_ID_LINKED_VIA_SET) { + if (id_node->linked_state == DEG_ID_LINKED_VIA_SET) { Scene *scene_orig = reinterpret_cast<Scene *>(id_node->id_orig); return BKE_view_layer_default_render(scene_orig); } @@ -382,7 +382,7 @@ void scene_remove_unused_view_layers(const Depsgraph *depsgraph, } return; } - else if (id_node->linked_state == DEG_ID_LINKED_INDIRECTLY) { + if (id_node->linked_state == DEG_ID_LINKED_INDIRECTLY) { /* Indirectly linked scenes means it's not an input scene and not a set scene, and is pulled * via some driver. Such scenes should not have view layers after copy. */ view_layer_input = nullptr; diff --git a/source/blender/depsgraph/intern/node/deg_node.cc b/source/blender/depsgraph/intern/node/deg_node.cc index 9e386f13888..b10e66336dc 100644 --- a/source/blender/depsgraph/intern/node/deg_node.cc +++ b/source/blender/depsgraph/intern/node/deg_node.cc @@ -317,12 +317,11 @@ NodeClass Node::get_class() const if (type == NodeType::OPERATION) { return NodeClass::OPERATION; } - else if (type < NodeType::PARAMETERS) { + if (type < NodeType::PARAMETERS) { return NodeClass::GENERIC; } - else { - return NodeClass::COMPONENT; - } + + return NodeClass::COMPONENT; } /******************************************************************************* diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc index cd82b7be050..2767513d6df 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.cc +++ b/source/blender/depsgraph/intern/node/deg_node_component.cc @@ -251,7 +251,7 @@ OperationNode *ComponentNode::get_entry_operation() if (entry_operation) { return entry_operation; } - else if (operations_map != nullptr && operations_map->size() == 1) { + if (operations_map != nullptr && operations_map->size() == 1) { OperationNode *op_node = nullptr; /* TODO(sergey): This is somewhat slow. */ for (OperationNode *tmp : operations_map->values()) { @@ -261,7 +261,7 @@ OperationNode *ComponentNode::get_entry_operation() entry_operation = op_node; return op_node; } - else if (operations.size() == 1) { + if (operations.size() == 1) { return operations[0]; } return nullptr; @@ -272,7 +272,7 @@ OperationNode *ComponentNode::get_exit_operation() if (exit_operation) { return exit_operation; } - else if (operations_map != nullptr && operations_map->size() == 1) { + if (operations_map != nullptr && operations_map->size() == 1) { OperationNode *op_node = nullptr; /* TODO(sergey): This is somewhat slow. */ for (OperationNode *tmp : operations_map->values()) { @@ -282,7 +282,7 @@ OperationNode *ComponentNode::get_exit_operation() exit_operation = op_node; return op_node; } - else if (operations.size() == 1) { + if (operations.size() == 1) { return operations[0]; } return nullptr; |