facebookincubator / FBX2glTF

A command-line tool for the conversion of 3D model assets on the FBX file format to the glTF file format.
Other
2.1k stars 332 forks source link

I converted a model and turned on Draco compression and read the model incorrectly in UV #157

Closed gameatp closed 5 years ago

gameatp commented 5 years ago

image 21003.zip

zellski commented 5 years ago

Hi @gameatp are you able to provide the FBX?

gameatp commented 5 years ago

Hi @gameatp are you able to provide the FBX?

21003.zip I found that maybe Google's Draco compressed data might have problems.

gameatp commented 5 years ago

Hi @gameatp are you able to provide the FBX?

21003.zip I found that maybe Google's Draco compressed data might have problems.

I found a problem with Draco compression, and I changed the code to work properly.

The second parameter of AddAttribute needs to fill in false and then pass

zellski commented 5 years ago

Hey –– I don't think the solution is quite this simple, but it's interesting that the mapping (which is controlled by that parameter) might be broken. I'd still like to look into this, so I'm going to reopen the issue.

gameatp commented 5 years ago

Hey –– I don't think the solution is quite this simple, but it's interesting that the mapping (which is controlled by that parameter) might be broken. I'd still like to look into this, so I'm going to reopen the issue.

Oh, yes, we need to change a few places.

First: image Then: image Last: image

zellski commented 5 years ago

Hi @gameatp; I was able to take a look at this. I do not think the changes you're proposing are necessary. We have a very simple vertex<->attribute mapping in glTF, and I believe the identity_mapping argument to AddAttribute() should be true, the way I have it.

BUT, I think I fixed the actual underlying problem in https://github.com/facebookincubator/FBX2glTF/commit/e83d495fdc423809e4bbe164f74dedc49e0c53e0, which yields this result: image

Would you give it a try yourself, and validate my result?

gameatp commented 5 years ago

Hi @gameatp; I was able to take a look at this. I do not think the changes you're proposing are necessary. We have a very simple vertex<->attribute mapping in glTF, and I believe the identity_mapping argument to AddAttribute() should be true, the way I have it.

BUT, I think I fixed the actual underlying problem in e83d495, which yields this result: image

Would you give it a try yourself, and validate my result?

I just tried this. It's OK. You're right. Your method is better. Thank you.