Skip to content

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

Closed

Description

@liuzhoulong

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

Activity

  1. added
    Bug
    on Jun 2, 2023
  2. darktjm commented on Sep 9, 2023

    @darktjm

    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.

  3. darktjm commented on Sep 16, 2023

    @darktjm

    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.

  4. stephengold commented on Oct 27, 2023

    @stephengold
    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.

  5. kimkulling commented on Dec 4, 2023

    @kimkulling
    Member

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

  6. added a commit that references this issue on Dec 4, 2023
  7. kimkulling commented on Dec 4, 2023

    @kimkulling
    Member

    Closed by #5333

  8. added
    UVs
    Regression
    MMD
    on Apr 24, 2026
  9. added a commit that references this issue on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugMMDRegressionUVs

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions