[Solved] NullPointerException on applyMaterial

Hi all,

Thanks for all of your work on jME! I spent a lot of time tonight wrestling with the Blender Ogre exports being imported to jME via assetManager.loadModel(), and found that my issue is the ‘submeshnames’ element in my Object.mesh.xml file:



<submesh usesharedvertices=“true” material=“Cube.001” use32bitindexes=“False”>

<faces count=“12”>

<face v1=“0” v2=“1” v3=“2”/>

<face v1=“0” v2=“2” v3=“3”/>

<face v1=“4” v2=“5” v3=“6”/>

<face v1=“4” v2=“6” v3=“7”/>

<face v1=“8” v2=“9” v3=“10”/>

<face v1=“8” v2=“10” v3=“11”/>

<face v1=“12” v2=“13” v3=“14”/>

<face v1=“12” v2=“14” v3=“15”/>

<face v1=“16” v2=“17” v3=“18”/>

<face v1=“16” v2=“18” v3=“19”/>

<face v1=“20” v2=“21” v3=“22”/>

<face v1=“20” v2=“22” v3=“23”/>





<submesh index=“0” name=“Cube.001”>




When the ‘submeshnames’ element is there, my game crashes upon submesh applyMaterial(). However, removing it brings up my cube with its properly applied diffuse material. Is there any reason for submeshes causing this crash that I’m just not aware of, or could I be doing something wrong?

Anyway, just wanted to share with the group - very excited to get going now that I can import mesh. :slight_smile:

Note: This also fixed the same problem when trying to ‘Import Model’ in the IDE and also while trying to right-click, ‘Create j3o’ - I think this may be the root cause of a lot of the problems people are having with the import functionality.

I have been using the 0.5.7-preview1 exporter with Blender 2.63.

The issue was fixed in the nightly / stable builds. You will need to update jMP.