help: converting 3d models/animations in Blender 263 to bones

Started by rainfalls, May 27, 2012, 11:35:02 PM

Previous topic - Next topic

rainfalls

Hi raft/guys,

New to jPCT/Bones, I got a problem when converting my models/animations in Blender/3D Max to bones.

I'm currently playing around Diablo III models and trying to port them to my Android phone. Since I couldn't find any way to export the original animations from the game, I exported the mesh and texture of a model in game, and then manually rigged and animated it in Blender (2.63).

I then exported the model/animation with blender2Ogre-0.5.7, settings shown as the attached picture. I got two files: Leah_mesh.mesh.xml and Leah_mesh.skeleton.xml. Then I tried to convert them to bones with jmeOgre2Bones.bat, and I got this info:



d:\_WorkAtHome\Diablo3Dev\Models\Bones\scripts>jmeOgre2Bones -in Leah_mesh.mesh.
xml

d:\_WorkAtHome\Diablo3Dev\Models\Bones\scripts>echo off
27-May-2012 21:37:51 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
27-May-2012 21:37:51 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
27-May-2012 21:37:51 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
......
(a lot of same warnings here)
......
27-May-2012 21:37:51 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
-- total 54 joint(s) --
0 name: root, parent:
1 name: wrist_IK.L, parent: 0:root
2 name: wrist_IK.R, parent: 0:root
3 name: elbow_IK.L, parent: 0:root
4 name: elbow_IK.R, parent: 0:root
5 name: ankle_IK.L, parent: 0:root
6 name: ankle_IK.R, parent: 0:root
7 name: knee_IK.L, parent: 0:root
8 name: knee_IK.R, parent: 0:root
9 name: hip, parent: 0:root
10 name: spine.lower, parent: 9:hip
11 name: upperLeg.L, parent: 9:hip
12 name: upperLeg.R, parent: 9:hip
......
......
......
51 name: finger_3_tip.R, parent: 41:finger_3.R
52 name: finger_4_tip.R, parent: 42:finger_4.R
53 name: thumb_tip.R, parent: 43:thumb.R
-- --
Skeleton created out of jME OGRE skeleton, 54 joints
[ Sun May 27 21:37:51 BST 2012 ] - WARNING: skipping null TexCoords
Created skeleton animation clip: my_animation
Loaded ogre file: Leah_mesh.mesh.xml, scale: 1, rotation: null
        1 sub objects, 1 skin animation(s), 0 pose animation(s)

d:\_WorkAtHome\Diablo3Dev\Models\Bones\scripts>



And I couldn't find any output file(s)! I don't know if the conversion was successful or not from those information.

Then I also tried this route: blender(263) -> .FBX -> Autodesk FBX converer -> .FBX -> 3D Max 2012 -> OgreMax -> .mesh and .skeleton -> OgreXMLConverter (in OgreCommandLineTools_1.7.2) -> .mesh.xml and .skeleton.xml -> jmeOgre2Bones ->

and got this error:



C:\Users\rafael\Downloads\Bones\scripts>jmeOgre2Bones -in Mesh.mesh.xml

C:\Users\rafael\Downloads\Bones\scripts>echo off
27-May-2012 22:11:24 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
........
(a lot of same warnings)
........
27-May-2012 22:11:24 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
Exception in thread "main" java.lang.IllegalArgumentException: No controller fou
nd in OgreEntityNode. Means there is no skeleton or pose animation!
        at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:132)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:1
12)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:8
8)
        at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
        at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)

C:\Users\rafael\Downloads\Bones\scripts>



The model with animation looked fine in 3D Max. I watched Mesh.mesh file with OgreMaxViewers 2.4.3, the model appeared to be fine (actually I don't have a good knowledge of Ogre so don't know whether the .mesh file was correctly exported).

Could someone please help to have a look where my problem is? Some guides on the procedure and necessary tools (with their versions) for the conversion are extremely appreciated. I have searched this forum for these, but Blender and Ogre and 3D Max upgrade their versions so quickly, and it seems that many exporters/ conversion tools works only for some particular versions, which made me quite confused.

Thanks a lot.

[attachment deleted by admin]

raft

hi,

first I'm away from keyboard and will stay so for a while.

nevermind about warnings. its not important.

seems as your exported files does not contain any animation. in that case Bones cannot load that file. try playing with exporter options to make sure animations are exported

rainfalls

Hi raft,

Thanks for your reply.

I also checked the "Shape Animation" and "Independent Animations" options and exported my model. But the results looked the same.

From the exporter, I got two files: Leah_mesh.mesh.xml(765K) and Leah_mesh.skeleton.xml(4061K).

What I did is


jmeOgre2Bones -in Leah_mesh.mesh.xml


and then


jmeOgre2Bones -in Leah_mesh.skeleton.xml


And the outputs were:


d:\Models\Bones\scripts>jmeOgre2Bones -in Leah_mesh.mesh.xml

d:\Models\Bones\scripts>echo off
29-May-2012 13:55:42 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
......
29-May-2012 13:55:42 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNING: Rotation axis not normalized
-- total 54 joint(s) --
0 name: root, parent:
1 name: wrist_IK.L, parent: 0:root
.........
53 name: thumb_tip.R, parent: 43:thumb.R
-- --
Skeleton created out of jME OGRE skeleton, 54 joints
[ Tue May 29 13:55:42 BST 2012 ] - WARNING: skipping null TexCoords
Created skeleton animation clip: my_animation
Loaded ogre file: Leah_mesh.mesh.xml, scale: 1, rotation: null
        1 sub objects, 1 skin animation(s), 0 pose animation(s)

d:\Models\Bones\scripts>jmeOgre2Bones -in Leah_mesh.skeleton.xml

d:\Models\Bones\scripts>echo off
Exception in thread "main" com.jmex.model.ModelFormatException: Input XML file d
oes not have required root element 'mesh'
        at com.jmex.model.XMLUtil.loadDocument(XMLUtil.java:113)
        at com.jmex.model.ogrexml.OgreLoader.loadModel(OgreLoader.java:241)
        at com.jmex.model.ogrexml.OgreLoader.loadModel(OgreLoader.java:193)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:1
10)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:8
8)
        at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
        at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)


Thank you very much.

raft

you don't need to give skeleton file as parameter. only give meh.xml and it will locate skeleton.xml automatically.

so your mesh.xml loads correctly. if you don't see any output file that's because you don't specify one with -out option.

rainfalls

Exactly as you said. The conversion command should be:

jmeOgre2Bones -out leah.bones -in Leah_mesh.mesh.xml

"-out" option should be put before the "-in" one and can't be omitted.

I got the output now but still need some work on the rotation.

Many thanks for your help!