Skip to content
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

Bug report on importing mesh. #734

Open
sparse-mvs-2 opened this issue Jul 5, 2023 · 5 comments
Open

Bug report on importing mesh. #734

sparse-mvs-2 opened this issue Jul 5, 2023 · 5 comments

Comments

@sparse-mvs-2
Copy link

I'm trying to bring in a mesh into kaolin, but I've discovered an issue with the kaolin.io.obj.import_mesh function. Specifically, import_mesh doesn't currently support OBJ files that include color information. If the OBJ file includes x, y, z, r, g, b values, the vertices in kaolin will contain RGB values.

@Caenorst
Copy link
Collaborator

Caenorst commented Jul 5, 2023

Hi @sparse-mvs-2 , thank you for your interest in Kaolin. I quickly searched online and couldn’t find anything about per-vertex color in obj file format. Are those obj from a dataset?

@sparse-mvs-2
Copy link
Author

Yes. I use my own obj data.

@Caenorst
Copy link
Collaborator

Caenorst commented Jul 5, 2023

Did you use a specific tool to generate those obj? this doesn’t seem to be part of the file format

@sparse-mvs-2
Copy link
Author

Usually it looks like this:

3dScannerApp.com

mtllib textured_output.mtl
usemtl material_0
v -0.076 0.029 0.105
v -0.075 0.029 0.106
v -0.075 0.029 0.105
v -0.079 0.032 0.111.

But sometimes we can save the vertex color in each vertex (meshlab for example), then it looks like this:

mtllib test.mtl
usemtl test
v -56.695043 -8.185406 60.642260 0.082353 0.070588 0.039216
v -56.715019 -8.233994 60.633708 0.054902 0.047059 0.027451
v -56.706481 -8.231190 60.617203 0.121569 0.098039 0.054902
v -56.709433 -8.236841 60.670990 0.054902 0.047059 0.027451
v -56.716883 -8.263700 60.642537 0.066667 0.058824 0.031373
v -56.771020 -8.515039 60.600675 0.149020 0.117647 0.066667
v -56.795522 -8.522240 60.615212 0.086275 0.074510 0.043137
v -56.726744 -8.326732 60.678377 0.066667 0.058824 0.035294
v -56.724959 -8.364430 60.640271 0.070588 0.058824 0.035294.

The first three are the coordinate and the last three are rbg values.

@Caenorst
Copy link
Collaborator

I think that's an interesting property to support, to be noted that this is not part of .obj standard. I'll have a look to add support if that's important for the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants