|
Blender V5.0
|
#include "MEM_guardedalloc.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "BLI_array_utils.hh"#include "BLI_listbase.h"#include "BLI_map.hh"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector_types.hh"#include "BLI_memarena.h"#include "BLI_multi_value_map.hh"#include "BLI_ordered_edge.hh"#include "BLI_polyfill_2d.h"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_task.hh"#include "BLI_utildefines.h"#include "BKE_attribute.hh"#include "BKE_customdata.hh"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "BKE_main_namemap.hh"#include "BKE_mesh.hh"#include "BKE_mesh_legacy_convert.hh"#include "BKE_modifier.hh"#include "BKE_multires.hh"#include "BKE_node.hh"#include "BKE_node_runtime.hh"#include "BKE_node_tree_update.hh"#include "BLT_translation.hh"Go to the source code of this file.
Classes | |
| struct | EdgeSort |
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
| #define | ML(v1, v2) |
| #define | LAYER_CMP(l_a, t_a, l_b, t_b) |
| #define | USE_TESSFACE_SPEEDUP |
| #define | USE_TESSFACE_QUADS |
| #define | TESSFACE_IS_QUAD 1 |
| #define | ML_TO_MF(i1, i2, i3) |
| #define | ML_TO_MF_QUAD() |
NGon Tessellation (NGon to MFace Conversion) | |
| #define | MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) |
| static void | bm_corners_to_loops_ex (ID *id, CustomData *fdata_legacy, const int totface, CustomData *ldata, MFace *mface, int totloop, int findex, int loopstart, int numTex, int numCol) |
| static void | CustomData_to_bmeshpoly (CustomData *fdata_legacy, CustomData *ldata, int totloop) |
| static void | convert_mfaces_to_mpolys (ID *id, CustomData *fdata_legacy, CustomData *ldata, CustomData *pdata, int totedge_i, int totface_i, int, int, blender::int2 *edges, MFace *mface, int *r_totloop, int *r_faces_num) |
| static void | update_active_fdata_layers (Mesh &mesh, CustomData *fdata_legacy, CustomData *ldata) |
| static bool | check_matching_legacy_layer_counts (CustomData *fdata_legacy, CustomData *ldata, bool fallback) |
| static void | add_mface_layers (Mesh &mesh, CustomData *fdata_legacy, CustomData *ldata, int total) |
| static void | mesh_ensure_tessellation_customdata (Mesh *mesh) |
| void | BKE_mesh_convert_mfaces_to_mpolys (Mesh *mesh) |
| static void | CustomData_bmesh_do_versions_update_active_layers (CustomData *fdata_legacy, CustomData *corner_data) |
| void | BKE_mesh_do_versions_convert_mfaces_to_mpolys (Mesh *mesh) |
MFace Tessellation | |
MFace is a legacy data-structure that should be avoided, use #Mesh::corner_tris() instead. | |
| #define | MESH_MLOOPCOL_TO_MCOL(_mloopcol, _mcol) |
| static void | mesh_loops_to_tessdata (CustomData *fdata_legacy, CustomData *corner_data, MFace *mface, const int *polyindices, uint(*loopindices)[4], const int num_faces) |
| int | BKE_mesh_mface_index_validate (MFace *mface, CustomData *fdata_legacy, int mfindex, int nr) |
| static int | mesh_tessface_calc (Mesh &mesh, CustomData *fdata_legacy, CustomData *ldata, CustomData *pdata, float(*positions)[3], int totface, int totloop, int faces_num) |
| void | BKE_mesh_tessface_calc (Mesh *mesh) |
| void | BKE_mesh_tessface_ensure (Mesh *mesh) |
Functions to convert mesh data to and from legacy formats like MFace.
Definition in file mesh_legacy_convert.cc.
| #define DNA_DEPRECATED_ALLOW |
Definition at line 11 of file mesh_legacy_convert.cc.
| #define LAYER_CMP | ( | l_a, | |
| t_a, | |||
| l_b, | |||
| t_b ) |
Referenced by check_matching_legacy_layer_counts().
| #define MESH_MLOOPCOL_FROM_MCOL | ( | _mloopcol, | |
| _mcol ) |
Definition at line 327 of file mesh_legacy_convert.cc.
Referenced by bm_corners_to_loops_ex().
| #define MESH_MLOOPCOL_TO_MCOL | ( | _mloopcol, | |
| _mcol ) |
Definition at line 823 of file mesh_legacy_convert.cc.
Referenced by mesh_loops_to_tessdata().
| #define ML | ( | v1, | |
| v2 ) |
Referenced by convert_mfaces_to_mpolys().
| #define ML_TO_MF | ( | i1, | |
| i2, | |||
| i3 ) |
Referenced by mesh_tessface_calc().
| #define ML_TO_MF_QUAD | ( | ) |
Referenced by mesh_tessface_calc().
| #define TESSFACE_IS_QUAD 1 |
Referenced by mesh_tessface_calc().
| #define USE_TESSFACE_QUADS |
| #define USE_TESSFACE_SPEEDUP |
|
static |
Definition at line 664 of file mesh_legacy_convert.cc.
References BLI_assert, CD_MCOL, CD_MTFACE, CD_NORMAL, CD_ORIGSPACE, CD_ORIGSPACE_MLOOP, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CD_SET_DEFAULT, CD_TESSLOOPNORMAL, check_matching_legacy_layer_counts(), CustomData_add_layer_named(), i, CustomData::layers, CustomDataLayer::name, CustomData::totlayer, CustomDataLayer::type, and update_active_fdata_layers().
Referenced by mesh_ensure_tessellation_customdata(), and mesh_tessface_calc().
| 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().
| void BKE_mesh_strip_loose_faces | ( | Mesh * | mesh | ) |
Definition at line 256 of file mesh_legacy_convert.cc.
References b, CustomData_copy_data(), CustomData_free_elem(), Mesh::fdata_legacy, Mesh::totface_legacy, and MFace::v3.
Referenced by BKE_mesh_calc_edges_legacy(), BKE_mesh_validate_arrays(), and blo_do_versions_pre250().
| 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().
|
static |
Definition at line 338 of file mesh_legacy_convert.cc.
References BLI_assert, CD_MCOL, CD_MDISPS, CD_MTFACE, CD_NORMAL, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CD_TESSLOOPNORMAL, copy_v2_v2(), CustomData_external_add(), CustomData_external_test(), CustomData_get_for_write(), CustomData_get_n_for_write(), CustomData_has_layer(), MDisps::disps, CustomData::external, CustomDataExternal::filepath, float, i, MDisps::level, logf, M_LN2, max, MEM_freeN(), MEM_malloc_arrayN(), MESH_MLOOPCOL_FROM_MCOL, multires_mdisp_corners(), normal_short_to_float_v3(), sqrtf, MDisps::totdisp, MTFace::uv, and MFace::v4.
Referenced by convert_mfaces_to_mpolys().
|
static |
Debug check, used to assert when we expect layers to be in/out of sync.
| fallback | Use when there are no layers to handle, since callers may expect success or failure. |
Definition at line 634 of file mesh_legacy_convert.cc.
References CD_MCOL, CD_MTFACE, CD_NORMAL, CD_ORIGSPACE, CD_ORIGSPACE_MLOOP, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CD_TESSLOOPNORMAL, LAYER_CMP, and true.
Referenced by add_mface_layers().
|
static |
Definition at line 468 of file mesh_legacy_convert.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), bm_corners_to_loops_ex(), CD_MASK_MDISPS, CD_MCOL, CD_MTFACE, CD_ORIGINDEX, CD_PROP_BOOL, CD_PROP_INT32, CD_SET_DEFAULT, CustomData_add_layer(), CustomData_add_layer_named(), CustomData_external_read(), CustomData_free(), CustomData_get_layer(), CustomData_get_layer_named_for_write(), CustomData_number_of_layers(), CustomData_to_bmeshpoly(), MFace::flag, i, MFace::mat_nr, ML, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), v2, and MFace::v4.
Referenced by BKE_mesh_convert_mfaces_to_mpolys(), and BKE_mesh_do_versions_convert_mfaces_to_mpolys().
|
static |
Update active indices for active/render/clone/stencil custom data layers based on indices from fdata_legacy layers used when creating fdata_legacy and ldata for pre-bmesh meshes and needed to preserve active/render/clone/stencil flags set in pre-bmesh files.
Definition at line 759 of file mesh_legacy_convert.cc.
References CD_MCOL, CD_MTFACE, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CustomData_get_active_layer(), CustomData_get_clone_layer(), CustomData_get_render_layer(), CustomData_get_stencil_layer(), CustomData_has_layer(), CustomData_set_layer_active(), CustomData_set_layer_clone(), CustomData_set_layer_render(), and CustomData_set_layer_stencil().
Referenced by BKE_mesh_do_versions_convert_mfaces_to_mpolys().
|
static |
Definition at line 446 of file mesh_legacy_convert.cc.
References CD_MCOL, CD_MDISPS, CD_MTFACE, CD_NORMAL, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CD_SET_DEFAULT, CD_TESSLOOPNORMAL, CustomData_add_layer_named(), i, CustomData::layers, CustomDataLayer::name, CustomData::totlayer, and CustomDataLayer::type.
Referenced by convert_mfaces_to_mpolys().
|
static |
Definition at line 102 of file mesh_legacy_convert.cc.
References BLI_assert, MFace::edcode, hash, i, EdgeSort::is_draw, ME_V1V2, ME_V2V3, ME_V3V1, ME_V3V4, ME_V4V1, MEM_calloc_arrayN(), MEM_freeN(), MEM_malloc_arrayN(), to_edgesort(), EdgeSort::v1, MFace::v1, EdgeSort::v2, MFace::v2, MFace::v3, MFace::v4, and vergedgesort().
Referenced by BKE_mesh_calc_edges_legacy().
|
static |
Definition at line 691 of file mesh_legacy_convert.cc.
References add_mface_layers(), BKE_mesh_tessface_clear(), CD_MCOL, CD_MTFACE, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, Mesh::corner_data, CustomData_number_of_layers(), Mesh::faces_num, Mesh::fdata_legacy, G, G_DEBUG, printf, Mesh::totface_legacy, and UNLIKELY.
Referenced by BKE_mesh_convert_mfaces_to_mpolys(), BKE_mesh_do_versions_convert_mfaces_to_mpolys(), and BKE_mesh_tessface_calc().
|
static |
Convert all CD layers from loop/poly to tessface data.
| loopindices | is an array of an int[4] per tessface, mapping tessface's verts to loops indices. |
Definition at line 843 of file mesh_legacy_convert.cc.
References CD_MCOL, CD_MTFACE, CD_NORMAL, CD_ORIGSPACE, CD_ORIGSPACE_MLOOP, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CD_TESSLOOPNORMAL, copy_v2_v2(), CustomData_get_layer(), CustomData_get_layer_n(), CustomData_get_layer_n_for_write(), CustomData_has_layer(), CustomData_number_of_layers(), float, i, MESH_MLOOPCOL_TO_MCOL, normal_float_to_short_v3(), MTFace::uv, OrigSpaceFace::uv, and OrigSpaceLoop::uv.
Referenced by mesh_tessface_calc().
|
static |
Definition at line 986 of file mesh_legacy_convert.cc.
References add_mface_layers(), add_newell_cross_v3_v3v3(), axis_dominant_v3_to_m3_negate(), BKE_mesh_mface_index_validate(), BLI_assert, BLI_memarena_alloc(), BLI_memarena_clear(), BLI_memarena_free(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_polyfill_calc_arena(), CD_MFACE, CD_ORIGINDEX, CD_PROP_BOOL, CD_PROP_INT32, CustomData_add_layer_with_data(), CustomData_free(), CustomData_get_layer_named(), MFace::edcode, faces, float, LIKELY, MFace::mat_nr, MEM_freeN(), MEM_malloc_arrayN(), MEM_reallocN, mesh_loops_to_tessdata(), ML_TO_MF, ML_TO_MF_QUAD, mul_v2_m3v3(), normalize_v3(), poly_to_tri_count(), size(), TESSFACE_IS_QUAD, UNLIKELY, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and zero_v3().
Referenced by BKE_mesh_tessface_calc().
|
static |
Definition at line 1330 of file mesh_legacy_convert.cc.
References MultiValueMap< Key, Value >::add(), CD_PROP_INT32, CustomData_add_layer_named_with_data(), CustomData_free_layer(), CustomDataLayer::data, data, blender::bke::Face, blender::bke::SpanAttributeWriter< T >::finish(), i, MultiValueMap< Key, Value >::items(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), ImplicitSharingInfo::remove_user_and_delete_if_last(), CustomDataLayer::sharing_info, blender::bke::SpanAttributeWriter< T >::span, and CustomDataLayer::type.
Referenced by BKE_mesh_legacy_face_map_to_generic().
|
static |
Definition at line 2002 of file mesh_legacy_convert.cc.
References blender::IndexRange::drop_back(), i, and blender::Span< T >::index_range().
Referenced by BKE_mesh_legacy_convert_polys_to_offsets().
|
static |
Definition at line 1430 of file mesh_legacy_convert.cc.
References CustomData_add_layer_named_with_data(), CustomData_free_layer(), CustomDataLayer::data, data, i, CustomData::layers, ImplicitSharingInfo::remove_user_and_delete_if_last(), CustomDataLayer::sharing_info, CustomData::totlayer, and CustomDataLayer::type.
Referenced by BKE_mesh_legacy_bevel_weight_to_generic(), and BKE_mesh_legacy_crease_to_generic().
Definition at line 65 of file mesh_legacy_convert.cc.
References EdgeSort::is_draw, EdgeSort::is_loose, EdgeSort::v1, EdgeSort::v2, and v2.
Referenced by mesh_calc_edges_mdata().
|
static |
Definition at line 584 of file mesh_legacy_convert.cc.
References Mesh::active_color_attribute, CD_MCOL, CD_MTFACE, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2, CustomData_get_active_layer(), CustomData_get_clone_layer(), CustomData_get_named_layer(), CustomData_get_render_layer(), CustomData_get_stencil_layer(), CustomData_has_layer(), CustomData_set_layer_active(), CustomData_set_layer_clone(), CustomData_set_layer_render(), CustomData_set_layer_stencil(), and Mesh::default_color_attribute.
Referenced by add_mface_layers().
|
static |
Definition at line 79 of file mesh_legacy_convert.cc.
References EdgeSort::v1, EdgeSort::v2, and v2.
Referenced by mesh_calc_edges_mdata().