alextsui05 / blender-off-addon

Import-export OFF meshes in Blender.
69 stars 29 forks source link

Implement NOFF export #9

Open nyorem opened 8 years ago

alextsui05 commented 6 years ago

Sorry for being an irresponsible maintainer. Thanks for the PR.

I want to support NOFF files, too. But at the same time, I want to be able to support NCOFF files as well, files that specify both vertex normals and vertex colors.

Right now, I'm not sure what the right way to handle this in the file format is. Do the colors come before the normals, or vice versa? I tested this with meshlab by exporting an OFF file with normals and colors. For example, with meshlabserver installed, you can run this on the sphere file in this repository:

# export an NCOFF file with meshlab
meshlabserver  -i sphere.off -o test.off -om vn vc

and it will generate vertices with the format:

# x y z r g b a nx ny nz
0.770008 -0.624122 0.136847 255 255 255 255 0.779999 -0.605356 0.158571

However, when I open this file in meshlab, I expected to see a white sphere but actually saw a red sphere:

image

So in summary, I think that the order in this PR is correct, i.e.

x y z nx ny nz r g b a

However, ideally I want to have some documentation about that somewhere.

So in summary, a to-do list to get this PR to be acceptable:

nyorem commented 6 years ago

Sorry for the late reponse. I added a commit that tries to support COFF and NCOFF files and I added a section on the README about what the ordering of the data should be (the documentation is not clear about what is the correct order). Tell me what you think. I quickly looked at the conflicts and they seem easy to fix.