Making a copy of an animation

Problems building or running the engine, queries about how to use features etc.
Post Reply
Ieet
Greenskin
Posts: 114
Joined: Wed Feb 21, 2007 12:45 pm
Location: Hellworld

Making a copy of an animation

Post by Ieet » Wed Apr 04, 2007 11:42 am

Hi all,

I have run into a problem. What I want to do is to make a copy of an animation to have stored in memory, so that I can delete individual bones animations. I use destroyNodeTrack to do this.

However, then I want at a later time to revert and use the original animation. Therefor I want this one saved so I can restore it.

Is there any way to make a copy of an animation with a new name and to revert to that one?

Unworking try code:

Code: Select all

Ogre::SkeletonInstance* skel = entity->getSkeleton(); 
	Ogre::Animation* a = skel->getAnimation("idle");
	Ogre::Animation* a2 = skel->getAnimation("open_mouth");

	// create animation a2.
	if( entity->hasSkeleton() ) {
		LogManager::getSingleton().logMessage("Copying Animation : ");
		Ogre::Skeleton::BoneIterator it = entity->getSkeleton()->getBoneIterator();
		while( it.hasMoreElements() ) {
			Ogre::Bone* bone = it.getNext();

			a2->createNodeTrack(bone->getHandle());
			a2->getNodeTrack(bone->getHandle()) = a->getNodeTrack(bone->getHandle());
			}
	}
Thank you in advance.
0 x

Ieet
Greenskin
Posts: 114
Joined: Wed Feb 21, 2007 12:45 pm
Location: Hellworld

I guess there is no easy way to do it.

Post by Ieet » Tue Apr 10, 2007 9:08 am

I guess there is no easy way to do it??
0 x

Post Reply