Author Topic: Ogre to Bones conversion  (Read 19653 times)

Offline subhalakshmi27

  • byte
  • *
  • Posts: 21
    • View Profile
Ogre to Bones conversion
« on: December 23, 2011, 07:27:18 am »


Hi All,

I am new to JPCT. I am currently trying to convert ogre xml file to bones.

My artist gave me the mesh and skeleton xml file. But in mesh xml, the skeleton link was missing.
 ???
I manually added the skeleton link and when I executed jmeOgre2Bones bat file I got the following error, (Windows7 operating system)

jmeOgre2Bones.bat -out image.group.bones -in my_V008_test.mesh.xml

Skeleton created out of jME OGRE skeleton, 48 joints
Exception in thread "main" java.lang.NullPointerException
        at raft.jpct.bones.BonesImporter.convertJMESkinData(BonesImporter.java:
57)
        at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:192)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:
12)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:


I like to know,

i) What my artist should do for missing skeleton link in mesh file? Do my artist need to do anything while exporting the data from 3d studio?
ii) Why I am getting, NullPointerException while convertJMESkinData

Thanks in Advance.

Regards,
Subha

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Ogre to Bones conversion
« Reply #1 on: December 23, 2011, 01:51:30 pm »
which tool (3d editor and ogre exporter) does your artist use?

skeleton link should be automatically added by exporter. I used 3dsmax + OgreMax and never faced such a problem. Some other users used Blender + Ogre exporter, they reported some problems but never this one.

you got a NullPointerException because skinning data is missing in your files. normally skinning data is present if skeleton is present and vice-versa. in your case, you manually inserted skeleton but skinning data is missing, that's why you got a NullPointerException

Offline subhalakshmi27

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Ogre to Bones conversion
« Reply #2 on: December 26, 2011, 06:51:55 am »
Hi Raft,

Thanks for the reply. My artist has exported the mesh and skeleton separately in Maya that was the reason for missing skeleton link.

Now the skeleton link is not missing. But when I tried converting to bones I am getting the following error,

Skeleton created out of jME OGRE skeleton, 48 joints
Exception in thread "main" java.lang.NullPointerException
        at raft.jpct.bones.BonesImporter.convertJMEMeshData(BonesImporter.java:4
38)
        at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:193)
        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)

Can you please help me to find the issue.

Thanks and Regards,
Subha

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Ogre to Bones conversion
« Reply #3 on: December 26, 2011, 12:21:21 pm »
are you sure you are using the latest version?

this exception happens when texture coords are missing as mentioned in this thread. but it was fixed


Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
Re: Ogre to Bones conversion
« Reply #4 on: December 28, 2011, 02:11:35 am »
Actually in my machine, i edited the code to ignore the texture entirely and recompiled the library because I  wanted to get passed that NullPointerException to see if I could convert the model to bones... I was desperate! The reason is that I think the blender export module switch or place the order of some attributes elsewhere that cause the converter fails to parse/convert the blender->ogre->bones. I opened my blender->ogre mesh.xml and compare it to the ninja.mesh.xml (in ogre3d/sample/media/models/ sdk folder)

Here is the sample the robot.mesh.xml (same as the ninja.mesh.module)

Code: [Select]
                <vertexbuffer texture_coord_dimensions_0="2" texture_coords="1">
                    <vertex>
                        <texcoord u="0.050098" v="0.570065" />
                    </vertex>
and here is my model exported to ogre3d from blender
Code: [Select]
        <vertexbuffer texture_coords="1" positions="true" colours_diffuse="False" normals="true">
            <vertex>
                <position y="0.236152" x="3.644389" z="-5.458756"/>
                <normal y="0.181068" x="0.010771" z="-0.983412"/>
                <texcoord u="0.745637" v="0.634280"/>
            </vertex>

You can see the exported module has few extra attributes within <vertex>. idk how that effect the converter but after playing/switching few attributes around, I got pass this error and was successfully converted to bones format except the module appears to be really dark.

@raft: sorry for the confusion if my post from other thread misled you.
« Last Edit: December 28, 2011, 02:20:43 am by bili »

Offline Babu

  • int
  • **
  • Posts: 71
    • View Profile
Re: Ogre to Bones conversion
« Reply #5 on: January 09, 2012, 05:33:04 am »
Hi Raft,

The issue was solved after my artist checked "not use shared vertices/geometry"" while exporting the files. Thanks a lot for your help.

Regards,
Subha

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Ogre to Bones conversion
« Reply #6 on: January 09, 2012, 09:15:25 am »
because of a bug in jME importer, Bones couldn't handle shared geometry in Ogre files. but it should be fixed now.