|
Blender V4.3
|
#include <obj_export_mesh.hh>
Inherits blender::NonCopyable.
Public Attributes | |
| Array< const Material * > | materials |
Definition at line 31 of file obj_export_mesh.hh.
| blender::io::obj::OBJMesh::OBJMesh | ( | Depsgraph * | depsgraph, |
| const OBJExportParams & | export_params, | ||
| Object * | mesh_object ) |
Store evaluated Object and Mesh pointers. Conditionally triangulate a mesh, or create a new Mesh from a Curve.
Definition at line 40 of file obj_export_mesh.cc.
References OBJExportParams::apply_modifiers, BKE_mesh_new_from_object(), BKE_object_get_evaluated_mesh(), BKE_object_get_pre_modified_mesh(), BKE_object_material_get_eval(), DEG_get_evaluated_object(), depsgraph, OBJExportParams::export_triangulated_mesh, blender::bke::Face, OBJExportParams::forward_axis, OBJExportParams::global_scale, Object::id, materials, ID::name, OB_MESH, Object::type, and OBJExportParams::up_axis.
| blender::io::obj::OBJMesh::~OBJMesh | ( | ) |
Free new meshes allocated for triangulated meshes, or Curve converted to Mesh.
Definition at line 81 of file obj_export_mesh.cc.
References clear().
| void blender::io::obj::OBJMesh::calc_face_order | ( | ) |
Calculate the order in which the faces should be written into the file (sorted by material index).
Definition at line 220 of file obj_export_mesh.cc.
References b, blender::bke::Face, blender::array_utils::fill_index_range(), blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::is_single(), blender::bke::AttributeAccessor::lookup_or_default(), blender::parallel_sort(), and blender::Span< T >::size().
Calculate vertex indices of all vertices of the face at the given index.
Definition at line 129 of file obj_export_mesh.hh.
References Span< T >::slice().
Referenced by blender::io::obj::OBJWriter::write_face_elements().
| void blender::io::obj::OBJMesh::calc_smooth_groups | ( | bool | use_bitflags | ) |
Calculate smooth groups of a smooth-shaded object.
Definition at line 206 of file obj_export_mesh.cc.
References BKE_mesh_calc_smoothgroups(), blender::bke::Edge, blender::bke::Face, and blender::bke::AttributeAccessor::lookup().
| void blender::io::obj::OBJMesh::clear | ( | ) |
Definition at line 100 of file obj_export_mesh.cc.
References BKE_id_free(), and MEM_freeN().
Referenced by ~OBJMesh().
| int16_t blender::io::obj::OBJMesh::get_face_deform_group_index | ( | int | face_index, |
| MutableSpan< float > | group_weights ) const |
Find the most representative vertex group of a face.
This adds up vertex group weights, and the group with the largest weight sum across the face is the one returned.
group_weights is temporary storage to avoid reallocations, it must be the size of amount of vertex groups in the object.
Definition at line 377 of file obj_export_mesh.cc.
References blender::MutableSpan< T >::begin(), BLI_assert, BLI_listbase_count(), MDeformWeight::def_nr, MDeformVert::dw, blender::MutableSpan< T >::end(), blender::MutableSpan< T >::fill(), get_face_deform_group_index(), blender::Span< T >::is_empty(), blender::io::obj::NOT_FOUND, blender::MutableSpan< T >::size(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by get_face_deform_group_index(), and blender::io::obj::OBJWriter::write_face_elements().
| const char * blender::io::obj::OBJMesh::get_face_deform_group_name | ( | int16_t | def_group_index | ) | const |
Find the name of the vertex deform group at the given index. The index indices into the #Object.defbase.
Definition at line 409 of file obj_export_mesh.cc.
References BLI_findlink(), get_face_deform_group_name(), and bDeformGroup::name.
Referenced by get_face_deform_group_name(), and blender::io::obj::OBJWriter::write_face_elements().
Calculate a face's face/corner normal indices.
| face_index | Index of the face to calculate indices for. |
Definition at line 168 of file obj_export_mesh.hh.
References blender::IndexRange::slice().
Referenced by blender::io::obj::OBJWriter::write_face_elements().
Definition at line 144 of file obj_export_mesh.hh.
References BLI_assert.
Referenced by blender::io::obj::OBJWriter::write_face_elements().
|
inline |
Definition at line 209 of file obj_export_mesh.hh.
Referenced by blender::io::obj::OBJWriter::write_edges_indices(), blender::io::obj::OBJWriter::write_face_elements(), and blender::io::obj::OBJWriter::write_vertex_coords().
Definition at line 159 of file obj_export_mesh.hh.
Referenced by blender::io::obj::OBJWriter::write_normals().
| StringRef blender::io::obj::OBJMesh::get_object_mesh_name | ( | ) | const |
Definition at line 253 of file obj_export_mesh.cc.
References get_object_mesh_name().
Referenced by get_object_mesh_name(), and blender::io::obj::OBJWriter::write_object_name().
| StringRef blender::io::obj::OBJMesh::get_object_name | ( | ) | const |
Get object name as it appears in the outliner.
Definition at line 248 of file obj_export_mesh.cc.
References get_object_name().
Referenced by get_object_name(), blender::io::obj::OBJWriter::write_face_elements(), and blender::io::obj::OBJWriter::write_object_name().
Definition at line 140 of file obj_export_mesh.hh.
Referenced by blender::io::obj::OBJWriter::write_uv_coords().
|
inline |
Definition at line 121 of file obj_export_mesh.hh.
Referenced by blender::io::obj::OBJWriter::write_vertex_coords().
| bool blender::io::obj::OBJMesh::is_ith_face_smooth | ( | int | face_index | ) | const |
Definition at line 243 of file obj_export_mesh.cc.
References is_ith_face_smooth().
Referenced by blender::io::obj::get_smooth_group(), and is_ith_face_smooth().
|
inline |
Definition at line 91 of file obj_export_mesh.hh.
Referenced by blender::io::obj::OBJWriter::write_face_elements().
Definition at line 198 of file obj_export_mesh.cc.
References BLI_assert, and blender::io::obj::NEGATIVE_INIT.
Referenced by blender::io::obj::get_smooth_group().
Remap face index according to face writing order. When materials are not being written, the face order array might be empty, in which case remap is a no-op.
Definition at line 204 of file obj_export_mesh.hh.
Referenced by blender::io::obj::OBJWriter::write_face_elements().
| void blender::io::obj::OBJMesh::store_normal_coords_and_indices | ( | ) |
Find the unique normals of the mesh and stores them in a member variable. Also stores the indices into that vector with for each corner.
Definition at line 309 of file obj_export_mesh.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span(), blender::bke::Corner, blender::bke::LooseGeomCache::count, blender::bke::Face, blender::array_utils::gather(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of_or_add(), blender::Span< T >::index_range(), blender::bke::LooseGeomCache::is_loose_bits, blender::math::normalize(), blender::bke::Point, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::io::obj::round_float3_to_n_digits(), blender::Span< T >::size(), store_normal_coords_and_indices(), and transform().
Referenced by store_normal_coords_and_indices().
| void blender::io::obj::OBJMesh::store_uv_coords_and_indices | ( | ) |
Calculate UV vertex coordinates of an Object. Stores the coordinates and UV vertex indices in the member variables.
Definition at line 258 of file obj_export_mesh.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), CD_PROP_FLOAT2, blender::bke::Corner, CustomData_get_active_layer_name(), int, blender::Span< T >::is_empty(), blender::StringRefBase::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), blender::Span< T >::size(), and store_uv_coords_and_indices().
Referenced by store_uv_coords_and_indices().
| int blender::io::obj::OBJMesh::tot_deform_groups | ( | ) | const |
Definition at line 372 of file obj_export_mesh.cc.
References BLI_listbase_count(), and tot_deform_groups().
Referenced by tot_deform_groups(), and blender::io::obj::OBJWriter::write_face_elements().
| int blender::io::obj::OBJMesh::tot_edges | ( | ) | const |
Definition at line 188 of file obj_export_mesh.cc.
| int blender::io::obj::OBJMesh::tot_faces | ( | ) | const |
Definition at line 178 of file obj_export_mesh.cc.
Referenced by blender::io::obj::OBJWriter::write_face_elements().
| int16_t blender::io::obj::OBJMesh::tot_materials | ( | ) | const |
Definition at line 193 of file obj_export_mesh.cc.
References materials.
Referenced by blender::io::obj::MTLWriter::add_materials(), and blender::io::obj::OBJWriter::write_face_elements().
| int blender::io::obj::OBJMesh::tot_uv_vertices | ( | ) | const |
Definition at line 183 of file obj_export_mesh.cc.
References int.
Referenced by blender::io::obj::OBJWriter::write_face_elements().
| int blender::io::obj::OBJMesh::tot_vertices | ( | ) | const |
Definition at line 173 of file obj_export_mesh.cc.
Referenced by blender::io::obj::OBJWriter::write_vertex_coords().
Definition at line 74 of file obj_export_mesh.hh.
Referenced by blender::io::obj::MTLWriter::add_materials(), OBJMesh(), and tot_materials().