|
Blender V5.0
|
Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| void BKE_main_mesh_legacy_convert_auto_smooth | ( | Main & | bmain | ) |
Definition at line 2300 of file mesh_legacy_convert.cc.
References blender::bke::add_auto_smooth_node_tree(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), angle(), BLI_addtail(), BLI_insertlinkbefore(), CD_PROP_INT16_2D, blender::bke::create_auto_smooth_modifier(), CustomData_has_layer(), CustomData_has_layer_named(), ELEM, eModifierType_Bevel, eModifierType_Nodes, eModifierType_NormalEdit, eModifierType_Subsurf, eModifierType_WeightedNormal, eSubsurfModifierFlag_UseCustomNormals, WeightedNormalModifierData::flag, BevelModifierData::flags, SubsurfModifierData::flags, bNodeTree::id, id_us_min(), blender::bke::is_auto_smooth_node_tree(), LISTBASE_FOREACH, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), ME_AUTOSMOOTH_LEGACY, Main::meshes, MOD_BEVEL_HARDEN_NORMALS, MOD_WEIGHTEDNORMAL_KEEP_SHARP, NodesModifierData::node_group, Main::nodetrees, OB_MESH, Main::objects, and ModifierData::type.
Referenced by do_versions_after_setup().
| void BKE_mesh_calc_edges_legacy | ( | Mesh * | mesh | ) |
Definition at line 220 of file mesh_legacy_convert.cc.
References BKE_mesh_strip_loose_faces(), BLI_assert, Mesh::corner_data, Mesh::corners_num, CustomData_add_layer_with_data(), CustomData_get_layer(), CustomData_get_layer_for_write(), Mesh::edge_data, Mesh::edges_num, Mesh::face_data, Mesh::faces_num, mesh_calc_edges_mdata(), Mesh::totface_legacy, Mesh::vert_data, verts, and Mesh::verts_num.
Referenced by blo_do_versions_pre250().
| void BKE_mesh_calc_edges_tessface | ( | Mesh * | mesh | ) |
Calculate/create edges from tessface data
Definition at line 2666 of file mesh_legacy_convert.cc.
References blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span(), CD_CONSTRUCT, CD_MFACE, CD_ORIGINDEX, CD_PROP_INT32_2D, CD_SET_DEFAULT, blender::MutableSpan< T >::copy_from(), CustomData_add_layer(), CustomData_add_layer_named(), CustomData_free(), CustomData_get_layer_for_write(), CustomData_get_layer_named_for_write(), CustomData_reset(), i, ORIGINDEX_NONE, blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges(), and explodeMesh().
| void BKE_mesh_convert_mfaces_to_mpolys | ( | Mesh * | mesh | ) |
Definition at line 733 of file mesh_legacy_convert.cc.
References BKE_mesh_legacy_convert_loops_to_corners(), BKE_mesh_legacy_convert_polys_to_offsets(), CD_MFACE, convert_mfaces_to_mpolys(), Mesh::corner_data, Mesh::corners_num, CustomData_get_layer(), Mesh::edges_num, Mesh::face_data, Mesh::faces_num, Mesh::fdata_legacy, Mesh::id, mesh_ensure_tessellation_customdata(), and Mesh::totface_legacy.
Referenced by cutEdges(), and explodeMesh().
| void BKE_mesh_do_versions_cd_flag_init | ( | Mesh * | mesh | ) |
Definition at line 284 of file mesh_legacy_convert.cc.
References CustomData_get_layer(), Mesh::edge_data, Mesh::edges_num, UNLIKELY, Mesh::vert_data, verts, and Mesh::verts_num.
Referenced by blo_do_versions_260().
| void BKE_mesh_do_versions_convert_mfaces_to_mpolys | ( | Mesh * | mesh | ) |
The same as BKE_mesh_convert_mfaces_to_mpolys but oriented to be used in do_versions from readfile.cc the difference is how active/render/clone/stencil indices are handled here.
normally they're being set from pdata which totally makes sense for meshes which are already converted to BMesh structures, but when loading older files indices shall be updated in other way around, so newly added pdata and ldata would have this indices set based on pdata layer.
this is normally only needed when reading older files, in all other cases BKE_mesh_convert_mfaces_to_mpolys shall be always used.
Definition at line 793 of file mesh_legacy_convert.cc.
References BKE_mesh_legacy_convert_loops_to_corners(), BKE_mesh_legacy_convert_polys_to_offsets(), CD_MFACE, convert_mfaces_to_mpolys(), Mesh::corner_data, Mesh::corners_num, CustomData_bmesh_do_versions_update_active_layers(), CustomData_get_layer(), Mesh::edges_num, Mesh::face_data, Mesh::faces_num, Mesh::fdata_legacy, Mesh::id, mesh_ensure_tessellation_customdata(), and Mesh::totface_legacy.
Referenced by do_versions_after_linking_280().
| void BKE_mesh_legacy_attribute_flags_to_strings | ( | Mesh * | mesh | ) |
Definition at line 1897 of file mesh_legacy_convert.cc.
References BLI_strdup(), CD_PROP_BYTE_COLOR, CD_PROP_COLOR, CustomData_get_active_layer_index(), CustomData_get_render_layer_index(), data, and i.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_bevel_weight_to_generic | ( | Mesh * | mesh | ) |
Move bevel weight to generic float attribute type.
Definition at line 1459 of file mesh_legacy_convert.cc.
References CD_PROP_FLOAT, and replace_custom_data_layer_with_named().
Referenced by blo_do_versions_400().
| void BKE_mesh_legacy_bevel_weight_to_layers | ( | Mesh * | mesh | ) |
Copy bevel weights from vertices and edges to separate layers.
Definition at line 1404 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CustomData_add_layer(), CustomData_has_layer(), i, blender::Span< T >::index_range(), blender::Span< T >::size(), and verts.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_edges_to_generic | ( | Mesh * | mesh | ) |
Definition at line 1866 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CD_PROP_INT32_2D, CustomData_add_layer_named(), CustomData_get_layer(), CustomData_has_layer_named(), blender::Span< T >::index_range(), and blender::threading::parallel_for().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_flags_to_hide_layers | ( | Mesh * | mesh | ) |
Convert the old hide flags (#ME_HIDE) to the hidden element attribute for reading. Only add the attributes when there are any elements in each domain hidden.
Definition at line 1580 of file mesh_legacy_convert.cc.
References blender::bke::AttributeAccessor::contains(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::threading::parallel_for(), blender::bke::Point, and verts.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_flags_to_selection_layers | ( | Mesh * | mesh | ) |
Convert the old selection flags (SELECT/#ME_FACE_SEL) to the selected element attribute for reading. Only add the attributes when there are any elements in each domain selected.
Definition at line 1769 of file mesh_legacy_convert.cc.
References blender::bke::AttributeAccessor::contains(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::threading::parallel_for(), blender::bke::Point, and verts.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_loops_to_corners | ( | Mesh * | mesh | ) |
Definition at line 1967 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CD_PROP_INT32, CustomData_add_layer_named(), CustomData_get_layer(), CustomData_has_layer_named(), blender::Span< T >::index_range(), and blender::threading::parallel_for().
Referenced by BKE_mesh_convert_mfaces_to_mpolys(), BKE_mesh_do_versions_convert_mfaces_to_mpolys(), blo_do_versions_290(), and version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_mpoly_to_material_indices | ( | Mesh * | mesh | ) |
Move material indices from the #MPoly to a generic attributes. Only add the attribute when the indices are not all zero.
Definition at line 1646 of file mesh_legacy_convert.cc.
References blender::Span< T >::begin(), blender::bke::AttributeAccessor::contains(), CustomData_get_layer(), CustomData_has_layer(), blender::Span< T >::end(), blender::bke::Face, blender::Span< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), and blender::threading::parallel_for().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_polys_to_offsets | ( | Mesh * | mesh | ) |
Definition at line 2012 of file mesh_legacy_convert.cc.
References b, Array< T, InlineBufferCapacity, Allocator >::begin(), BKE_mesh_face_offsets_ensure_alloc(), CD_CONSTRUCT, CD_MASK_MESH, CustomData_free(), CustomData_get_layer(), CustomData_init_layout_from(), CustomData_reset(), Array< T, InlineBufferCapacity, Allocator >::end(), blender::array_utils::fill_index_range(), i, Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::Span< T >::index_range(), blender::threading::parallel_for(), poly_loops_orders_match(), and blender::Span< T >::size().
Referenced by BKE_mesh_convert_mfaces_to_mpolys(), BKE_mesh_do_versions_convert_mfaces_to_mpolys(), blo_do_versions_290(), cutEdges(), explodeMesh(), and version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_uvs_to_generic | ( | Mesh * | mesh | ) |
Definition at line 1677 of file mesh_legacy_convert.cc.
References Array< T, InlineBufferCapacity, Allocator >::as_span(), b, CustomData_get_active_layer_name(), CustomData_get_layer_name(), CustomData_get_layer_named(), CustomData_get_render_layer_name(), CustomData_has_layer(), CustomData_number_of_layers(), i, if(), Array< T, InlineBufferCapacity, Allocator >::index_range(), init(), MEM_malloc_arrayN(), blender::threading::parallel_for(), and blender::threading::parallel_reduce().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_verts_to_positions | ( | Mesh * | mesh | ) |
Definition at line 1835 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CD_PROP_FLOAT3, CustomData_add_layer_named(), CustomData_get_layer(), CustomData_has_layer_named(), blender::threading::parallel_for(), and verts.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_crease_to_generic | ( | Mesh * | mesh | ) |
Definition at line 1496 of file mesh_legacy_convert.cc.
References CD_PROP_FLOAT, and replace_custom_data_layer_with_named().
Referenced by version_mesh_crease_generic().
| void BKE_mesh_legacy_edge_crease_to_layers | ( | Mesh * | mesh | ) |
Copy edge creases from edges to a separate layer.
Definition at line 1477 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CustomData_add_layer(), CustomData_has_layer(), i, blender::Span< T >::index_range(), and blender::Span< T >::size().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_face_map_to_generic | ( | Main * | bmain | ) |
Definition at line 1379 of file mesh_legacy_convert.cc.
References BLI_freelistN(), i, LISTBASE_FOREACH, LISTBASE_FOREACH_INDEX, Main::meshes, move_face_map_data_to_attributes(), OB_MESH, and Main::objects.
Referenced by do_versions_after_linking_400().
| void BKE_mesh_legacy_face_set_to_generic | ( | Mesh * | mesh | ) |
Copy face sets to the generic data type from the legacy type.
Definition at line 1292 of file mesh_legacy_convert.cc.
References CD_PROP_INT32, CustomData_add_layer_named_with_data(), CustomData_free_layer(), CustomDataLayer::data, i, ImplicitSharingInfo::remove_user_and_delete_if_last(), CustomDataLayer::sharing_info, and CustomDataLayer::type.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_sharp_edges_from_flags | ( | Mesh * | mesh | ) |
Definition at line 1514 of file mesh_legacy_convert.cc.
References blender::Span< T >::begin(), blender::bke::AttributeAccessor::contains(), blender::bke::Edge, blender::Span< T >::end(), blender::Span< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), and blender::threading::parallel_for().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_sharp_faces_from_flags | ( | Mesh * | mesh | ) |
Definition at line 1257 of file mesh_legacy_convert.cc.
References blender::Span< T >::begin(), blender::bke::AttributeAccessor::contains(), CustomData_get_layer(), blender::Span< T >::end(), blender::bke::Face, blender::Span< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), and blender::threading::parallel_for().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_uv_seam_from_flags | ( | Mesh * | mesh | ) |
Definition at line 1547 of file mesh_legacy_convert.cc.
References blender::MutableSpan< T >::begin(), blender::bke::AttributeAccessor::contains(), blender::bke::Edge, blender::MutableSpan< T >::end(), blender::MutableSpan< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), and blender::threading::parallel_for().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| int BKE_mesh_mface_index_validate | ( | MFace * | mface, |
| CustomData * | mfdata, | ||
| int | mfindex, | ||
| int | nr ) |
Rotates the vertices of a face in case v[2] or v[3] (vertex index) is = 0. this is necessary to make the if #MFace.v4 check for quads work.
Definition at line 916 of file mesh_legacy_convert.cc.
References CustomData_swap_corners(), MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges(), explodeMesh(), and mesh_tessface_calc().
|
inline |
Definition at line 141 of file BKE_mesh_legacy_convert.hh.
References i.
Referenced by psys_particle_dm_face_lookup().
| void BKE_mesh_tessface_calc | ( | Mesh * | mesh | ) |
Recreate MFace Tessellation.
Definition at line 1229 of file mesh_legacy_convert.cc.
References Mesh::corner_data, Mesh::corners_num, Mesh::face_data, Mesh::faces_num, Mesh::fdata_legacy, mesh_ensure_tessellation_customdata(), mesh_tessface_calc(), and Mesh::totface_legacy.
Referenced by BKE_mesh_tessface_ensure(), and blender::ed::curves::convert_to_particle_system::try_convert_single_object().
| void BKE_mesh_tessface_ensure | ( | Mesh * | mesh | ) |
Definition at line 1244 of file mesh_legacy_convert.cc.
References BKE_mesh_tessface_calc(), Mesh::faces_num, and Mesh::totface_legacy.
Referenced by deform_verts(), blender::io::alembic::ABCHairWriter::do_write(), blender::draw::interpolate_face_corner_attribute_to_curve(), modify_mesh(), blender::draw::particle_batch_cache_ensure_pos_and_seg(), particle_intersect_mesh(), particle_system_update(), PE_mirror_x(), psys_cache_paths(), psys_thread_context_init_distribute(), and remap_hair_emitter().