Example code of a mesh model assembley.

-put your jMonkeyEngine3.jar and the jme3 lib dir into the jme3libs directory after applying the patch and building.

Do whatever you want with the code provided here, as long as you don't blame me for it. The model is the dwarfwarrior from the Medieval II Total War mod Call of Warhammer, all credits to them, not me, I just used the model.

tom at 3d-inferno dot com


Further information on the inner working of the mesh assembley:

Similar to MTW2 I created a system which tries to create a veriety of looks from a small set of base items.
One model is created with different meshes for different body parts.
Models are based on common skeletons, all dwarfs use a dwarf skeleton, all humans.. . But to be correct, the skeletons are all build from the same bone set. All are 20 bones named like the MTW2 bones. So the left hand will be the same on a human, dwarf, goblin, etc.Theoretically you could create just one set of animations and put it on all skeletons.
Animations are created on the base skeleton. The animations are aligned along the weapons the models should use, each weapon type an own animation set (helbards, swords, maces, etc.). Each animation set sports the same animations (stand_a_idle, advance, etc..).

Have a look into the compiler to see how FCData/data/_raw is converted to _target (found in data.jar).
Basically I have the ogre skeleton file split into one skeleton file and one animation file for each animation in the skeleton file.
The compiler then converts the ogre files into jme3 files. While doing so I create a repository of the model template. (data.jar!megaset.csv)
A model template is defined in the meshes subdirectories. In this case the dwarfwarrior. You have several leg, shield, hair, etc. meshes, textures, the materials, one skeleton (which would be normally reused on other dwarf skeleton based models) and the .weapon definition.
A weapon definition is used to define the primary weapon model, an optional offhand model, and the animation set to be used with this configuration. 

Have a look at Assembler.compileModel, this one could be static, this is how the model gets assembled back after being loaded from different parts.
Basically you pass in a Geometry Array of Meshes (already textured)
and a Skeleton. The animations in my scenario are provided from a global animation provider, as many models use the same animation set (that topic before). Have a look at the commented code about AnimControl, this is the way you would do this in a plain jme3 scenario. The animations you provide should have called BoneAnimation.rewireBoneTracks (which is done in my case in the AnimationManger::PartSetAnimationProvider), to get the correct mapping from bone names to bone id's, which is missing at load time. (The anims were never loaded on a skeleton during compilation hence they have no bone indices saved.

If you noticed a popping of models up and down between animation switches, it seems to me that this is because of the first frame in the animation files being the bind pose. I'll have to give it a try without the bind pose inside the animations (this worked without popping in jme2).

To be able to compile the whole stuff, you must apply the patch to your jme3 workspace, build it, put the jar and the libs directory into jme3libs. I added the launch configurations too. Somehow the eclipse environment does not have such a nice porject export wizard as some other tools...