Ogre3D Mesh.XML Importer

Latest version available under SVN in trunk/ogreloader under the Radakan project:

http://code.google.com/p/radakan/source/checkout

Old version: OgreLoader 1.1



This is a Mesh.XML and dotScene importer implementation for jME2. The bone animation code supports hardware animation skinning with the latest jME version.



Mesh.xml models can be exported from nearly every modeling tool consistently, including 3dsmax, Maya and Blender.

See full exporter list: http://www.ogre3d.org/wiki/index.php/OGRE_Exporters



Check this tutorial:

Importing Mesh.XML from Blender

for usage instructions for the Blender3D modeling tool.

it can't find the .skeletonfile

It should be able to find it if you specified proper paths for the ResourceLocatorTool.TYPE_MODEL resource locator.

the whole thing gets really slow (14 frames with 50 animated meshes). my animation is 60 frames long, could that be the problem? or why is my thing that slow? polycount is nearly the same, texture isn't big...

That's really strange because I had 1,000 animated models running at 30 fps. ;) I think the problem might be somewhere else? Try disabling animation using MeshAnimationController.setActive(false) and see what happens.

maybe someone who's a pro-programmer (Cheesy) could make it concurrent?

That's a nice idea but integrating it with the current jME might be a bit difficult. Besides, if you use the hardware skinning option it will use all the parallel processing power of your GPU to handle animation which is a much better solution. :)

yes the fpscount dramatically increases when turning animation off.

how do i use hardware skinning? would be nice if that works



edit: i decided to post this on the thread, so everybody who may have the same problem might get a chance to solve it by him/herself





thanks, that just didn't work for me.[hardware skinning was meant] but no problem, i found where the performance goes.



my exporter (maya) is able to export shared geometry. your importer doesn't reckognize that [so it seems to me]. if i turn on sharedgeometry within the xmlfile, my app crashes. the funny thing is, your xmlfiles do have shared geometry, but it is turned off. so i think you simply forget to look at that parameter. i now rewrote my sharedgeometry-xmlfile so it matches your ninja (with shared geometry about 700 vertices instead of over 3000).



got now 150 animated characters walking with 50frames/sec (LOD activated, though)


Cool, now i begin my transition from md5 to mesh.xml, and move to jme2 in jcrpg. thanks!! :smiley:

Im just curious, what is the advantage of ogre format over md5?

does it support blending?



can the animation be saved separately from the mesh?



can u manually animate the skeleton?



Is it possible to play multiple animations on single skeleton?


yay… i have so been waiting for this  :smiley:

Im just curious, what is the advantage of ogre format over md5?

MD5 does not support materials*, normals, pose animations, indexed LOD, multiple texture coordinates, vertex colors, and tangents/binormals. In addition, there is a much larger collection of mesh.xml exporters available for modeling tools than there are for MD5.

* - MD5 supports MTR files but none of the jME MD5 importers support them.

does it support blending?

No.

can the animation be saved separately from the mesh?

Not sure what you mean. The animation is saved inside the skeleton.xml file.

can u manually animate the skeleton?

Yes.

Is it possible to play multiple animations on single skeleton?

No.

The source is available, if you make any improvements I can apply them while making new releases.

Tks for the reply.



How far is it from being part of the jMe core?

thanks you for the answers

Great job momoko!  :smiley:


Momoko_Fan said:


does it support blending?

No.


just wanna make sure, coz animation blending is very important to me. does it support blending between animations?
does it support blending between animations?

No.

The source is available, if you make any improvements I can apply them while making new releases.
To support blending, you need to add the neccessary API in MeshAnimationController, then allow bone animation transforms to be applied by a weight factor.

Works Great.



I had to modify OgreMesh so it wouldn't throw Null Pointer Exception.



   /**
     * @return Total number of lod levels
     */
    public int getLodLevelCount(){
       if(lodLevels==null){
          return 0;
       }
        return lodLevels.length + 1;
    }



After that I was able to use the ninja.mesh.xml

Thanks
I had to modify OgreMesh so it wouldn't throw Null Pointer Exception.

Thanks gbluntzer, I'll make sure to add that in the next release. Though it would be more appropriate to make the method return 1 instead of 0 as the model with the initial index buffer is a LOD level as well (as can be seen in lodLevels.length + 1)

There seems to be a bug in the MeshCloner. Once cloned, a new bounding volume is not created for the spatial, it uses the volume of the original model. My proposed fix is instead of having:


target.setModelBound(source.getWorldBound());



in the cloneSpatial method, change it to this:

target.setModelBound(source.getWorldBound().clone(null));

Where is the file?

I like to try ogre, as other formats seem to have a lot of limitations.

Momoko_Fan said:

OgreLoader 1.0

What file?

The OgreLoader 1.0 link is working for me.

surprise… now it works for me, too…

When is the next release of the Importer?



Where would be the best place to request enhancements for the Importer.



I would like to request the following functions



MeshAnimationController::

Skeleton getSkeleton()



Skeleton::

List<Bone> getBoneList() .  So i can retrieve the list of bones.



Bone::

attachNode(Node node). So I can attach an object to a bone( WeaponBone.attachNode(Weapon))



Vector3f getScale() function for Bone.  So that I can give my character a big head





Thanks

Recently I hacked in some attachment support





You call getBone() on the MeshAnimationController, then getAttachmentsNode() on the Bone, you can attach models to it and all, but you still have to add the attachmentsNode to the model node…