diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/spline_bezier.cc | 16 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 15 |
2 files changed, 20 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/spline_bezier.cc b/source/blender/blenkernel/intern/spline_bezier.cc index 28db3da65d0..0cadab998f5 100644 --- a/source/blender/blenkernel/intern/spline_bezier.cc +++ b/source/blender/blenkernel/intern/spline_bezier.cc @@ -598,7 +598,10 @@ Span<float> BezierSpline::evaluated_mappings() const Span<int> offsets = this->control_point_offsets(); - calculate_mappings_linear_resolution(offsets, size, resolution_, is_cyclic_, mappings); + blender::threading::isolate_task([&]() { + /* Isolate the task, since this is function is multi-threaded and holds a lock. */ + calculate_mappings_linear_resolution(offsets, size, resolution_, is_cyclic_, mappings); + }); mapping_cache_dirty_ = false; return mappings; @@ -634,10 +637,13 @@ Span<float3> BezierSpline::evaluated_positions() const Span<int> offsets = this->control_point_offsets(); const int grain_size = std::max(512 / resolution_, 1); - blender::threading::parallel_for(IndexRange(size - 1), grain_size, [&](IndexRange range) { - for (const int i : range) { - this->evaluate_segment(i, i + 1, positions.slice(offsets[i], offsets[i + 1] - offsets[i])); - } + blender::threading::isolate_task([&]() { + /* Isolate the task, since this is function is multi-threaded and holds a lock. */ + blender::threading::parallel_for(IndexRange(size - 1), grain_size, [&](IndexRange range) { + for (const int i : range) { + this->evaluate_segment(i, i + 1, positions.slice(offsets[i], offsets[i + 1] - offsets[i])); + } + }); }); if (is_cyclic_) { this->evaluate_segment( diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 70f6020f5a9..c1cdfa43920 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -1031,11 +1031,9 @@ static void check_property_socket_sync(const Object *ob, ModifierData *md) int i; LISTBASE_FOREACH_INDEX (const bNodeSocket *, socket, &nmd->node_group->inputs, i) { /* The first socket is the special geometry socket for the modifier object. */ - if (i == 0) { - if (socket->type == SOCK_GEOMETRY) { - continue; - } - BKE_modifier_set_error(ob, md, "The first node group input must be a geometry"); + if (i == 0 && socket->type == SOCK_GEOMETRY) { + geometry_socket_count++; + continue; } IDProperty *property = IDP_GetPropertyFromGroup(nmd->settings.properties, socket->identifier); @@ -1056,7 +1054,12 @@ static void check_property_socket_sync(const Object *ob, ModifierData *md) } } - if (geometry_socket_count > 1) { + if (geometry_socket_count == 1) { + if (((bNodeSocket *)nmd->node_group->inputs.first)->type != SOCK_GEOMETRY) { + BKE_modifier_set_error(ob, md, "Node group's geometry input must be the first"); + } + } + else if (geometry_socket_count > 1) { BKE_modifier_set_error(ob, md, "Node group can only have one geometry input"); } } |