www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: AGP on April 15, 2012, 06:11:04 am

Title: Bad Animation Parsing
Post by: AGP 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).
Title: Re: Bad Animation Parsing
Post by: AGP 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?
Title: Re: Bad Animation Parsing
Post by: raft 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
Title: Re: Bad Animation Parsing
Post by: raft 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
Title: Re: Bad Animation Parsing
Post by: AGP 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)
Title: Re: Bad Animation Parsing
Post by: AGP 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!
Title: Re: Bad Animation Parsing
Post by: raft 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
Title: Re: Bad Animation Parsing
Post by: AGP on April 16, 2012, 05:52:55 pm
Then please PM me your e-mail address.
Title: Re: Bad Animation Parsing
Post by: raft 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 ;)
Title: Re: Bad Animation Parsing
Post by: AGP 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.
Title: Re: Bad Animation Parsing
Post by: raft 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
Title: Re: Bad Animation Parsing
Post by: AGP 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.
Title: Re: Bad Animation Parsing
Post by: raft 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?
Title: Re: Bad Animation Parsing
Post by: AGP 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.
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 06:03:18 pm
ok, please send me the incorrectly loaded xml files
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 07:44:34 pm
well, I've converted xml files to Ogre's native (binary) form with OgreXMLConverter and opened with OgreMax viewer. The animation is the same as Bones renders.

How do you convert them from Ogre binary to xml? Maybe that's the faulty part?
Title: Re: Bad Animation Parsing
Post by: AGP on April 17, 2012, 07:49:37 pm
No, I just have OgreMax save the XMLs. There's no binary-XML conversion on my part.
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 07:54:18 pm
Yes, the binary one load right on the viewer. And the XML file has the right number of frames for the animations.
then which binary were you talking about here?
Title: Re: Bad Animation Parsing
Post by: AGP on April 17, 2012, 08:01:46 pm
The binary that OgreMax also exports.
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 08:08:44 pm
I see. then try this: export to binary and convert to xml with OgreXMLConverter and see if that helps
Title: Re: Bad Animation Parsing
Post by: AGP on April 17, 2012, 08:16:13 pm
If it does, will you please nevertheless fix the importer?
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 08:21:55 pm
I don't think there is a problem with importer. which is I'm trying to show you
Title: Re: Bad Animation Parsing
Post by: AGP on April 17, 2012, 08:28:21 pm
There's no problem with the exporter, as I've argued. There might be a problem with the OgreXMLConverter, but since OgreMax converts the exact same data in both binary and XML forms, there's no need to go through that tool. I am, nevertheless, testing it. If the result works with your loader, it means that your loader misses by the same amount as the OgreXMLConverter. But I've talked to Derek (the OgreMax developer), and he assured me that the binary and XML files are identical (and it looks a lot like that to me, by simply comparing the number of frames with the data in Max's Mixer).
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 08:36:04 pm
well, OgreMax viewer and Bones renders same output. it is very unlikely that Bones and OgreXmlConverter do the exact same mistake while importing.
Title: Re: Bad Animation Parsing
Post by: AGP on April 17, 2012, 08:39:48 pm
It would make sense, if whoever wrote the importer used OgreXMLConverter, wouldn't it? I just e-mailed Derek again: OgreMax 2.41's output files for both Ogre 1.7 and Ogre 1.8 isn't working with OgreXMLConverter. I'm just going to have to wait for his response.
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 08:48:35 pm
importer is pure java. it doesn't use any other tool
Title: Re: Bad Animation Parsing
Post by: AGP on April 17, 2012, 09:08:56 pm
That's not my point: if whoever wrote it tested against the output of OgreXMLConverter, it would make sense for it to load wrong by the same margin as OgreXMLConverter.
Title: Re: Bad Animation Parsing
Post by: raft on April 17, 2012, 09:26:30 pm
very very unlikely IMHO. I've never seen importer making such a mistake. and it loads all your animations correct except this one
Title: Re: Bad Animation Parsing
Post by: AGP on April 19, 2012, 05:48:21 am
I must be using OgreXMLConverter wrong, because Derek says that internally OgreMax uses it to write the XMLs too, although it doesn't go through for me. But anyway, what's the one animation that you think isn't right ("it loads all your animations correctly except this one")? From where I'm standing, all animations leak into their following ones.
Title: Re: Bad Animation Parsing
Post by: raft on April 19, 2012, 08:35:56 am
i dont think this is OgreXMLConverter related. IMHO this must be something related to your export options.

try increasing key frames. if there are no or very little space (free time) among your animations, try increasing that.
Title: Re: Bad Animation Parsing
Post by: AGP on April 19, 2012, 04:58:53 pm
There's no space between them, but then I just had OgreMax read the animation data straight from the Mixer, which is how it's done now (you no longer do it manually).