|
Blender V5.3
|
#include <obj_export_file_writer.hh>
Inherits blender::blender::NonMovable, and blender::blender::NonCopyable.
<tt>.MTL</tt> writers. | |
| MTLWriter (const char *obj_filepath, bool write_file) noexcept(false) | |
| ~MTLWriter () | |
| void | write_header (const char *blen_filepath) |
| void | write_materials (const char *blen_filepath, ePathReferenceMode path_mode, const char *dest_dir, bool write_pbr) |
| StringRefNull | mtl_file_path () const |
| Vector< int > | add_materials (const OBJMesh &mesh_to_export) |
| const char * | mtlmaterial_name (int index) |
Responsible for writing a .MTL file.
Definition at line 153 of file obj_export_file_writer.hh.
| blender::io::obj::MTLWriter::MTLWriter | ( | const char * | obj_filepath, |
| bool | write_file ) |
Definition at line 586 of file obj_export_file_writer.cc.
References blender::BLI_fopen(), blender::BLI_path_extension_replace(), FILE_MAX, and blender::STRNCPY().
| blender::io::obj::MTLWriter::~MTLWriter | ( | ) |
Definition at line 605 of file obj_export_file_writer.cc.
References CLOG_ERROR, and blender::LOG.
Add the materials of the given object to MTLWriter, de-duplicating against ones that are already there. Return a Vector of indices into mtlmaterials_ that hold the MTLMaterial that corresponds to each material slot, in order, of the given Object. Indexes are returned rather than pointers to the MTLMaterials themselves because the mtlmaterials_ Vector may move around when resized.
Definition at line 771 of file obj_export_file_writer.cc.
References blender::io::obj::OBJMesh::materials, blender::io::obj::mtlmaterial_for_material(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and blender::io::obj::OBJMesh::tot_materials().
Referenced by blender::io::obj::write_mesh_objects().
| StringRefNull blender::io::obj::MTLWriter::mtl_file_path | ( | ) | const |
Definition at line 628 of file obj_export_file_writer.cc.
Referenced by blender::io::obj::write_mesh_objects().
| const char * blender::io::obj::MTLWriter::mtlmaterial_name | ( | int | index | ) |
Definition at line 794 of file obj_export_file_writer.cc.
Referenced by blender::io::obj::write_mesh_objects().
| void blender::io::obj::MTLWriter::write_header | ( | const char * | blen_filepath | ) |
Definition at line 617 of file obj_export_file_writer.cc.
References blender::BKE_blender_version_string(), and blender::BLI_path_basename().
Referenced by blender::io::obj::write_materials().
| void blender::io::obj::MTLWriter::write_materials | ( | const char * | blen_filepath, |
| ePathReferenceMode | path_mode, | ||
| const char * | dest_dir, | ||
| bool | write_pbr ) |
Write all of the material specifications to the MTL file. For consistency of output from run to run (useful for testing), the materials are sorted by name before writing.
Definition at line 732 of file obj_export_file_writer.cc.
References b, blender::BLI_path_normalize(), blender::BLI_path_slash_native(), blender::BLI_path_split_dir_part(), blender::io::obj::Count, FILE_MAX, blender::io::obj::is_non_pbr_map(), blender::io::obj::is_pbr_map(), blender::io::obj::MTLTexMap::is_valid(), blender::io::obj::MTLMaterial::name, and blender::io::path_reference_copy().
Referenced by blender::io::obj::write_materials().