|
Blender V4.3
|
#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_polyfill_2d.h"#include "BLI_string.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 totloop_i, int faces_num_i, 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.
Referenced by check_matching_legacy_layer_counts().
| #define MESH_MLOOPCOL_FROM_MCOL | ( | _mloopcol, | |
| _mcol ) |
Definition at line 325 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().
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 660 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_TANGENT, CD_TESSLOOPNORMAL, check_matching_legacy_layer_counts(), CustomData_add_layer_named(), 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 2356 of file mesh_legacy_convert.cc.
References BLI_addtail(), BLI_insertlinkbefore(), CD_CUSTOMLOOPNORMAL, CustomData_has_layer(), ELEM, eModifierType_Bevel, eModifierType_Nodes, eModifierType_NormalEdit, eModifierType_Subsurf, eModifierType_WeightedNormal, eSubsurfModifierFlag_UseCustomNormals, WeightedNormalModifierData::flag, BevelModifierData::flags, SubsurfModifierData::flags, bNodeTree::id, id_us_min(), LISTBASE_FOREACH, 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 218 of file mesh_legacy_convert.cc.
References BKE_mesh_strip_loose_faces(), BLI_assert, CustomData_add_layer_with_data(), CustomData_get_layer(), CustomData_get_layer_for_write(), mesh_calc_edges_mdata(), and verts.
Referenced by blo_do_versions_pre250().
| void BKE_mesh_calc_edges_tessface | ( | Mesh * | mesh | ) |
Calculate/create edges from tessface data
Definition at line 2517 of file mesh_legacy_convert.cc.
References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::VectorSet< Key, 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(), ORIGINDEX_NONE, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::VectorSet< Key, 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(), CustomData_get_layer(), and mesh_ensure_tessellation_customdata().
Referenced by cutEdges(), and explodeMesh().
| void BKE_mesh_do_versions_cd_flag_init | ( | Mesh * | mesh | ) |
Definition at line 282 of file mesh_legacy_convert.cc.
References CustomData_get_layer(), UNLIKELY, and verts.
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(), CustomData_bmesh_do_versions_update_active_layers(), CustomData_get_layer(), and mesh_ensure_tessellation_customdata().
Referenced by do_versions_after_linking_280().
| void BKE_mesh_legacy_attribute_flags_to_strings | ( | Mesh * | mesh | ) |
Definition at line 1953 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(), and data.
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 1476 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 1421 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CustomData_add_layer(), CustomData_has_layer(), 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 1922 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CD_PROP_INT32_2D, CustomData_add_layer_named(), CustomData_get_layer(), CustomData_has_layer_named(), and blender::Span< T >::index_range().
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 1597 of file mesh_legacy_convert.cc.
References blender::bke::SpanAttributeWriter< T >::finish(), 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 1825 of file mesh_legacy_convert.cc.
References blender::bke::SpanAttributeWriter< T >::finish(), 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 2023 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CD_PROP_INT32, CustomData_add_layer_named(), CustomData_get_layer(), and CustomData_has_layer_named().
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 1663 of file mesh_legacy_convert.cc.
References blender::Span< T >::begin(), CustomData_get_layer(), CustomData_has_layer(), blender::Span< T >::end(), blender::bke::SpanAttributeWriter< T >::finish(), and blender::Span< T >::index_range().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_polys_to_offsets | ( | Mesh * | mesh | ) |
Definition at line 2068 of file mesh_legacy_convert.cc.
References b, blender::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(), blender::Array< T, InlineBufferCapacity, Allocator >::end(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::Span< T >::index_range(), CustomData_MeshMasks::pmask, 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 1694 of file mesh_legacy_convert.cc.
References blender::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(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), init(), MEM_malloc_arrayN, and range.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_convert_verts_to_positions | ( | Mesh * | mesh | ) |
Definition at line 1891 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CD_PROP_FLOAT3, CustomData_add_layer_named(), CustomData_get_layer(), CustomData_has_layer_named(), and verts.
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_crease_to_generic | ( | Mesh * | mesh | ) |
Definition at line 1513 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 1494 of file mesh_legacy_convert.cc.
References CD_CONSTRUCT, CustomData_add_layer(), and CustomData_has_layer().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_face_map_to_generic | ( | Main * | bmain | ) |
Definition at line 1396 of file mesh_legacy_convert.cc.
References BLI_freelistN(), 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 1309 of file mesh_legacy_convert.cc.
References CD_PROP_INT32, CustomData_add_layer_named_with_data(), CustomData_free_layer(), CustomDataLayer::data, and blender::ImplicitSharingInfo::remove_user_and_delete_if_last().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_sharp_edges_from_flags | ( | Mesh * | mesh | ) |
Definition at line 1531 of file mesh_legacy_convert.cc.
References blender::bke::SpanAttributeWriter< T >::finish().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_sharp_faces_from_flags | ( | Mesh * | mesh | ) |
Definition at line 1274 of file mesh_legacy_convert.cc.
References blender::Span< T >::begin(), CustomData_get_layer(), blender::Span< T >::end(), blender::bke::SpanAttributeWriter< T >::finish(), and blender::Span< T >::index_range().
Referenced by version_mesh_legacy_to_struct_of_array_format().
| void BKE_mesh_legacy_uv_seam_from_flags | ( | Mesh * | mesh | ) |
Definition at line 1564 of file mesh_legacy_convert.cc.
References blender::bke::SpanAttributeWriter< T >::finish().
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 932 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 254 of file mesh_legacy_convert.cc.
References b, CustomData_copy_data(), CustomData_free_elem(), 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 1246 of file mesh_legacy_convert.cc.
References mesh_ensure_tessellation_customdata(), and mesh_tessface_calc().
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 1261 of file mesh_legacy_convert.cc.
References BKE_mesh_tessface_calc().
Referenced by bc_get_mesh_copy(), deform_verts(), blender::io::alembic::ABCHairWriter::do_write(), modify_mesh(), blender::draw::particle_batch_cache_ensure_pos_and_seg(), blender::draw::particle_batch_cache_ensure_procedural_strand_data(), 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 336 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, int, 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 627 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_TANGENT, CD_TESSLOOPNORMAL, LAYER_CMP, and true.
Referenced by add_mface_layers().
|
static |
Definition at line 467 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, 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 445 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(), CustomData::layers, CustomDataLayer::name, CustomData::totlayer, and CustomDataLayer::type.
Referenced by convert_mfaces_to_mpolys().
|
static |
Definition at line 100 of file mesh_legacy_convert.cc.
References BLI_assert, MFace::edcode, hash, EdgeSort::is_draw, ME_V1V2, ME_V2V3, ME_V3V1, ME_V3V4, ME_V4V1, MEM_callocN, MEM_freeN(), MEM_mallocN, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), to_edgesort(), EdgeSort::v1, MFace::v1, EdgeSort::v2, MFace::v2, 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, CustomData_number_of_layers(), G, G_DEBUG, printf, 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_TANGENT, CD_TESSLOOPNORMAL, copy_v2_v2(), copy_v4_v4(), CustomData_get_layer(), CustomData_get_layer_n(), CustomData_get_layer_n_for_write(), CustomData_has_layer(), CustomData_number_of_layers(), float, MESH_MLOOPCOL_TO_MCOL, normal_float_to_short_v3(), MTFace::uv, OrigSpaceLoop::uv, and MFace::v4.
Referenced by mesh_tessface_calc().
|
static |
Definition at line 1002 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, 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 1347 of file mesh_legacy_convert.cc.
References blender::MultiValueMap< Key, Value >::add(), CD_PROP_INT32, CustomData_add_layer_named_with_data(), CustomData_free_layer(), blender::ImplicitSharingInfo::remove_user_and_delete_if_last(), and blender::bke::SpanAttributeWriter< T >::span.
Referenced by BKE_mesh_legacy_face_map_to_generic().
|
static |
Definition at line 2058 of file mesh_legacy_convert.cc.
References blender::IndexRange::drop_back(), and blender::Span< T >::index_range().
Referenced by BKE_mesh_legacy_convert_polys_to_offsets().
|
static |
Definition at line 1447 of file mesh_legacy_convert.cc.
References CustomData_add_layer_named_with_data(), CustomData_free_layer(), CustomDataLayer::data, CustomData::layers, blender::ImplicitSharingInfo::remove_user_and_delete_if_last(), and CustomData::totlayer.
Referenced by BKE_mesh_legacy_bevel_weight_to_generic(), and BKE_mesh_legacy_crease_to_generic().
Definition at line 63 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 583 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_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(), and CustomData_set_layer_stencil().
Referenced by add_mface_layers().
|
static |
Definition at line 77 of file mesh_legacy_convert.cc.
References EdgeSort::v1, EdgeSort::v2, and v2.
Referenced by mesh_calc_edges_mdata().