3ds Max to Java Exporter

I created exporter which export 3ds Max object to Java class. If object is small, then works great. But if I exported big object I got error in JMonkeyPlatform: “code too large”, “too many constants”. Its way to get more information abaut .j3o format? Where I can read abaut .j3o?

So wait?

You convert a model to a java bytecode file? O.o

I convert to java class.

I readed Custom Meshes https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes

Ah now I understand what you are doing, but why are you not converting the 3ds to ogremax or obj and load them with the assetmanager then?

My guess for the error is, that the underling code highlighter in the netbeans basis of jmonkeyplatform has some kind fo abitrary limit for constants. (Or maybee you are using really much and there is a int size limit in it or similar)

I got errors becouse There is a 64K byte-code size limit on a method.

3ds to ogremax works bad with Bones.

Where I can read abaut .j3o format?

I want to make converter: 3ds Max to .j3o. But I not found information abaut .j3o file type.

Whats the issue with using OgreXML or Wavefront OBJ format?

J3O is an internal binary format that represents the data structures in jME3, converting to it is difficult from outside of jME3.

The greatest drawback is that the format can change at any point if the internals of jME3 change, that means your exporter can easily grow outdated.

The XML representation of the format is more simpler to understand but is still quite complex as you can see below:

[xml]<?xml version=‘1.0’ encoding=‘UTF-8’?>

<com.jme3.scene.Geometry name=‘Teapot-geom-1’>

<transform class=‘com.jme3.math.Transform’/>

<lights class=‘com.jme3.light.LightList’>

<lights size=‘0’/>


<controlsList size=‘0’/>

<mesh class=‘com.jme3.scene.Mesh’ elementCount=‘6320’ vertCount=‘3241’>

<modelBound class=‘com.jme3.bounding.BoundingBox’ xExtent=‘3.104425’ yExtent=‘1.519885’ zExtent=‘1.93001’>

<center class=‘com.jme3.math.Vector3f’ x=‘0.20940495’ y=‘1.519885’/>



<MapEntry key=‘0’>

<Savable buffer_type=‘Position’ class=‘com.jme3.scene.VertexBuffer’ components=‘3’ usage=‘Static’>

<dataFloat data=‘1.35101 2.31602 …’/>



<MapEntry key=‘2’>

<Savable buffer_type=‘Normal’ class=‘com.jme3.scene.VertexBuffer’ components=‘3’ usage=‘Static’>

<dataFloat data=’-0.929097 -0.369038 …’/>



<MapEntry key=‘3’>

<Savable buffer_type=‘TexCoord’ class=‘com.jme3.scene.VertexBuffer’ components=‘2’ usage=‘Static’>

<dataFloat data=‘0.684148 0.5 0.681346 …’/>



<MapEntry key=‘5’>

<Savable buffer_type=‘Tangent’ class=‘com.jme3.scene.VertexBuffer’ components=‘3’ usage=‘Static’>

<dataFloat data=‘0.369147 -0.929371 -1.0922E-5 …’/>



<MapEntry key=‘9’>

<Savable buffer_type=‘Index’ class=‘com.jme3.scene.VertexBuffer’ components=‘3’ format=‘UnsignedShort’ reference_ID=‘com.jme3.scene.VertexBuffer@363803606’ usage=‘Static’>

<dataUnsignedShort data=‘0 1 2 3 0 2 3 2 4 4 …’/>




<lodLevels size=‘6’>

<com.jme3.scene.VertexBuffer ref=‘com.jme3.scene.VertexBuffer@363803606’/>

<com.jme3.scene.VertexBuffer buffer_type=‘Index’ components=‘3’ format=‘UnsignedShort’ usage=‘Static’>

<dataUnsignedShort data=‘0 1 2 3 0 2 3 2 4 4 5 3 5 …’/>


<com.jme3.scene.VertexBuffer buffer_type=‘Index’ components=‘3’ format=‘UnsignedShort’ usage=‘Static’>

<dataUnsignedShort data=‘4 5 2 5 4 7 433 7 10 10 11 …’/>


<com.jme3.scene.VertexBuffer buffer_type=‘Index’ components=‘3’ format=‘UnsignedShort’ usage=‘Static’>

<dataUnsignedShort data=‘4 5 2 5 4 7 433 7 10 18 438 …’/>


<com.jme3.scene.VertexBuffer buffer_type=‘Index’ components=‘3’ format=‘UnsignedShort’ usage=‘Static’>

<dataUnsignedShort data=‘433 7 10 18 425 17 7 1 26 7 26 27 …’/>


<com.jme3.scene.VertexBuffer buffer_type=‘Index’ components=‘3’ format=‘UnsignedShort’ usage=‘Static’>

<dataUnsignedShort data=‘396 1 26 396 26 27 1 36 26 49 27 26 1 …’/>




<material class=‘com.jme3.material.Material’ material_def=‘Common/MatDefs/Light/Lighting.j3md’>


<MapEntry key=‘VertexLighting’>

<Savable class=‘com.jme3.material.MatParam’ name=‘VertexLighting’ value_bool=‘true’ varType=‘Boolean’/>


<MapEntry key=‘Shininess’>

<Savable class=‘com.jme3.material.MatParam’ ff_binding=‘MaterialShininess’ name=‘Shininess’ value_float=‘16.0’ varType=‘Float’/>






MaxOgre issues:

  1. When i export big object with many bones my 3ds Max crush. Like Skeleton animation or ect.
  2. I must add bones with my hand. Add first, add second, add second, add second and ect. If i have much bones Its take more times. Its very boring and very hard.

This probably means that you try to export some auto-rigged character or something. I will not work anyway w/o baking, so your converter would have to do that too, like the blender loader. Generally as @Momoko_Fan said: j3o is no interchange file format and is thus not meant to be read or written by other software than jme3 apps.