Repository navigation
fix(export): write the material and texture next to OBJ exports - #466
Merged
Merged
Conversation
Exporting a textured mesh to OBJ wrote the .obj alone, so the texture was lost. Like Blender, the user now picks <name>.obj and <name>.mtl and <name>_texture.png are written beside it; untextured meshes export as before. - API: GET /export/obj/files answers the OBJ export as its separate files; the Generate page saves OBJ through the main process, which writes them side by side. - Mesh Exporter node: writes the .mtl and the base color texture too, and flips V from glTF's top-left UV origin to OBJ's bottom-left one. - A hint under OBJ says textures go to separate files and GLB keeps everything in one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #445. Refs #373
Exporting a textured mesh to OBJ wrote only the
.obj, with no material and no texture. Now, like Blender, the user picks<name>.objand gets<name>.obj,<name>.mtland<name>_texture.pngside by side. The OBJ and the MTL refer to the other files by relative name.Changes
model:export: a save dialog for the.obj, then the main process writes the other files next to it.GET /export/obj/files?path=&name=returns the files as base64 and rejects names containing path separators.GET /export/{fmt}still returns plain OBJ for modly-cli.obj.tswritesmtllib/usemtl, the MTL and the base color textures. Textures keep their GLB format (png/jpg/webp), are numbered when there are several, and untextured parts get their own material.hint; the OBJ option uses it.export_scalein the API, millimetres in the node).#373
Hunyuan3D 2 mini turbo only textures when
enable_textureis on (off by default), which may explain that report. With it on, exporting to OBJ hit this bug. PLY also drops the texture; that is out of scope here.Testing
obj.test.tstests + 1 end-to-end Mesh Exporter test; lint clean;tscerrors identical todev