Animated models

Started by daboo, October 09, 2011, 01:42:09 AM

Previous topic - Next topic

daboo

Hi, first post!

I'm a Blender user and am wondering about model formats which export from that nicely, especially concerning animated characters. For example say I make a character, rig it with a skeleton and key some actions... then what...?

Any guidance and code examples would be good.

raft

* export your model and animation to a Bones supported format (for example Ogre3d format)
http://www.ogre3d.org/tikiwiki/Tools%3A+Blender
* convert that to Bones' native format with the scripts provided
* load your model and animation into your application via BonesIO class

bili

#2
Help plz, I got below exception when I try to convert the ogre3d xml to bones format. I used Blender exporter to export the model and mesh to ogre3d.
Skeleton created out of jME OGRE skeleton, 18 joints
Exception in thread "main" java.lang.NullPointerException
at raft.jpct.bones.BonesImporter.convertJMEMeshData(BonesImporter.java:438)
at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:193)
at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:112)
at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:88)
at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)


Grrr I guess it got something to do with my model. Try a few from ogre3d samples, they all converted without even a warning  :o


raft

seems as your model does not have texture coordinates. either add it or replace the line 438 in BonesImporter with the following line. i will do it myself tonight or tomorrow

if ((mesh.getTextureCoords() == null) || mesh.getTextureCoords().isEmpty()) {

bili

Thanks! that fixes the null pointer exception error.

raft

cool. seems as we were working at the sametime on the project. i've uploaded the corrected version

bili

could you briefly explain some steps how to create multiple animation like the ninja example in autodesk maya or 3d or whichever modeling software you use plz?


raft

I prepared the model used in animation blend demo in 3dsMax. I used the OgreMx plugin and i suggest it.

Briefly steps are:
* Prepare the model
* Rig it (attach a skeleton to it)
* Animate the model by animating skeleton
* Export model and animation via OgreMax plugin. You can specify in timeline when each animation starts and ends, that's how multiple animations are exported to a single file.

bili

#8
Many thanks. Your help is much appreciated.

Ahhhh! Is there any other way to create  multiple animation? I got a student version of 3d max but I can't really use it for commercial purpose for this android game im developing.

I got hold of this multiple animation in blender from http://jmonkeyengine.org/groups/graphics/forum/topic/multiple-animations-in-blender/ but  when I tried to convert it to bones.
Skeleton created out of jME OGRE skeleton, 60 joints
[ Sun Dec 18 15:40:39 GMT 2011 ] - WARNING: Mesh has no texture coodinates
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5921
at com.threed.jpct.Object3D.<init>(Unknown Source)
at raft.jpct.bones.Animated3D.<init>(Animated3D.java:120)
at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:198)
at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:112)
at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:88)
at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)

Any ideas why this happening?

or should I just abandon blender entirely?

Edit: I found this thread  http://www.jpct.net/forum2/index.php/topic,2111.0.html will try things out i guess.

Big Edit: Wooo I'm estatic! Just edit the skeleton.xml from the blender multiple animation above to match some attribute order and edited out sharedgeometric in the ninja demo xml and it works.... >:( Been trying all sort of things and none work hahaha me almost *cry* lool. Cheers.

But everything appears much dark, hardly see the model at all.

raft

sorry for late answer. somehow i didn't notice your post ???

yes, as you have found out, many single animation files can be merged into one. that should work for both Ogre and Collada files.

I'm not sure about the exeption, do you still get it? if so providing a test case may help.

i can't say abondon Blender, but I can say I really suggest 3dsMax + OgreMax ;)

bili

Quote from: raft on December 23, 2011, 02:03:01 PM
sorry for late answer. somehow i didn't notice your post ???

yes, as you have found out, many single animation files can be merged into one. that should work for both Ogre and Collada files.

I'm not sure about the exeption, do you still get it? if so providing a test case may help.

i can't say abondon Blender, but I can say I really suggest 3dsMax + OgreMax ;)

Im guessing you're using forum watch, but since I edited my post I dont think it will trigger the thread email update...just a guess.

I edited few attributes from the xml file  that cause the Exception to match the ninja model so it gone away now. However the model appears to be very dark. I can hardly see it! I guess it's cause by me playing with the XML attributes.

i wished I could use 3dsMax+OgreMax but I'm more efficient and comfortable with Blender so I will stick to it for now. Cheers.

raft

i won't suggest modifying xml files manually.

i can't think of any xml property causing a dark scene. maybe you changed light settings or have a very dark texture?

bili

Yes, that is plausible. I will check.

I didn't really edit the xml files but more like swapping the attributes order to make it similar to the ninja model xml.

raft

while playing with values, i've faced the dark scene you mentioned too. it was caused by the absence of texture coordinates.