Model loading problem

i'm try remove material when convert model and got error when load it

Exception in thread "main" java.lang.NullPointerException

at com.jmex.model.XMLparser.Converters.TDSChunkingFiles.TDSFile.putChildMeshes(Unknown Source)

at com.jmex.model.XMLparser.Converters.TDSChunkingFiles.TDSFile.buildObject(Unknown Source)

at com.jmex.model.XMLparser.Converters.TDSChunkingFiles.TDSFile.buildScene(Unknown Source)

at com.jmex.model.XMLparser.Converters.MaxToJme.convert(Unknown Source)

at Main.main(Main.java:31)



Also has question Collada Import support any format or only Collada?

ok let's dance :))))



NFO: LWJGL Display System created.
java.lang.NullPointerException
   at com.jmex.model.collada.ColladaImporter.processTechnique(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.fillMaterial(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.processEffects(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.processCollada(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.load(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.load(Unknown Source)
   at Main.main(Main.java:33)




        URL texturesURL = null;
        ColladaImporter.load(new FileInputStream("model\fighter.DAE"), texturesURL, "Model Name");

        Node model = ColladaImporter.getModel();
        System.out.println(model.getTriangleCount());
        new JmeBinaryWriter().writeScene(model,new FileOutputStream("model\fighter.jme"));
        JmeBinaryReader jbr= new JmeBinaryReader();
        model = jbr.loadBinaryFormat(new FileInputStream("model\fighter.jme"));
        System.out.println(model.getTriangleCount());



and got result:


INFO: Child (XOBJ-node) attached to this node (unnamed_scene)
02.09.2006 12:25:26 com.jme.scene.Node attachChild
INFO: Child (unnamed_scene) attached to this node (Model Name)
batch: : Batch 5 old: 366 new: 88
batch: : Batch 4 old: 636 new: 157
batch: : Batch 3 old: 108 new: 24
batch: : Batch 2 old: 663 new: 187
batch: : Batch 1 old: 18 new: 11
batch: : Batch 0 old: 18 new: 12
603
02.09.2006 12:25:28 com.jme.scene.Node <init>
INFO: Node created.
02.09.2006 12:25:28 com.jme.scene.Node <init>
INFO: Node created.
02.09.2006 12:25:28 com.jme.scene.Node <init>
INFO: Node created.
02.09.2006 12:25:28 com.jme.scene.Node <init>
INFO: Node created.
02.09.2006 12:25:28 com.jme.scene.Node <init>
INFO: Node created.
02.09.2006 12:25:28 com.jme.scene.Node attachChild
INFO: Child (XOBJ_PIVOT) attached to this node (XOBJ-node_PIVOT)
02.09.2006 12:25:28 com.jme.scene.Node attachChild
INFO: Child (XOBJ-node_PIVOT) attached to this node (XOBJ-node)
02.09.2006 12:25:28 com.jme.scene.Node attachChild
INFO: Child (XOBJ-node) attached to this node (unnamed_scene)
02.09.2006 12:25:28 com.jme.scene.Node attachChild
INFO: Child (unnamed_scene) attached to this node (Model Name)
02.09.2006 12:25:28 com.jme.scene.Node attachChild
INFO: Child (Model Name) attached to this node (XML loaded scene)
36



36 != 603 :))))))))))

1 Import prj model to 3d Max 8

2 Export to ase

3 try load ase model by AseToJme


Exception in thread "main" java.lang.NullPointerException
   at com.jmex.model.XMLparser.Converters.AseToJme$ASEModelCopy.convertToTriMesh(Unknown Source)
   at com.jmex.model.XMLparser.Converters.AseToJme$ASEModelCopy.load(Unknown Source)
   at com.jmex.model.XMLparser.Converters.AseToJme$ASEModelCopy.<init>(Unknown Source)
   at com.jmex.model.XMLparser.Converters.AseToJme.convert(Unknown Source)
   at Main.main(Main.java:29)

http://dev.maryno.net:8081/model.zip

some models in package

try load it some way

if success please put code in this thread

FINALLY! I'm do IT! :slight_smile:

with debug jme i'm found that model's converters not working without Renderer!!! Hmmm… I'm think it's not good.

In project i'm load model's BEFORE initial graphics



model load's but some error has (not critical)



INFO: Child ("AeroSpotter") attached to this node (ase model)
java.io.FileNotFoundException: F:ArtAeroSpotter.tga (The device is not ready)
   at java.io.FileInputStream.open(Native Method)
   at java.io.FileInputStream.<init>(FileInputStream.java:106)

You can create a headless window and load the models maybe. I'd suggest converting the models to jME's binary format too.



As for java.io.FileNotFoundException: F:ArtAeroSpotter.tga (The device is not ready)

Does that path exist or not?

offcouse not :slight_smile:

maybe prefet be generate some log info not Exception? i'f i'm load texture manually why it's load it from ase file?

so right path:

1 load ase file

2 parse

3 create some list with materials? name, path, etc

and if I"M really needed for load this material do it! it's can be prefer for debug or other task