New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supports multiple textures in .obj file #1517
Conversation
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
Sorry that I messed up the log... Any idea how to clean this shit? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I did not check the visualization part, maybe @yxlao can have a look at that.
Is the mesh from #1484 now rendering correctly?
Reviewed 3 of 9 files at r1.
Reviewable status: 3 of 9 files reviewed, 1 unresolved discussion (waiting on @griegler, @theNded, and @yxlao)
src/Open3D/IO/FileFormat/FileOBJ.cpp, line 280 at r1 (raw file):
if (write_triangle_uvs && mesh.HasTexture()) { if (mesh.textures_.size() > 1) {
Shouldn't we also support writing multiple textures. What are the blockers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 9 files reviewed, 1 unresolved discussion (waiting on @griegler and @yxlao)
src/Open3D/IO/FileFormat/FileOBJ.cpp, line 280 at r1 (raw file):
Previously, griegler (Gernot) wrote…
Shouldn't we also support writing multiple textures. What are the blockers?
Done.
Here is an overview of what got changed by this pull request: Clones removed
==============
+ src/Open3D/Visualization/Shader/TexturePhongShader.cpp -9
+ src/Open3D/Visualization/Shader/TextureSimpleShader.cpp -2
See the complete overview on Codacy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 9 files at r1, 1 of 5 files at r2.
Reviewable status: 3 of 10 files reviewed, 1 unresolved discussion (waiting on @griegler, @syncle, and @yxlao)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 5 files at r2.
Reviewable status: 7 of 10 files reviewed, all discussions resolved (waiting on @yxlao)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 9 files at r1, 5 of 5 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
In o3d version 0.9, python bindings for using textures worked. Only one texture per mesh was accepted as the textures attribute. `import open3d as o3d o_image = o3d.io.read_image('Selection_028.png') points = np.array([ triangles = np.array([ uvs = np.array([ mesh = o3d.geometry.TriangleMesh() print(mesh.has_triangle_material_ids()) |
Enhancement of PR #1194.
This PR supports loading multiple textures for one single mesh, addressing #1484.
Major changes:
material_ids
per face inTriangleMesh
supported by tinyobjloader.Note: due to the general API design in the IO module, an
.obj
containing multipleshapes
is still not supported.This change is