Blender V5.0
blender::bke::SpanAttributeWriter< T > Struct Template Reference

#include <BKE_attribute.hh>

Public Member Functions

 SpanAttributeWriter ()=default
 SpanAttributeWriter (AttributeWriter< T > &&other, const bool copy_values_to_span)
 operator bool () const
void finish ()

Public Attributes

MutableVArraySpan< Tspan
AttrDomain domain
std::function< void()> tag_modified_fn

Detailed Description

template<typename T>
struct blender::bke::SpanAttributeWriter< T >

A version of AttributeWriter for the common case when the user of the attribute wants to write to a span instead of a virtual array. Since most attributes are spans internally, this can result in better performance and also simplifies code.

Definition at line 285 of file BKE_attribute.hh.

Constructor & Destructor Documentation

◆ SpanAttributeWriter() [1/2]

template<typename T>
blender::bke::SpanAttributeWriter< T >::SpanAttributeWriter ( )
default

◆ SpanAttributeWriter() [2/2]

template<typename T>
blender::bke::SpanAttributeWriter< T >::SpanAttributeWriter ( AttributeWriter< T > && other,
const bool copy_values_to_span )
inline

Definition at line 301 of file BKE_attribute.hh.

References domain, span, and tag_modified_fn.

Member Function Documentation

◆ finish()

template<typename T>
void blender::bke::SpanAttributeWriter< T >::finish ( )
inline

Has to be called when done writing to the attribute. This makes sure that the data is copied to the underlying attribute if it was not stored as an array. Furthermore, this may invalidate other data depending on the modified attribute.

Definition at line 318 of file BKE_attribute.hh.

References blender::MutableVArraySpan< T >::save(), tag_modified_fn, and blender::MutableVArraySpan< T >::varray().

Referenced by blender::ed::curves::pen_tool::add_single_point_and_curve(), blender::ed::greasepencil::apply_eval_grease_pencil_data(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), BKE_grease_pencil_material_index_remove(), BKE_grease_pencil_material_remap(), BKE_mesh_material_remap(), BKE_pbvh_sync_visibility_from_verts(), BM_mesh_bm_to_me_compact(), blender::ed::greasepencil::boundary_to_curves(), blender::build_concurrent(), blender::build_sequential(), blender::geometry::calc_radius_with_interpolation(), blender::geometry::calculate_cone_uvs(), blender::geometry::calculate_selection_outputs(), blender::geometry::calculate_sphere_uvs(), blender::geometry::calculate_uvs(), blender::ed::greasepencil::clipboard_paste_strokes_ex(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::io::ply::convert_ply_to_mesh(), blender::ed::object::convert_psys_to_mesh(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_edges(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_faces(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_point(), blender::create_array_copies(), blender::nodes::node_geo_string_to_curves_cc::create_attributes(), blender::ed::curves::create_Bezier(), blender::create_dashes(), blender::ed::greasepencil::create_drawing_data(), blender::nodes::node_geo_duplicate_elements_cc::create_duplicate_index_attribute(), blender::create_envelope_strokes(), blender::ed::transform::create_mesh(), blender::ed::curves::create_NURBS(), blender::nodes::node_geo_curve_primitive_star_cc::create_selection_output(), blender::bke::tests::GreasePencilInterpolate::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::ed::transform::curves::createTransCurvesVerts(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::curve_legacy_to_curves(), blender::bke::curve_to_mesh_sweep(), blender::ed::curves::curves_draw_exec(), data_transfer_dtdata_type_postprocess(), do_lasso_select_paintvert(), do_paintvert_box_select(), blender::ed::curves::duplicate_curves(), blender::ed::pointcloud::duplicate_exec(), blender::ed::curves::duplicate_points(), dynamicPaint_Modifier_apply(), edbm_backbuf_check_and_select_faces_obmode(), edbm_backbuf_check_and_select_verts_obmode(), blender::ed::curves::cyclic_toggle::exec(), blender::geometry::execute_realize_grease_pencil_task(), blender::ed::sculpt_paint::face_set::face_hide_update(), blender::ed::sculpt_paint::expand::face_sets_restore(), blender::ed::sculpt_paint::expand::face_sets_update(), blender::ed::sculpt_paint::face_set::face_sets_update(), blender::ed::sculpt_paint::hide::flush_edge_changes(), blender::ed::sculpt_paint::hide::flush_face_changes(), blender::ed::sculpt_paint::hide::flush_face_changes_node(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::greasepencil::grease_pencil_primitive_init_curves(), blender::ed::greasepencil::grease_pencil_primitive_update_curves(), blender::ed::greasepencil::grease_pencil_reset_uvs_exec(), blender::ed::greasepencil::grease_pencil_stroke_material_set_exec(), blender::ed::sculpt_paint::hide::grow_shrink_visibility_mesh(), blender::io::fbx::import_colors(), blender::io::fbx::import_edges(), blender::io::fbx::import_face_material_indices(), blender::io::fbx::import_face_smoothing(), blender::io::fbx::import_uvs(), blender::ed::sculpt_paint::face_set::init_flood_fill(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::ed::sculpt_paint::face_set::initialize_none_to_id(), blender::ed::sculpt_paint::hide::invert_visibility_mesh(), blender::ed::mesh::join_face_sets(), blender::ed::mesh::join_materials(), blender::ed::mesh::join_normals(), blender::bke::greasepencil::convert::legacy_gpencil_to_grease_pencil(), mesh_add_edges(), mesh_add_faces(), mesh_add_verts(), blender::bke::mesh_calc_edges(), blender::ed::object::mesh_data_to_grease_pencil(), blender::bke::mesh_hide_vert_flush(), mesh_merge_transform(), mesh_nurbs_displist_to_mesh(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_face_flush(), blender::bke::mesh_select_vert_flush(), blender::bke::mesh::mesh_set_custom_normals(), blender::bke::mesh_sharp_edges_set_from_angle(), MOD_lineart_gpencil_generate_v3(), MOD_solidify_extrude_modifyMesh(), MOD_solidify_nonmanifold_modifyMesh(), blender::modify_fill_color(), modify_mesh(), modify_mesh(), modify_mesh(), modify_mesh(), blender::modify_opacity(), blender::modify_softness(), blender::modify_stroke_by_index(), blender::modify_stroke_by_layer(), blender::modify_stroke_by_material(), blender::modify_stroke_color(), blender::modify_stroke_random(), move_face_map_data_to_attributes(), multires_unsubdivide_add_original_index_datalayers(), blender::nodes::node_geo_boolean_cc::node_geo_exec(), blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec(), blender::nodes::node_geo_set_mesh_normal_cc::node_geo_exec(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), normalEditModifier_do(), object_duplilist_legacy_instances(), blender::ed::object::object_pointcloud_add_exec(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), paint_vertsel_circle_select(), paintface_hide(), paintface_select_linked(), paintface_select_loop(), paintvert_hide(), paintvert_select_less(), paintvert_select_linked(), paintvert_select_more(), blender::nodes::node_geo_distribute_points_on_faces_cc::point_distribution_calculate(), blender::ed::curves::primitive_random_sphere(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_start_sample(), blender::io::usd::USDNurbsReader::read_curve_sample(), blender::io::alembic::read_edge_creases(), blender::io::usd::read_face_display_color(), blender::io::alembic::AbcPointsReader::read_geometry(), blender::io::usd::USDPointInstancerReader::read_geometry(), blender::io::alembic::AbcMeshReader::read_mesh(), blender::io::alembic::read_typed_property_sample(), blender::io::usd::USDCurvesReader::read_velocities(), blender::io::usd::USDPointsReader::read_velocities(), blender::io::alembic::read_vertex_creases(), reset_uv_map(), blender::ed::sculpt_paint::expand::restore_face_set_data(), blender::ed::sculpt_paint::undo::restore_face_sets(), blender::ed::sculpt_paint::undo::restore_hidden_face(), blender::ed::sculpt_paint::undo::restore_vert_visibility_mesh(), blender::nodes::node_geo_extrude_mesh_cc::save_selection_as_attribute(), blender::ed::sculpt_paint::select_grow::select_grow_update(), blender::ed::sculpt_paint::select_random::select_random_exec(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::io::grease_pencil::shape_attributes_to_curves(), blender::ed::greasepencil::GreasePencilPenToolOperation::single_point_attributes(), blender::geometry::transform_pointcloud(), blender::geometry::translate_pointcloud(), blender::ed::transform::curves::update_vector_handle_types(), uvprojectModifier_do(), blender::ed::sculpt_paint::hide::vert_hide_update(), blender::write_stroke_transforms(), and blender::write_weights_for_drawing().

◆ operator bool()

template<typename T>
blender::bke::SpanAttributeWriter< T >::operator bool ( ) const
inline

Definition at line 308 of file BKE_attribute.hh.

References span.

Member Data Documentation

◆ domain

◆ span

A span based on the virtual array that contains the attribute data. This may be empty.

Definition at line 289 of file BKE_attribute.hh.

Referenced by blender::ed::curves::pen_tool::add_single_point_and_curve(), blender::ed::greasepencil::apply_eval_grease_pencil_data(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), BKE_grease_pencil_material_index_remove(), BKE_grease_pencil_material_remap(), BKE_mesh_material_remap(), BKE_pbvh_sync_visibility_from_verts(), BM_mesh_bm_to_me_compact(), blender::ed::greasepencil::boundary_to_curves(), blender::build_concurrent(), blender::build_sequential(), blender::geometry::calc_radius_with_interpolation(), blender::geometry::calculate_cone_uvs(), blender::geometry::calculate_selection_outputs(), blender::geometry::calculate_sphere_uvs(), blender::geometry::calculate_uvs(), blender::geometry::calculate_uvs(), blender::ed::greasepencil::clipboard_paste_strokes_ex(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::io::ply::convert_ply_to_mesh(), blender::ed::object::convert_psys_to_mesh(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_edges(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_faces(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_point(), blender::create_array_copies(), blender::nodes::node_geo_string_to_curves_cc::create_attributes(), blender::ed::curves::create_Bezier(), blender::create_dashes(), blender::ed::greasepencil::create_drawing_data(), blender::nodes::node_geo_duplicate_elements_cc::create_duplicate_index_attribute(), blender::create_envelope_strokes(), blender::ed::transform::create_mesh(), blender::ed::curves::create_NURBS(), blender::nodes::node_geo_curve_primitive_star_cc::create_selection_output(), blender::bke::tests::GreasePencilInterpolate::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::ed::transform::curves::createTransCurvesVerts(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::curve_legacy_to_curves(), blender::bke::curve_to_mesh_sweep(), blender::ed::curves::curves_draw_exec(), data_transfer_dtdata_type_postprocess(), do_lasso_select_paintvert(), do_paintvert_box_select(), blender::ed::curves::duplicate_curves(), blender::ed::pointcloud::duplicate_exec(), blender::ed::curves::duplicate_points(), dynamicPaint_Modifier_apply(), edbm_backbuf_check_and_select_faces_obmode(), edbm_backbuf_check_and_select_verts_obmode(), blender::ed::curves::cyclic_toggle::exec(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::execute(), blender::geometry::execute_realize_grease_pencil_task(), blender::ed::sculpt_paint::face_set::face_hide_update(), blender::ed::sculpt_paint::expand::face_sets_restore(), blender::ed::sculpt_paint::expand::face_sets_update(), blender::ed::sculpt_paint::face_set::face_sets_update(), blender::ed::sculpt_paint::hide::flush_edge_changes(), blender::ed::sculpt_paint::hide::flush_face_changes(), blender::ed::sculpt_paint::hide::flush_face_changes_node(), blender::generate_curves(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::ed::greasepencil::grease_pencil_primitive_init_curves(), blender::ed::greasepencil::grease_pencil_primitive_update_curves(), blender::ed::greasepencil::grease_pencil_reset_uvs_exec(), blender::ed::greasepencil::grease_pencil_stroke_material_set_exec(), blender::ed::sculpt_paint::hide::grow_shrink_visibility_mesh(), blender::io::fbx::import_colors(), blender::io::fbx::import_edges(), blender::io::fbx::import_face_material_indices(), blender::io::fbx::import_face_smoothing(), blender::io::fbx::import_uvs(), blender::ed::sculpt_paint::face_set::init_flood_fill(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::ed::sculpt_paint::face_set::initialize_none_to_id(), blender::ed::sculpt_paint::hide::invert_visibility_mesh(), blender::ed::mesh::join_face_sets(), blender::ed::mesh::join_materials(), blender::ed::mesh::join_normals(), blender::bke::greasepencil::convert::legacy_gpencil_frame_to_grease_pencil_drawing(), blender::bke::greasepencil::convert::legacy_gpencil_to_grease_pencil(), mesh_add_edges(), mesh_add_faces(), mesh_add_verts(), blender::bke::mesh_calc_edges(), blender::ed::object::mesh_data_to_grease_pencil(), blender::bke::mesh_hide_vert_flush(), mesh_merge_transform(), mesh_nurbs_displist_to_mesh(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_face_flush(), blender::bke::mesh_select_vert_flush(), blender::bke::mesh::mesh_set_custom_normals(), blender::bke::mesh_sharp_edges_set_from_angle(), MOD_lineart_gpencil_generate_v3(), MOD_solidify_extrude_modifyMesh(), MOD_solidify_nonmanifold_modifyMesh(), blender::modify_fill_color(), modify_mesh(), modify_mesh(), modify_mesh(), modify_mesh(), blender::modify_opacity(), blender::modify_softness(), blender::modify_stroke_by_index(), blender::modify_stroke_by_layer(), blender::modify_stroke_by_material(), blender::modify_stroke_color(), blender::modify_stroke_random(), move_face_map_data_to_attributes(), multires_unsubdivide_add_original_index_datalayers(), blender::nodes::node_geo_boolean_cc::node_geo_exec(), blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec(), blender::nodes::node_geo_set_mesh_normal_cc::node_geo_exec(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), normalEditModifier_do(), object_duplilist_legacy_instances(), blender::ed::object::object_pointcloud_add_exec(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), operator bool(), paint_vertsel_circle_select(), paintface_hide(), paintface_select_less(), paintface_select_linked(), paintface_select_loop(), paintface_select_more(), paintvert_hide(), paintvert_select_less(), paintvert_select_linked(), paintvert_select_more(), blender::nodes::node_geo_distribute_points_on_faces_cc::point_distribution_calculate(), blender::ed::curves::primitive_random_sphere(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_start_sample(), blender::io::usd::USDNurbsReader::read_curve_sample(), blender::io::alembic::read_edge_creases(), blender::io::usd::read_face_display_color(), blender::io::alembic::AbcPointsReader::read_geometry(), blender::io::usd::USDPointInstancerReader::read_geometry(), blender::io::alembic::AbcMeshReader::read_mesh(), blender::io::alembic::read_typed_property_sample(), blender::io::usd::USDCurvesReader::read_velocities(), blender::io::usd::USDPointsReader::read_velocities(), blender::io::alembic::read_vertex_creases(), reset_uv_map(), blender::ed::sculpt_paint::expand::restore_face_set_data(), blender::ed::sculpt_paint::undo::restore_face_sets(), blender::ed::sculpt_paint::undo::restore_hidden_face(), blender::ed::sculpt_paint::undo::restore_vert_visibility_mesh(), blender::nodes::node_geo_extrude_mesh_cc::save_selection_as_attribute(), blender::ed::sculpt_paint::select_grow::select_grow_update(), blender::ed::sculpt_paint::select_random::select_random_exec(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::io::grease_pencil::shape_attributes_to_curves(), blender::ed::greasepencil::GreasePencilPenToolOperation::single_point_attributes(), SpanAttributeWriter(), blender::geometry::transform_pointcloud(), blender::geometry::translate_pointcloud(), blender::ed::transform::curves::update_vector_handle_types(), uvprojectModifier_do(), blender::ed::sculpt_paint::hide::vert_hide_update(), blender::bke::write_sharp_bezier_edges(), blender::write_stroke_transforms(), and blender::write_weights_for_drawing().

◆ tag_modified_fn

template<typename T>
std::function<void()> blender::bke::SpanAttributeWriter< T >::tag_modified_fn

Has to be called after writing to the span.

Definition at line 297 of file BKE_attribute.hh.

Referenced by finish(), and SpanAttributeWriter().


The documentation for this struct was generated from the following file: