Skip to content

Bug: X loader regression introduced with commit f844c33 on 3 Nov 2023 #5332

Closed

Description

@tellypresence

Appears to be a recent regression in X loader

Loading bundled model test/models-nonbsd/X/dwarf.x exhibits strange artifacts unless aiProcess_PreTransformVertices flag is applied during load (which of course destroys rigging/animation)

Problems observed when loaded without aiProcess_PreTransformVertices flag

  • Other than (most of) the head, helmet and left shoulder pad, the body mesh is not visible.
  • Animation for the body mesh seems to be correct
  • The axe is fully visible, but no longer animates (used to move with the body)

Note that this problem can also be observed in bundled IRR scenes which load the dwarf perserving bones/animation

ScreenshotsNotes
x_loader_regression_normal_load_bones_n_anim_preserved_Screenshot_20231118-092548 x_loader_regression_normal_load_bones_n_anim_preserved_Screenshot_20231118-092557 x_loader_regression_normal_load_bones_n_anim_preserved_az_recorder_20231118_112405 Loaded without

aiProcess_PreTransformVertices flag
(bones/animation preserved)

Notes:

  • The axe is no longer animated
  • double sided rendering was not
    enabled here, but the left shoulder
    pad can be viewed from both top
    and bottom
x_loader_regression_pretransform_verts_bones_n_anim_lost_Screenshot_20231118-093548 Loaded with

aiProcess_PreTransformVertices flag
(bones/animation lost)

Bisect

Bug was introduced on 3 Nov 2023; the X loader .cpp/.h files were touched here.

Assimp commitScreenshotsNotes
f844c33
3 Nov 2023
x_loader_regression_normal_load_bones_n_anim_preserved_az_recorder_20231118_112405 Bug introduced here
a7cfa32
2 Nov 2023
x_loader_was_ok_az_recorder_20231118_160835 OK

Activity

  1. added
    Bug
    on Nov 18, 2023
  2. changed the title [-]Bug: apparent X loader regression[/-] [+]Bug: apparent X loader regression introduced between 14 Sep and 3 Nov 2023[/+] on Nov 19, 2023
  3. changed the title [-]Bug: apparent X loader regression introduced between 14 Sep and 3 Nov 2023[/-] [+]Bug: X loader regression introduced between 14 Sep and 3 Nov 2023[/+] on Nov 19, 2023
  4. changed the title [-]Bug: X loader regression introduced between 14 Sep and 3 Nov 2023[/-] [+]Bug: X loader regression introduced with commit f844c33 on 3 Nov 2023[/+] on Nov 22, 2023
  5. added
    X
    on Nov 23, 2023
  6. tellypresence commented on Dec 9, 2023

    @tellypresence
    CollaboratorAuthor

    TL;DR

    New boneIdx and conditional around line ~367 causes the obvious breakage

    const unsigned int boneIdx = obone.mWeights[d].mVertex; // <-- new line
    if (boneIdx < obone.mWeights.size()) { // <-- new line
        oldWeights[obone.mWeights[d].mVertex] = obone.mWeights[d].mWeight; // <-- original line
    } // <-- new line
    

    Additional analysis details

    AFAICT there are only 3 non-whitespace changes of note in the offending commit:

    Line ~315 changed: checked "Before" vs "After" in isolation, both appear to work OK

    Before
    if ( newIdx > sourceMesh->mPositions.size() ) {
    
    After
    if (newIdx >= sourceMesh->mPositions.size()) {
    

    New conditional block added around line ~330: checked the conditional in isolation, both with and without appear to work OK

    if (idx < sourceMesh->mNormals.size()) {
        mesh->mNormals[newIndex] = sourceMesh->mNormals[idx]; // <-- original line
    }
    

    New boneIdx and conditional around line ~367: checked the conditional in isolation, this causes the obvious breakage

    const unsigned int boneIdx = obone.mWeights[d].mVertex;
    if (boneIdx < obone.mWeights.size()) {
        oldWeights[obone.mWeights[d].mVertex] = obone.mWeights[d].mWeight; // <-- original line
    }
    
  7. tellypresence commented on Dec 9, 2023

    @tellypresence
    CollaboratorAuthor

    PR #5372 will fix this bug once merged

  8. tellypresence commented on Feb 4, 2024

    @tellypresence
    CollaboratorAuthor

    #5372 merged, should be fixed

  9. added
    Regression
    on Apr 10, 2025
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

    BugRegressionX

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions