How to Animate Face and Body Simultaneously

Started by AGP, August 26, 2011, 07:27:21 PM

Previous topic - Next topic

AGP

I have a one-part model of a human. His idle animation loops constantly. When you talk, he is going to repeat what you say, hopefully without interrupting the idle animation. I guess my two questions are: is it at all possible on jPCT with a one-part model and do the OgreMax exporter and jMe importer (and, for that matter, Raft's Bones's animation) support this?

The only thing of which I could think is that I could save several copies of the idle animation doing numerous things with his face and skip around between them (but it wouldn't look perfect--because I couldn't always land on the exact same frame of the idle animation--and it would result in a larger-than-hopefully-necessary file size).

raft

yes that is possible with single model. skeletal and pose animations can be blended. animate body with skeletal animation and face with pose animation. also have a look at animation blend demo.

AGP

#2
Thank you very much, Raft, for pointing me in the right direction. Now, what editor do you usually use? What do you usually use to export the ogre.model.xmls?

AGP

All of the meshes I exported with OgreMesh (ranging from 1.2k poly models to 20k) have crashed with the same message:
[ Sat Aug 27 05:00:19 GMT 2011 ] - ERROR: Can't retrieve object #0!
Exception in thread "main" java.lang.NullPointerException


Any insight into the problem would be extremely appreciated. By the way, OgreMax exports to versions 1.7 and 1.8 of Ogre. I've tried both with the same results.

raft

I use 3dsMax and OgreMax and never experienced problems. can you also post the stack trace?

I'm in holiday now. I will be back at the end of next week

AGP

#5
No problem:
Information: Child "AndersonMesh000" attached to this node "Anderson"
Problem loading file: No controller found in OgreEntityNode. Means there is no skeleton or pose animation!
[ Sat Aug 27 18:27:16 GMT 2011 ] - ERROR: Can't retrieve object #0!
Exception in thread "main" java.lang.NullPointerException
        at OgreLoader.<init>(OgreLoader.java:69)
        at OgreLoader.main(OgreLoader.java:310)

Line 69 is as follows:
SimpleVector cameraPosition = theWorld.getObject(0).getTransformedCenter();

But since getObject(0) is null, it's crashing. Are there any special settings (other, naturally, than to set it to .xml) to which you set OgreMax? Thanks in advance!

Update: It seems that so far I have two choices: get a million printouts of "Warning: rotation axis not normalized" and it exports the .skeleton.xml along with the .mesh.xml (but still crashes with the above message). Or do OgreMax>Normalize Mesh Scaling, not get those messages, but not get a .skeleton.xml file either. And just to make it clear: neither way works for loading these models.

raft

well, the log is quite descriptive: there is no animation in exported file. play with exporter options.

nevermind about rotation axis warnings. jME checks if length of vector is exactly one and prints that warning. due to rounding issues most of the time it's not exactly one.

AGP

#7
The exporter is set to export animations and the xml file has, if nothing else, thousands of pose lines. By the way, I have no problem importing any of your files (the ninja and that cylinder, for two).

raft

that's strange. send me the file but I can look at it earliest this weekend. meanwhile you can debug it ;)

AGP

I can do that. But again, I'm having no trouble importing your own models. I just got the latest OgreMax (2.3.15 or so) version and during installation most recently selected Ogre version 1.8. Do you suppose either of these choices could be the problem?

raft

maybe but I don't think so. can you open exported file in OgreMax's viewer and see animation there?

AGP

The OgreMax viewer as far as I could tell only opens binary files, not the XML ones. I'll export to binary and report back in a sec.

AGP

That was a useful test, thank you. Indeed, the binary .mesh isn't moving in the OgreMax WinViewer (still it loads on WinViewer, which is better than crashing). But my model is animated and OgreMax is set to export the animation, so that's very odd. Are you willing to post all your scene, object, and global settings so we could compare notes and we could put it in the wiki for future reference?

raft

I can do that but there was nothing fancy.

for crashing, Bones is an animation library. it's not a scene loader, so I think that behaviour is correct  ;)

AGP

Hey, I knew it would be a rookie thing: I didn't know you had to do OgreMax>Object Settings>Mesh Animations ADD and specify the frames you wanted to export. My settings were such that a box was checked for "export animation" I hadn't specified what was my animation. This should definitely go into the wiki to prevent future newbies from wasting a day on it.