Skip to content

NullPointerException in FbxMesh.applyCluster() #1939

Closed
@stephengold

Description

@stephengold

Using the current "master" branch of JME, I was attempting to load a skinned FBX model without any animation tracks (T-pose only):

Jan 31, 2023 6:43:07 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.NullPointerException: Cannot read the array length because "positionIndices" is null
	at com.jme3.scene.plugins.fbx.mesh.FbxMesh.applyCluster(FbxMesh.java:127)
	at com.jme3.scene.plugins.fbx.mesh.FbxMesh.toJmeObject(FbxMesh.java:212)
	at com.jme3.scene.plugins.fbx.mesh.FbxMesh.toJmeObject(FbxMesh.java:58)
	at com.jme3.scene.plugins.fbx.obj.FbxObject.getJmeObject(FbxObject.java:113)
	at com.jme3.scene.plugins.fbx.node.FbxNode.toJmeObject(FbxNode.java:399)
	at com.jme3.scene.plugins.fbx.node.FbxNode.toJmeObject(FbxNode.java:71)
	at com.jme3.scene.plugins.fbx.obj.FbxObject.getJmeObject(FbxObject.java:113)
	at com.jme3.scene.plugins.fbx.node.FbxNode.createScene(FbxNode.java:496)
	at com.jme3.scene.plugins.fbx.node.FbxNode.createScene(FbxNode.java:503)
	at com.jme3.scene.plugins.fbx.node.FbxNode.createScene(FbxNode.java:503)
	at com.jme3.scene.plugins.fbx.FbxLoader.constructSceneGraph(FbxLoader.java:412)
	at com.jme3.scene.plugins.fbx.FbxLoader.load(FbxLoader.java:124)
	at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:272)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:388)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:439)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:444)
	at jme3test.helloworld.HelloJME3.loadModel(HelloJME3.java:90)
	at jme3test.helloworld.HelloJME3.simpleInitApp(HelloJME3.java:69)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:139)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:221)
	at java.base/java.lang.Thread.run(Thread.java:833)

The file version was 7400 (FBX v7.4).
The FBX importer seems to assume that since the model is skinned, it must have animation tracks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that is supposed to work, but doesn't. More severe than a "defect".

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions