Commit: 38574e37cc7dabebc1fd5dc25b0ad3f1859ce053 Author: Hans Goudey Date: Fri Sep 3 13:42:45 2021 -0500 Branches: temp-geometry-nodes-fields https://developer.blender.org/rB38574e37cc7dabebc1fd5dc25b0ad3f1859ce053
Various small cleanups =================================================================== M source/blender/blenkernel/BKE_attribute_access.hh M source/blender/blenkernel/intern/geometry_component_mesh.cc M source/blender/functions/FN_field.hh M source/blender/nodes/geometry/nodes/node_geo_point_translate.cc =================================================================== diff --git a/source/blender/blenkernel/BKE_attribute_access.hh b/source/blender/blenkernel/BKE_attribute_access.hh index 6f5567b1aa5..5e0f664c542 100644 --- a/source/blender/blenkernel/BKE_attribute_access.hh +++ b/source/blender/blenkernel/BKE_attribute_access.hh @@ -334,15 +334,14 @@ class CustomDataAttributes { void reallocate(const int size); - std::optional<blender::fn::GSpan> get_for_read( - const blender::bke::AttributeIDRef &attribute_id) const; + std::optional<blender::fn::GSpan> get_for_read(const AttributeIDRef &attribute_id) const; blender::fn::GVArrayPtr get_for_read(const AttributeIDRef &attribute_id, const CustomDataType data_type, const void *default_value) const; template<typename T> - blender::fn::GVArray_Typed<T> get_for_read(const blender::bke::AttributeIDRef &attribute_id, + blender::fn::GVArray_Typed<T> get_for_read(const AttributeIDRef &attribute_id, const T &default_value) const { const blender::fn::CPPType &cpp_type = blender::fn::CPPType::get<T>(); @@ -351,13 +350,12 @@ class CustomDataAttributes { return blender::fn::GVArray_Typed<T>(std::move(varray)); } - std::optional<blender::fn::GMutableSpan> get_for_write( - const blender::bke::AttributeIDRef &attribute_id); - bool create(const blender::bke::AttributeIDRef &attribute_id, const CustomDataType data_type); - bool create_by_move(const blender::bke::AttributeIDRef &attribute_id, + std::optional<blender::fn::GMutableSpan> get_for_write(const AttributeIDRef &attribute_id); + bool create(const AttributeIDRef &attribute_id, const CustomDataType data_type); + bool create_by_move(const AttributeIDRef &attribute_id, const CustomDataType data_type, void *buffer); - bool remove(const blender::bke::AttributeIDRef &attribute_id); + bool remove(const AttributeIDRef &attribute_id); bool foreach_attribute(const AttributeForeachCallback callback, const AttributeDomain domain) const; diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index 1fd0bc0ffdb..9a4b8f4eb92 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -829,7 +829,7 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider { if (mesh == nullptr) { return {}; } - std::string name = attribute_id.name(); + const std::string name = attribute_id.name(); const int vertex_group_index = BLI_findstringindex( &mesh->vertex_group_names, name.c_str(), offsetof(bDeformGroup, name)); if (vertex_group_index < 0) { diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh index 81c18b2dc54..612ffddc6cd 100644 --- a/source/blender/functions/FN_field.hh +++ b/source/blender/functions/FN_field.hh @@ -25,9 +25,9 @@ * and optimization might mean executing the fields differently based on some factors like the * number of elements. * - * For now, fields are very tied to the multi-function system, but in the future the #FieldFunction - * class could be extended to use different descriptions of its outputs and computation besides - * the embedded multi-function. + * For now, fields are very tied to the multi-function system, but in the future #FieldOperation + * could be extended to use different descriptions of its outputs and computation besides the + * embedded multi-function. */ #include "BLI_string_ref.hh" diff --git a/source/blender/nodes/geometry/nodes/node_geo_point_translate.cc b/source/blender/nodes/geometry/nodes/node_geo_point_translate.cc index 6adebfa0d5e..80fe90097a1 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_point_translate.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_point_translate.cc @@ -88,8 +88,8 @@ static void execute_on_component(GeometryComponent &component, MutableSpan<float3> position_span = positions.as_span(); fn::Field<float3> position_field{std::make_shared<SpanFieldInput>(position_span.as_span())}; - /* Retrieve the translation field and add an add operation field on top of that, which can be - * evaluated directly into the position virtual array so that any optimizations can be done more + /* Add an add operation field on top of the provided translation field, which can be evaluated + * directly into the position virtual array. That way, any optimizations can be done more * generally for the whole evaluation system. */ static const fn::CustomMF_SI_SI_SO<float3, float3, float3> add_fn = { "Add", [](float3 a, float3 b) { return a + b; }}; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs