Blender to jME

What's the best way to get a model from blender to jME, I really only care about the mesh and the animations (and I don't really care if they are keyframed, skeletal, etc). UV Mapping would be nice but I figure that I can always save the image and manually load it, and may even prefer that approach.



As I understand it Hevee's python script is still the top dog when it comes to exporting from blender to xml format, but which version of blender does it support now days? I also know there are a few formats that blender can export to by default that can be loaded by jME, but which ones actually work.



It seems like there should be a dedicated sticky thread somewhere (or in the wiki) covering basically the what works/best practices when it comes to model formats.



Our choice is obj for static meshes, md5 for animated skeleton weighted characters....

I think you do need uvmapping to be ported, prodecurals only or code based plannars,e tc, are too poor...

there's support for blender and jme in both cases…

How do you get from blender to md5? It's not in the list of export formats out of the box, is there a script somewhere or are you using a different modelling tool for that? Is there a reason not to use md3 as an intermediate format since blender and jme can handle those (is jme's loader for that model type weak or not compatable with the blender version of that format)?

DanK said:

How do you get from blender to md5? It's not in the list of export formats out of the box, is there a script somewhere or are you using a different modelling tool for that? Is there a reason not to use md3 as an intermediate format since blender and jme can handle those (is jme's loader for that model type weak or not compatable with the blender version of that format)?


sorry, I was a bit to brief...

Blender MD5 export.This very exact post. but also the inmediately following one ot it, is important :
http://www.doom3world.org/phpbb2/viewtopic.php?p=132794#132794

JME md5 support is not yet included as oficial, and I think is not ended but I think my friend Tora and I are doing ok for now...can't say for sure. It's a Kman's addition, but he's busy now with a game and the support of cal3d format for JME, also. he must have done a good work on md5 as I think we're being able to deal with it...
I am not sure if this version is the one we are using... But here is :

http://gamedev.kproject.gr/index.php?n=Main.KProjectMD5

That's a loader for jme.


* md3. Well. I used one that tended to add some extra deformation with which I wasn't very happy, similar to md2 typical one .plugins for it :
Theone I allways used (good to go, anyway, if u play with ur model scale in the text of the script u can reach less deformation)
http://www.filesend.net/download.php?f=ad197e6b06c7e29e00164b47e2bba34f

A new one I didnt know, seems to be complete, tho based in tags. I dont like the original md3 style, body parts. i prefer one piece model, way I did with the above plugin. Maybe this one bellow allows that kind also :
http://www.planetgargoyle.com/openarena/tools/blendermd3.zip


Wait...maybe the second is best...looks like it couldbe even much newer, maybe for latest Bledner versions...No way to import in 2.40, as it includes an md3 importer too...but if u model and anim your meshes, I'd only care for the exporter.

I dont like md3 for the break in smoothing at every seam in the mesh wherever two UVs are shared (uv island borders) besides other issues, and in our project, fo rmemory size also. I like much more md5.






I'm probably no where near as picky as you, I'm not artist, just a programmer, luckily 3d modelling isn't something that's too extremely out of my capabilities (I can handle making a shape… making a nice texture for it or beautiful animation on the other hand… I am not so great at).



For now it seems like hevee's python script works for the stuff I need using blender 2.42 though I've yet to do any actual animation yet. I know I have setup animation before at some point and I'm pretty sure I did it with hevee's script (though it's also possible I might have used milkshape to make a really simple model… I was only intrested in testing out how I could animate stuff at the time).

You should be able to get any animation you can do in blender over to jME using the blender to xml exporter.

It will be exported as morph target animation, however, so if you decide you want skeletal anim you'll have to go for either the md5 exporter, or the modified cal3d 3xporter from here: http://www.jmonkeyengine.com/jmeforum/index.php?topic=2982.msg27770#msg27770

Cal3D in jME has still problems, but is being in constant development, in fact, KMan said recently he is going to release the source code of a new, better version really soon.

Or, you could buy milkshape, but that would mean having no weighted bones, and the ms3d skel anim code in jME might have problems that could be difficult to fix.

My personal preference is blender to xml for static models, and cal3d for skeletal animation, just because I like cal3d better than md5 because of some deep inside, sub consious feeling (which KMan seems to share, I remember him saying he would concentrate on cal3d before md5).

I don't need bones for this one, and while I think generally the idea of working with bones simplifies a lot of things, in this case it would not, mainly because of my evil plan to piece together parts to make the whole. The advantages of using bones goes away pretty quick when you chop up your model that way (with a few more chops, I'd be able to treat each peice of the model as a bone but I'm not wanting to go that far).



What is the difference between morph target animations and object animations? I used object animations in my test exporting just now and they worked, though the animation itself was extremely slow time wise, it did seem to work fine (slow not relating to render speed, just speed of the movement).



Is cal3d that great, I looked at it but it seemed I'd have to install extra stuff to work with it (including more native libs). I don't like to make use of a lot of third party stuff unless it's very stable/reliable and very useful to me, I find it's often easier to make something myself than to figure out how to use someone elses tools and then I don't have to have a headache when things suddenly quit working cause I updated something… but that's probably just paranoid of me. I have another project I'm working on that I consider my main project, and skeletal animation might be a better choice for that one as I plan to be a bit more traditional there, but for the project I'm working on right now I'm confident I don't wanna mess with it.

some data, dank:



-I had forgotten (sorry, hevee, speed in writting confuses more my brain. Even more.)  , but in my opinion  in jme is WAY better method to use hevee's blender plugin and format. The picky details I spoke of md3 are not in hevee's workflow. The only think is your animations are going to be of more memory perhaps than bones ones, but if leave it at a keyframe per 2 frames, quite a very accurate , identical visually, of what u did in Blender. What is more, it takes everything practically. He's done it in a way which I see like "error proof" .You can actually animate with bones with it. The export wont have em, but the visual result is the same than with weighted bones, as is what u used, just that its a bake in vertex animation. But to the user, is the same. Only you wont have bones to access in code, but i strongly doubt you'd need that in ur project.

So , yup, by all means, in your case go for hevee's way. In many situations is and ideal way.Much better than md3 old format.



-You still can use bones AND separate parts. You just asign each part vertex group to the wanted bone. Is just a hierarchy, a helper for animation. Hevees plugin will take

the vertex animation, anyway, is like a cam corder in 3d :wink: No matter what u do in blender :slight_smile:



-You remember me a lot of Doga, a software wher u didnt actually model, but build mechs from parts…  :smiley:



-vertex deformation. Well, usually when an object moves, with no deformation of it shapes, or rotates…there's not happneing vertex deformation animation…if u use some deformation modelling in a frame, and make it morph from one shape to a next modified one, there, morphing—>vertex deformation animation…Bones do this, through the use of weights. A bone is no more than like an stick which has been linked to some vertices with an strength. If strenght is total, 1.0 , or none 0.0  and no othe rpossibility: milkshape style of animation. There are tricks, but I'm even more against that sort of animation than md3 style…Ugly, uncomfortable (sorry ms3d freaks ;)) .if it has real weights, it can affect only like with 0.3 of strenght…then will move partially, while other vertices will move with 1.0. Shape of the whole part is deforming as its vertices are not moving equally …So bones and weights means also deformation…

To u, all would be the same while using hevee's workflow.It takes it all, no questions asked :wink:



Morph target…is called to a mesh with certain deformation…you do several, and force the 3d package to calculate the inbetween morphing…Object animation is usually called to animation based only in whole object traslation and/or rotation.no independent vertex deformation here.(btw, I have never ever seen a vertex deforming…)



-Yes, they both like better cal3d than md5. They couldn't be perfect. Great coders, total genious need some quantity of non perfection to look more of the human kind for our eyes…So we don't get frightened and get enough courage to aproach em… ;)  ;)  (er…a bit of sense of humour among so much technical words…)






DanK, when exporting object animations adjust blender's "end frame" from the default 250 to the last frame of your animation. Otherwise, frame number 250 (249 in jmE) will always be appended to the object animation.

I don't really know anymore why I made it that way, and I don't have the time to investigate, so I'll leave it at that for now.

That might give an impression of slow animation. Check your file with the slow animation in a text editor, and remove the frame number 249 in there, import it inot jME, and if everything's right then, that was your problem.



About cal3d: It has been around for quite some time, and should be pretty stable by now. KMan uses a java port of cal3d, so no additional native libs are required, and it's performance is just outstanding. Initially, my thought was that it would be a good thing to have the skel anim stuff calculated externally by some optimized native lib, because there's a lot of cpu-native calculations going on in there which a good c-compiler should be able to optimize quite well. But seeing the performance of the existing cal3d for jME, this seems not even neccessary (maybe the sun folks know how to write compilers too… could be possible, after all…)

I cannot currently recall the reason snaga prefers md5, but he seems to have evaluated both md5 and cal3d, so it's probably better to follow his path here - maybe it's really just some weird, emotional coder thinking to prefer cal3d, being an offspring of a free, open source game project (worldForge) :wink:

You know, when it comes to practical usability, I'd always prefer an artist's view over a coder's, the former seem to have an understanding of such concepts as "real life usage", and some other things that are totally alien to the typical coder :wink:

OK, so it looks like if you can use it, the object animation would be significantly more efficient, and in my test it worked exactly the same because I didn't bother with assigning bones properly and having any joints… it's just a mesh that I rotate as a whole… that will change, I will need bending arms/legs and probably a few other things.



The mech concept isn't far from what I'm going to do here, and with the core part of my engine it would be possible to setup something like that. I haven't seen or even heard of the game you mentioned though.



Sounds like I didn't do enough resource on cal3d, after I finish, give up, etc, the side project I'll have to look at it for the other project I'm working on.



One man can make a MMORPG… but one man probably couldn't make the game high enough quality for people to pay for the service (need a solid coder, a solid artist, a down right awesome marketting guy, and then probably a pile of support people for customer support and everything else that goes into running a business… my main project is of course a MMORPG but I feel that from the design concept, I can by myself create a very good game, I have a large portion of it already made, it's down right ugly though, and one of these days I gotta find an artist with low self value, maybe who will work for donuts, not fresh donuts mind you, those are extra, not even day old… just whatever is in the dumpster out back of the krsipy creme… I feel that once I have the game to a point I could post it online publicly, it should be good enough quality that I can get talented artists working on it, though possibly my day job will be funding their work (eek).



Anyway, hevee's script will most likely get me where I need to go with this side project and but for the main project, it might work perfectly well too, though a bones format would probably be more ideal.



[edit]It turns out I am wrong, my plans went something like setup individual parts, each having an animation for different things, and when the main body part was told to do something, I'd have all other parts be told the same thing, figuring movement would remain relative to the original part as it rotated etc… and that would work just fine with object level animation… but I figured I'd need some joints here and there and the logical break down of parts in my game doesn't involve every joint (I want a whole arm, not a forearm and hand etc). So now I guess it's time to figure out if which is less insane, breaking the model down further into more meshes individually animated as objects, or to use a real bones system and possibly dynamically attach bones. I assume that bones is less insane, but using multiple parts is much simpler to implement (and likely means I'd have to upgrade to day old donuts for the no self esteem having artist)[/edit]

Snaga, that's definitely plenty enough reasons to explain your bias for md5. Sounds like I'll have to look into using that format, instead of cal3d, for my own project. Thank you for the enligtenment!

Here's where Kman, in the form of a vengative angel, make some rays fall over me from the sky…



Let's say some good things of cal3d also, so it maybe only little rays…



It has stuff like cloth physics in it, and other ingame cool stuff , already added, and the blending of anims seems to work quite well


Dank…you've got also good sense of humour  :smiley:



[A full dry donut u'd give him?? Lol, nobody pays so much these days…You must be in a good financial moment…]

It's well stablished that half a dry donut, of enough days as to be used also as a thrwoing weapon, is the usual payment for a whole mmmorpg…




OK, so it looks like if you can use it, the object animation would be significantly more efficient, and in my test it worked exactly the same because I didn't bother with assigning bones properly and having any joints... it's just a mesh that I rotate as a whole... that will change, I will need bending arms/legs and probably a few other things.


u know, that puzzle doesnt worth it nor even for a mech..better grab blender's online doc, and mount an easy mech hierarchy withbones, with 1.0 weights is freaking easy. Setup the armature(skeleton in Blender's particular 3d "dictionary") for it, asign vertex groups for each bone (when u parent em, it does a try on generating for u, u need to retouch allways the asignments) , animate the bones and ur done.


Sounds like I didn't do enough resource on cal3d, after I finish, give up, etc, the side project I'll have to look at it for the other project I'm working on.

doing how I said u only need to check that blender doc, and excute the script, the cal3d plugin to export your animated character.
well..."only" should not exist as a word in 3d...


One man can make a MMORPG


sorry? ahm...er..sure...
;)


... but one man probably couldn't make the game high enough quality for people to pay for the service (need a solid coder, a solid artist, a


Unbreakable, resistant to water...  }:-@ :D

down right awesome marketting guy, and then probably a pile of support people for customer support and everything else that goes into running a business...


Indeed, that team would rock for a casual game, not for a mmorpg..

my main project is of course a MMORPG but I feel that from the design concept, I can by myself create a very good game, I have a


Everybody plans on designing a mmorpg. Is fun, you never release anything so, but thinking about it well..ppl have a nice time imagining, so, nothing wrong..

large portion of it already made, it's down right ugly though, and one of these days I gotta find an artist with low self value,


Then is not an artist. :D

maybe who will work for donuts, not fresh donuts mind you, those are extra, not even day old...


:D

just whatever is in the dumpster out back of the krsipy creme... I feel that once I have the game to a point I could post it online publicly, it should be good enough quality that I can get talented artists working on it, though possibly my day job will be funding their work (eek).


...funding his work, unless you have really interesting($) kind of job...

I propose everybody go a look at credits pages of Neverwinter Knights in the printed manual...Lol. And that's a 5 year old game with lots of weak technical points...

For doing an indy sort of mmorpg, I'd count on 3 very dedicated artist, rich bored ppl(rarely artist are so) or 5 with quite some free time. Then maybe there's som option. Oh, and pro ones, or you'll get lots of bad proportions and terrible textures...


Anyway, hevee's script will most likely get me where I need to go with this side project and but for the main project, it might work perfectly well too, though a bones format would probably be more ideal.


hevee's system I think could be grreat for a game like warcraft3 , sort of strategy with units seen from a distance, so, low poly ones.

It turns out I am wrong, my plans went something like setup individual parts, each having an animation for different things, and when the main body part was told to do something, I'd have all other parts be told the same thing, figuring movement would remain relative to the original part as it rotated etc... and that would work just fine with object level animation... but I figured I'd need some joints here and there and the logical break down of parts in my game doesn't involve every joint (I want a whole arm, not a forearm and hand etc). So now I guess it's time to figure out if which is less insane, breaking the model down further into more meshes individually animated as objects, or to use a real bones system and possibly dynamically attach bones. I assume that bones is less insane, but using multiple parts is much simpler to implement (and likely means I'd have to upgrade to day old donuts for the no self esteem having artist)


You know, the requirements would have gone too high...an artist of the half a dry donut kind, and also loving the idea of animate like we all did in the elder times of 3d Studio for Ms Dos, when they were linked parts in a hierarchy (somebody remembers that terribly ugly mech bird they had as sample?) , is not very easy to find, besides...Would that be an artist? XDD

Sorry, I have good humour today...Dunno why...

I realize I can do all kinds of things with blender and bonees, but the things I needed to make my side project do what I wanted, had to be done outside of blender, as part of my game, currently some of the peices I need just don't exist and are outside of my actual ability to produce in a reasonable amount of time, so I will have to let those particular ideas simmer, and go back to working on my main project for now which does not require anything fancy to work (and more important doesn't require anything I have no already done before).



I really am building a MMORPG, and I really will have it working quite well with just myself working on it, it will of course look like garbage long after it reaches a fun to play point, once I am satistfied with the game mechanics and completeness of it's features… it'll be time to hunt down an artist (or some artists) to start making the peices of the world look like they should. There is no reason you can't develop almost a complete game with extremely poor quality mock up graphics (including for example… the human character with cubes, balls, cylinders, etc, for body parts, and really lame animations to accompany those increadibly mesh shapes). I am past the half way point to where I can post it online for actual play, not just a map walkaround maybe chat game, but an actual game.



Heh, you thought I was joking about the donuts… hard as rock, now that could prove quite useful as a weapon… I'll have to be careful about that…

Yeah ! we are tired too of this casual flame throwers, sawblade guns, chicken cannons, whatnot …

Since it's on topic now I guess…



[ur=http://dilbertblog.typepad.com/the_dilbert_blog/dilbert_stuff_that_got_me_in_trouble/index.html]Dilbert stuff that didn't get past the editor[/url] The last set of entries covers pretty much my entire plan for world domination… with deadly donuts…

I will create a 'proper' model so to speak, in that I will use a model with animations and all that, though the model itself may not look much like a person and more like a bunch of objects floating around…



That said, I've got some weird issues with importing some stuff from blender, it's like on every model, a couple of the vertices are just wrong, like they are inside out and some that are in the wrong location. The objects that do this are 'extruded' from a cylinder (I tree/bush and a pile of rocks). The weird thing is, the pile of rocks is a couple of duplicated and then deformed a little/scaled/rotated cylinders, but it seems like only one gets messed up. I will have to look at the xml files when I get off work later to see if it's the first vertex that is messed up (it's way below all others).

if model in wings, qudrangulate (or triangulate if u dont mind loosing quads so early) before save the final version. And import as wings file. Obj could do , but in my experience the wings import in blender does well…



if use other package, I'd go for OBJ format…





Also, any sort of glitch or problem…I don't have available free time, but if you post an screenshot where very clearly and in big size is seen your problem, I will most surely tell you a solution, as have suffered years of mesh problems :wink:

but no more help than that, no time.

I appreciate the help but for now I'm not really worried about it, I didn't figure out which vertex is out of place looking at the file… but looking at the .xml file of my jme model… I realized I could probably easily write out a jME compliant xml file from my .x parser.