How to design a multiy part model?

Hello everyone,

I'm wondering for some time now what would be the best way to design (technically) a multi part model. What I mean is a model that consists of several parts, that all "stick" together but can turn/move a little to each other.

What I wanna do concretely is to have a ship (consisting from a hull with rigging and sail(s)), that gets moved around as a whole but it can trim it's sails (rotate them around the mast).

The models have to be designed in an external modelling tool (I use blender).



What I currently do is to load three models and put them in a Node. I can move/rotate the node so working the ship as a whole is no issue. What I don't wanna do is play around with Vector offsets to find the proper rotation axis (the mast). Is there a way to define a rotation axis in a model and read this information after importing it in JME?



Any hints on this are appreciated!

I believe I have read that adding an empty object in blender to your model creates a node at that location which you may access in JME, however I have not tried it myself, so hopefully someone who knows more can help.

That is only true if you use the old xml importer and the blender jme-xml exporter. I can package the old xml classes into a library that still works with the latest cvs jME, and upload it to where the exporter is if you are interested.

hevee said:

That is only true if you use the old xml importer and the blender jme-xml exporter. I can package the old xml classes into a library that still works with the latest cvs jME, and upload it to where the exporter is if you are interested.

I would be interested in seeing any source you have of the old xml importer/exporter.  One question though is why it was scrapped in the first place?  Are there any shortcomings to the old exporter/importer?
691175002 said:

Are there any shortcomings to the old exporter/importer?

It was a pain to maintain because it had all the serialization logic for all jME classes in one huge monster of a class without automated testing. The good thing about it was the xml file format, which unfortunately had to go with the old binary serialization.
The source code can be found in the pre-0.11 versions of jME in cvs, or for the blender exporter it's here:
http://wwwhomes.uni-bielefeld.de/krabien/jmestuff/jmeXMLExport.py

Is there any way that nodes/coordinates could be imported with .obj or .md5 files?  I would hate to have to modify the xml importer class if I ever needed to.

For obj, no, not as a part of the imported scene.

For md5 I suppose you could use bones as location markers, it is a skeletal anim format after all.

Currently I'm using the 3ds format to get my models from blender to jme since that was the only format that worked right away. Many blender export options didn't work for me (windows no python).



The XML importer doesn't sound very inviting since I don't want to end up looking after that code - with it being no longer part of jme.



Would it be possible to use some kind of bone system (actually I was thinking of a "hinge" between the mast and the sail) without any physic system (I'm not using jme-physics and don't want to use just due to this issue)?

If Milkshape3D is an option, you might want to take a look here

Thanks for the hint, I read that thread already and it even seems it doesn't depend on the milkshape format (so I assume I can use it with 3ds as well).

I have never before worked with joints so I have to do some research in this direction (both blenderwise and jmewise).

yes, the controller is milkshape-independent. it just needs joints.

The reason I said Hamster's new JointController requires ms3d was that it would hardly make any sense to manually create a ms3d-style joint mesh because mojo has provided a far better solution for skeletal animation. com.jme.animation provides a solution for animating single bones among many other things (such as bone influences).

Sorry Hamster, your solution is great for ms3d imported models, but for people who are looking for a non-ms3d way to animate single bones I'd strongly recommend Mojomonkey's AnimationController and associates.



Monky, I don't think there's a blender 3ds exporter that supports joints/bones/armatures. I don't even think the format supports any kind of bones.

The only blender exporters known to produce any reliable results for skeletal animation are for MD5 and Cal3d. Both are available to jME as external libraries, but neither uses the JointController system which was created for the jME ms3d importer, so they cannot be used with Hamster's JointController without a lot of additional work which would largely mean re-creating the md5 or cal3d importer to use a mostly obsolete skeletal animation system.