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

glTFs with an AnimComposer but no skeleton throw an exception #2

Open
stephengold opened this issue Jan 19, 2024 · 3 comments
Open

Comments

@stephengold
Copy link
Owner

Reported by @capdevon at the JME forum:

https://hub.jmonkeyengine.org/t/assimp-based-model-import-and-the-monkeywrench-library/46930/66

A copy of the stack trace:

SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
com.jme3.asset.AssetLoadException: An exception has occurred while loading asset: Models/Zombiegirl/Running.gltf
	at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:274)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:388)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:439)
	at com.capdevon.test.Test_AssetManager.simpleInitApp(Test_AssetManager.java:69)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:607)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:710)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: Assimp failed to import an asset from "Models/Zombiegirl/Running.gltf":
 No materials remaining
	at com.github.stephengold.wrench.LwjglAssetLoader.loadScene(LwjglAssetLoader.java:144)
	at com.github.stephengold.wrench.LwjglAssetLoader.load(LwjglAssetLoader.java:95)
	at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:272)
	... 7 more
@stephengold
Copy link
Owner Author

stephengold commented Jan 26, 2024

This appears to be a direct result of assimp/assimp#5438 .
A fix has been submitted: assimp/assimp#5439 .
I'll leave this issue open until a fix makes its way into a stable build of LWJGL---I estimate 6-to-12 months.

In the mean time, the best workaround is to disable RemoveRedundantMaterials post processing:

    int ppFlags = Assimp.aiProcess_CalcTangentSpace
            | Assimp.aiProcess_JoinIdenticalVertices
            | Assimp.aiProcess_Triangulate
            | Assimp.aiProcess_ValidateDataStructure
            | Assimp.aiProcess_SortByPType;
    LwjglAssetKey key = new LwjglAssetKey("Models/Zombiegirl/Running.gltf", ppFlags);
    Spatial m = assetManager.loadModel(key);

@stephengold
Copy link
Owner Author

On 1 February, Kim wrote and integrated his own solution (PR 5451) for the issue. 5451 introduced a new bug (issue 5461), for which I submitted PR 5467. 5467 has now been integrated into assimp's master branch.

@stephengold
Copy link
Owner Author

The fix made it into LWJGL v3.3.4.
Today I verified this using a custom build of jMonkeyEngine.
The next step is to update the LWJGL version used in jMonkeyEngine: jMonkeyEngine/jmonkeyengine#2298

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

No branches or pull requests

1 participant