|
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, Geometry::attributes, 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, ID::name, OB_MESH, Mesh::totcol, 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 blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), Geometry::attributes, b, blender::Array< T, InlineBufferCapacity, Allocator >::begin(), blender::Array< T, InlineBufferCapacity, Allocator >::end(), blender::bke::Face, blender::array_utils::fill_index_range(), blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::is_single(), blender::parallel_sort(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), and blender::Span< T >::size().
Referenced by blender::io::obj::write_mesh_objects().
Calculate vertex indices of all vertices of the face at the given index.
Definition at line 129 of file obj_export_mesh.hh.
References blender::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 Geometry::attributes, BKE_mesh_calc_smoothgroups(), blender::bke::Edge, blender::bke::Face, and blender::Span< T >::size().
Referenced by blender::io::obj::write_mesh_objects().
| 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 blender::io::obj::write_mesh_objects(), and ~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(), blender::Span< T >::is_empty(), NOT_FOUND, blender::MutableSpan< T >::size(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by 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(), and bDeformGroup::name.
Referenced by 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::Array< T, InlineBufferCapacity, Allocator >::as_span(), and blender::Array< T, InlineBufferCapacity, Allocator >::is_empty().
Referenced by blender::io::obj::OBJWriter::write_face_elements().
Definition at line 144 of file obj_export_mesh.hh.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), BLI_assert, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), and blender::offset_indices::OffsetIndices< T >::size().
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::write_mesh_objects(), and 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.
Referenced by 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.
Referenced by 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.
|
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.
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.
References blender::Array< T, InlineBufferCapacity, Allocator >::size().
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(), and blender::Span< T >::size().
Referenced by blender::io::obj::write_mesh_objects().
| 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::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(), and blender::Span< T >::size().
Referenced by blender::io::obj::write_mesh_objects().
| int blender::io::obj::OBJMesh::tot_deform_groups | ( | ) | const |
Definition at line 372 of file obj_export_mesh.cc.
References BLI_listbase_count().
Referenced by 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.
References Mesh::edges_num.
| int blender::io::obj::OBJMesh::tot_faces | ( | ) | const |
Definition at line 178 of file obj_export_mesh.cc.
References Mesh::faces_num.
Referenced by blender::io::obj::OBJWriter::write_face_elements(), and blender::io::obj::write_mesh_objects().
| int16_t blender::io::obj::OBJMesh::tot_materials | ( | ) | const |
Definition at line 193 of file obj_export_mesh.cc.
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(), and blender::io::obj::write_mesh_objects().
| int blender::io::obj::OBJMesh::tot_vertices | ( | ) | const |
Definition at line 173 of file obj_export_mesh.cc.
References Mesh::verts_num.
Referenced by blender::io::obj::write_mesh_objects(), and 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().