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: Analyze the model and obtain that UV is empty #5116

Closed
liuzhoulong opened this issue Jun 2, 2023 · 5 comments
Closed

Bug: Analyze the model and obtain that UV is empty #5116

liuzhoulong opened this issue Jun 2, 2023 · 5 comments
Labels
Bug Global flag to mark a deviation from expected behaviour

Comments

@liuzhoulong
Copy link

liuzhoulong commented Jun 2, 2023

Describe the bug
Hi. I used assimp5.0.1 to load the miku model and it was able to obtain the correct UV coordinates(mTextureCoords) and display them normally, but using assimp5.2.5 to load the miku model resulted in the display being incorrect due to the null UV coordinates(mTextureCoords) obtained.

To Reproduce
Steps to reproduce the behavior:
After loading the model, use OpenGL to display it.

Expected behavior
Miku model can display normally.

Screenshots
Using 5.0.1:
miku

Using 5.2.5:
miku5 2 5

Platform (please complete the following information):

  • OS: Windows10
  • Version: Assimp5.0.1 and Assimp5.2.5

Additional context
The model I used:
Miku.zip

@liuzhoulong liuzhoulong added the Bug Global flag to mark a deviation from expected behaviour label Jun 2, 2023
@darktjm
Copy link

darktjm commented Sep 9, 2023

Broken by: 9e46fca
This generates the following incorrect error messages for the Miku model:

FBX: length of input data unexpected for ByVertice mapping: 2733, expected 8643
FBX: length of input data unexpected for ByVertice mapping: 2733, expected 8643

Proposed fix:

--- a/code/AssetLib/FBX/FBXMeshGeometry.cpp
+++ b/code/AssetLib/FBX/FBXMeshGeometry.cpp
@@ -467,9 +467,9 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
         std::vector<int> uvIndices;
         ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
 
-        if (uvIndices.size() != vertex_count) {
+        if (uvIndices.size() != mapping_offsets.size()) {
             FBXImporter::LogError("length of input data unexpected for ByVertice mapping: ",
-                                  uvIndices.size(), ", expected ", vertex_count);
+                                  uvIndices.size(), ", expected ", mapping_offsets.size());
             return;
         }
 

Additional notes: 2 weeks until I'm locked out due to my refusal to comply with Microsoft's inane 2FA policy. Do not expect replies from me after that.

@darktjm
Copy link

darktjm commented Sep 16, 2023

No comment in over a week? Expecting me to file a pull request (not going to happen; just fix it yourself and don't bother giving credit for a trivial fix)? Nobody monitoring "old" issues becuase github wisely chose "last added" rather than "last updated" as the default sort criteria? Secret rewrite of the FBX importer in progress? Nobody interested in fixing FBX issues any more, given that it's so broken since 5.0.1 anyway (e.g. numerous anim issues since at least 14b8d12)? I'd try harder to fix them myself, but I have other priorities, and for now, I have other ways of dealing with FBX files (I can still get the FBX SDK, at least, and sometimes, if the planets are correctly aligned, Blender actually successfully converts them as well, with only a little bit of manual intervention). Also, I can't report fixes any more after MS boots me off of github.

@stephengold
Copy link
Contributor

I'm able to reproduce this issue using the "Miku.zip" model provided by the OP.

I'm also seeing "length of input data" issues while importing other FBX models:

Error, T0: FBX: length of input data unexpected for ByPolygon mapping: 1076, expected 972

so there may be similar issues elsewhere in AssetLib/FBX.

@kimkulling
Copy link
Member

Sorry for my late response. I am rare on time and I am overwhelmed by the number of open topics.

@kimkulling
Copy link
Member

Closed by #5333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour
Projects
Development

No branches or pull requests

4 participants