Animation problems

Problems building or running the engine, queries about how to use features etc.
Post Reply
Slougi
Kobold
Posts: 34
Joined: Thu Dec 30, 2004 2:12 am
Contact:

Animation problems

Post by Slougi »

Hi all,
I've been experimenting with Ogre for a while now; seems like a pretty cool engine. I created a simple mesh with skeletal animation in 3Dmax, exported it to OgreXML format, and then converted it to .mesh and .skeleton files.

It's a biped, but when I tried selecting the biped option in the exporter the maxscript fails with the following error:
Unknown property "getnode" in undefined
The line in the script itself is return ((biped.getnode bipobj 13) == bipobj);

So I ended up exporting without the biped option on, I am not sure what the effects of that are.

So, two questions:
1) Why is the animation not working properly :)
2) Why is the script failing with the biped option on?

Any help would be appreciated :)

P.S.: It's 3Dmax version 6.0
P.P.S: The code:

Code: Select all

class Animator : public Ogre::FrameListener
{
public:
	Animator(Ogre::Entity* object, Ogre::String animation)
	{
		mObject = object;
		mAnimationName = animation;
		mAnimation = mObject->getAnimationState(mAnimationName);
		mAnimation->setEnabled(true);
		time = 0;
	}

	bool frameStarted(const Ogre::FrameEvent& evt)
	{
		time = evt.timeSinceLastFrame;
		mAnimation->addTime(time);
		return true;
	}
protected:
	Ogre::Entity* mObject;
	Ogre::String mAnimationName;
	Ogre::AnimationState* mAnimation;
	Ogre::Real time;
};
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

The exporter that is using a "This skeleton is a biped" option is pretty old. In the latest one, the detection of the skeleton type is automatic.

Please use the latest one as it fixes a lot of issues and bugs. You can download it on the Ogre website in the Download/Tools section. But I suggest you use the version from CVS which is even more up-to-date.
Banania
Slougi
Kobold
Posts: 34
Joined: Thu Dec 30, 2004 2:12 am
Contact:

Post by Slougi »

Ah thanks a lot.
Slougi
Kobold
Posts: 34
Joined: Thu Dec 30, 2004 2:12 am
Contact:

Post by Slougi »

Another problem popped up. The mesh, animations and materials all export fine; the animation was subdivided in the exporter into 4 new ones: "FirstStep", "Walking", "LastStep", "Standing".

Now when trying to convert the skeleton.xml and .skeleton:

Code: Select all

$ OgreXMLConverter smilieman3.skeleton.xml

-- OPTIONS --
source file      = smilieman3.skeleton.xml
destination file = smilieman3.skeleton
interactive mode = false
lod levels       = none (or use existing)
-- END OPTIONS --

XMLSkeletonSerializer: reading XML data from smilieman3.skeleton.xml...
XMLSkeletonSerializer: Reading Bones name...
XMLSkeletonSerializer: Reading Hierarchy data...
XMLSkeletonSerializer: Reading Bones data...
XMLSkeletonSerializer: Reading Animations data...
Animation: nom: FirstStep et longueur: 3
Aborted
$
Any Ideas? :?
Slougi
Kobold
Posts: 34
Joined: Thu Dec 30, 2004 2:12 am
Contact:

Post by Slougi »

Ok I found the problem. In the skeleton.xml there are several animations with the same name; renaming them properly and then converting them them fixes it.

I did give unique names to the exporter; is this a bug in the exporter or is there some "gotcha" I have to be aware of when using it?
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

There might be a bug. I will have to check this...

EDIT : I have checked the code and don't see anything wrong so far. But I did not have the opportunity to do some testing yet.
Banania
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

Alright, I found the bug.

It will be fixed a little later though. I don't have access to my computer right now....
Banania
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

I commited the fix this morning and completely forgot to post here.

So, the fix is in CVS now.
Banania
Slougi
Kobold
Posts: 34
Joined: Thu Dec 30, 2004 2:12 am
Contact:

Post by Slougi »

Thanks a lot, I'll test it asap!
DM.Brandon
Gnoblar
Posts: 4
Joined: Tue Nov 23, 2004 5:07 pm
Location: Winter Park, FL
Contact:

Problems Exporting Animation

Post by DM.Brandon »

Hey Banania,

I am having a problem with exporting my animations for my model.
There is a warping effect with the skeleton. It looks like it is exporting the mesh properly, but there is a problem with the skeleton I think or it is the animation. I don't have a webpage to put a link to the file. so I could email it to you if you would like.

DM.Brandon

Correction: there is a link to it on our website now. it is http://www.darkmatterdev.com under models
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

http://www.ogre3d.org/phpBB2/viewtopic.php?t=7116

Have a look at this post. It might be what you are experiencing. I just can't reach your website right now but don't worry, I will have a look asap.
Banania
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

No, seems it is not the same problem. Too bad...

Can an artist please have a look at it to see if there is something terribly wrong I might have missed ? Because I am stumped for now ....
Banania
DM.Brandon
Gnoblar
Posts: 4
Joined: Tue Nov 23, 2004 5:07 pm
Location: Winter Park, FL
Contact:

hmm

Post by DM.Brandon »

Did you see what I mean? I am trying various things. I had an old version of the model that worked correctly. This new one doesn't so I am trying to see if I use my old model's skeleton and the new mesh file or vice versa. The old file has the same skeleton structure with the same number of bones so I am thinking it either is the animations or it is the mesh may be the wrong size I am not really sure though. I am not sure if it is a model problem because the animations look correct in max so I am not sure. I will let you know what I find out. If you are able to figure it out I would much appreciate it
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Re: hmm

Post by Banania »

DM.Brandon wrote:Did you see what I mean?
Yes, I saw a big problem in the legs of your character but still don't know where it is coming from. I thought maybe there was a problem with the vertex weights and I still think it is the best explanation but after checking, I can't find anything wrong.

If you do some testing with another skeleton, let me know what happens, that might give me some ideas.
Banania
DM.Brandon
Gnoblar
Posts: 4
Joined: Tue Nov 23, 2004 5:07 pm
Location: Winter Park, FL
Contact:

Found the error

Post by DM.Brandon »

I was able to duplicate the error by taking the old model and scaling him to the size the new model is. By doing that I got the leg warping effects. So I was wondering if there was anything I could do to fix this easily besides scaling all of the new models down, which does seem to lessen the warping effect. if you scale it down to like a third
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

Scaling the model down is not a proper solution because it doesn't solve the problem, it just makes it less noticeable. However, I still don't have an answer for you. Sorry...
Banania
DM.Brandon
Gnoblar
Posts: 4
Joined: Tue Nov 23, 2004 5:07 pm
Location: Winter Park, FL
Contact:

scaling

Post by DM.Brandon »

Hey Banania I am almost positive the issue has to do with scaling somehow because we got that model at the original size which was smaller and it works properly but when we scale him up the problem shows himself
User avatar
Banania
Gremlin
Posts: 150
Joined: Wed Oct 20, 2004 2:35 pm
Location: Paris, France
Contact:

Post by Banania »

maybe.... I'll look into when I have some time. Unfortunately, I don't have much time these days.... :cry:
Banania
Post Reply