Skip to content

Runtime loading crash during PIE #569

@ZeyrinPixel

Description

@ZeyrinPixel

Describe the bug
When calling LoadVRMFileFromMemory() or LoadVRMFileFromMemoryDefaultOption() during runtime, I keep getting access violation crashes when running PIE. I don't fully understand it but it has something to do with VrmConvertModel.cpp attempting to run editor asset saving/compiling systems when it isn't allowed.

The fix I found was to wrap this portion of VrmConvertModel.cpp in an if statement to check IsImportMode as follows:
Line 2388:

#if WITH_EDITOR
    if (VRMConverter::IsImportMode()) { // <-- ADD THIS LINE
    // animation
    if (aiData->mNumAnimations > 0) {
        UAnimSequence* ase;

Line 2738

                sk->SetPostProcessAnimBlueprint(bpClass);
#endif
                sk->PostEditChange();
            }
        }
    }
    } // <-- ADD THIS CLOSING BRACE
#endif

    return true;
}

I'm not sure if this breaks anything else or if it is the proper way to fix the issue.

UnrealEngine Version:
UE5.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions