Blender Git Loki

Git Commits -> Revision 827869a

Revision 827869a by Ankit Meel (soc-2020-io-performance)
June 27, 2020, 13:06 (GMT)
Add support for exporting Material Library file

**Why not reuse the `write_mtl` in `export_obj.py` ?**
Because there are no benefits except saving some time now, only to later
waste it in debugging or extending it.
Having it in C++ provides easy extensibility when we need to
add more nodes' support without having to modify node_utils.py, which
itself is a hardcoded wrapper for BSDF and normal map shader nodes.

Quick Summary:
If export_params->export_materials is true, we create an empty MTL file
with the same name (not extension, of course) in the same directory.
`frame_writer` writes its name (with extension) to the OBJ file, to
reference it, as per format specs.

MTLWriter class is added in the new files. It uses NodeTreeRef committed
recently in rBe1cc9aa7f281 for a faster way to find two linked sockets.

`frame_writer` instantiates an MTLWriter for an object which then
*appends* that object's material to the previously created MTL file.

Commit Details:

Full Hash: 827869a45bccbf1e016580b53426d70f065a4fe8
Parent Commit: 6c98925
Lines Changed: +442, -0

2 Added Paths:

/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc (+269, -0) (View)
/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.hh (+88, -0) (View)

8 Modified Paths:

/source/blender/editors/io/io_obj.c (+10, -0) (Diff)
/source/blender/io/wavefront_obj/CMakeLists.txt (+2, -0) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc (+12, -0) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.cc (+10, -0) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.hh (+11, -0) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.cc (+31, -0) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.hh (+8, -0) (Diff)
/source/blender/io/wavefront_obj/IO_wavefront_obj.h (+1, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021