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

Rendering a model Tutorial - Meshconverter FAILED with an unspecified error #288

Closed
MasterDrake opened this issue Oct 27, 2021 · 9 comments
Labels

Comments

@MasterDrake
Copy link

Hi, I was reading the tutorial about how to load an render a model with this TK using the provided files and I run into this problem.
No matter what file I've tried or how many times I tried, it always fails at loading the .obj file with an unhelpful error (80004005)

image

According to the source code, it fails at the LoadFromOBJ function, where the WaveFrontReader doesn't read the vertices/indices:
(
if (wfReader.indices.empty() || wfReader.vertices.empty())
return E_FAIL;
)

But how and why?
What am I doing wrong?
I've tried with other .obj files as well with no luck...

Thanks for you time and sorry to bother you!

@walbourn
Copy link
Member

walbourn commented Oct 27, 2021

Using notepad, what does your cup._obj file contain?

It should be the contents here.

@MasterDrake
Copy link
Author

Retried multiple times but with no luck
I really don't know what's going on...

test.zip

I tried with these files, maybe you'll have a better luck
If it works, then something's wrong in my end
Otherwise I'm clueless

Thank you for your immediate response!

@walbourn
Copy link
Member

The data files work fine at least on my machine and the EXE is right...

There must be some kind of localization issue.

Can you build the meshconvert.exe from the source projects in the GitHub repo and run under the debugger with those command-line arguments?

@MasterDrake
Copy link
Author

I've already tried before this issue and I retried now, with no luck
image

You said that it works fine in your machine, I've tried with the same zip in a mini laptop I have with the same error.

@walbourn
Copy link
Member

Thank you for your help in debugging this issue.

Please step into the WaveFrontReader::Load method and see what kind of characters it's hitting as it processes through the file. I'm using wide-characters so I don't understand why it's locale sensitive, but I may be having unintended side-effects from the call to std::locale::global(std::locale("")); in MeshConvert.cpp.

@walbourn walbourn added bug and removed question labels Oct 28, 2021
@walbourn
Copy link
Member

It's a locale issue with WaveFrontReader.h. PR coming shortly.

Thanks so much for your help in debugging this!

@MasterDrake
Copy link
Author

MasterDrake commented Oct 28, 2021

Yes, you're right and amazing!
I commented out that line and now it works.
Bravo!!

Thanks for your help and time.

@walbourn
Copy link
Member

Fixed meshconvert in this microsoft/DirectXMesh@66451d1

Updating the rest of my command-line tools which set locale for localized error message strings.

@walbourn
Copy link
Member

Fixed in the November 2021 release

https://github.com/microsoft/DirectXMesh/releases/tag/nov2021

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

No branches or pull requests

2 participants