Author Topic: Bad Animation Parsing  (Read 5915 times)

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Bad Animation Parsing
« on: April 15, 2012, 06:11:04 am »
I've looked at my skeleton.xml file and other than the animations being in alphabetical order, it looks right, but when I try to play a given animation, it leaks to the next one (meaning, the parsing isn't right).

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Bad Animation Parsing
« Reply #1 on: April 15, 2012, 06:21:21 am »
By the way, since OgreMax was exporting correctly, I tried exporting each animation as a separate skeleton file. But this crashes the loader with a message claiming there are no pose animations. Is there a way for me to try this that doesn't crash it?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Bad Animation Parsing
« Reply #2 on: April 15, 2012, 03:09:05 pm »
but when I try to play a given animation, it leaks to the next one (meaning, the parsing isn't right).
I'm not sure I understand what you mean here

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Bad Animation Parsing
« Reply #3 on: April 15, 2012, 03:10:24 pm »
By the way, since OgreMax was exporting correctly, I tried exporting each animation as a separate skeleton file. But this crashes the loader with a message claiming there are no pose animations. Is there a way for me to try this that doesn't crash it?
post the stack trace please

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Bad Animation Parsing
« Reply #4 on: April 15, 2012, 07:08:24 pm »
Not very interesting. It crashes because my loader assumes the model is there and does SimpleVector cameraPosition = theWorld.getObject(0).getTransformedCenter():

Problem loading file: No controller found in OgreEntityNode. Means there is no s
keleton or pose animation!
[ Sun Apr 15 01:19:50 BRT 2012 ] - ERROR: Can't retrieve object #0!
Exception in thread "main" java.lang.NullPointerException
        at OgreLoader.<init>(OgreLoader.java:69)
        at OgreLoader.main(OgreLoader.java:335)

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Bad Animation Parsing
« Reply #5 on: April 16, 2012, 07:30:46 am »
So again, what is the correct way to load the model with individual .skeleton.xml per animation? My way is producing the following message.

Problem loading file: No controller found in OgreEntityNode. Means there is no s
keleton or pose animation!

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Bad Animation Parsing
« Reply #6 on: April 16, 2012, 10:15:02 am »
well as the error says, there is no animation in that file. possibly your exporter does not export it because of something..

if you are sure, that's not the case (by manually inspecting skeleton.xml) send me the mesh and skeleton files and let me have a look

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Bad Animation Parsing
« Reply #7 on: April 16, 2012, 05:52:55 pm »
Then please PM me your e-mail address.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Bad Animation Parsing
« Reply #8 on: April 16, 2012, 11:11:14 pm »
I had looked at your skeleton file. it contains animationlink elements which are references to other animation files. unfortunately seems as jME Ogre loader does not load them. does your exporter have any options to embed all animations into skeleton.xml file?

I will try to have a look at jME loader and made it load such external files but no promises about when and it will be done ;)

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Bad Animation Parsing
« Reply #9 on: April 17, 2012, 03:30:06 am »
That's right, because of the bad parsing (let's not go into it again), I exported the individual animations separately. If not automatically reading all your animationLinks, what about something like Skeleton.addAnimation(String xmlFile)?

So to explain the initial problem: say I had two animations, a walk and a run. The model was being loaded such that the end of "walk" was the beginning of "run." It must come from bad parsing, as the animations had the right number of frames in the skeleton.xml file, so I split them into separate xml files. Which brings us to this current problem, whereby the loader doesn't load the animationLink references in the main skeleton.xml.
« Last Edit: April 17, 2012, 05:03:25 am by AGP »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Bad Animation Parsing
« Reply #10 on: April 17, 2012, 11:57:43 am »
Quote
what about something like Skeleton.addAnimation(String xmlFile)?
Bones do not do parsing the xml file. it depend on jME's loader. I prefer it stay this way, so such a method is not an option at the moment

Quote
So to explain the initial problem: say I had two animations, a walk and a run. The model was being loaded such that the end of "walk" was the beginning of "run."
I still dont understand what the problem is here. Maybe a drawing or something may help

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Bad Animation Parsing
« Reply #11 on: April 17, 2012, 05:43:55 pm »
I'm not sure how a drawing could help. But modifying the loader to load the animationLinks would do it.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Bad Animation Parsing
« Reply #12 on: April 17, 2012, 05:53:31 pm »
It would help me understand the problem.

How are you sure that it's exported correctly but loaded incorrectly? have you tried to open exported animation in another viewer, OgreMax's viewer for example?

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Bad Animation Parsing
« Reply #13 on: April 17, 2012, 06:00:13 pm »
Yes, the binary one load right on the viewer. And the XML file has the right number of frames for the animations.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Bad Animation Parsing
« Reply #14 on: April 17, 2012, 06:03:18 pm »
ok, please send me the incorrectly loaded xml files