'clone' method of Animation object doesn't work...

gr8tact

16-04-2007 08:32:37

I wrote like this:


def cloneAnimation( entity, srcName, destName ):
skel = entity.getSkeleton()
srcAnim = skel.getAnimation( srcName )
srcAnim.clone( destName )


and... an exception raised


srcAnim.clone( destName )
OgreItemIdentityException: OGRE EXCEPTION(4:): Node track with the specified handle 0 already exists in Animation::createNodeTrack at \Development\ogrenew\OgreMain\src\OgreAnimation.cpp (line 73)


In C++, 'Ogre::Animation::clone(...)' works well :)

So I rewrite first code like this. works well.


def cloneAnimation( entity, srcName, destName ):
skel = entity.getSkeleton()
srcAnim = skel.getAnimation( srcName )
newAnim = skel.createAnimation( destName, srcAnim.getLength() )

for i in xrange( srcAnim.getNumNodeTracks() ):
nt = srcAnim.getNodeTrack(i)
newNT = newAnim.createNodeTrack( nt.getHandle(), nt.getAssociatedNode() )
for j in xrange( nt.getNumKeyFrames() ):
kf = nt.getNodeKeyFrame(j)
newKF = newNT.createNodeKeyFrame( kf.getTime() )
newKF.setTranslate( kf.getTranslate() )
newKF.setScale( kf.getScale() )
newKF.setRotation( kf.getRotation() )
skel._refreshAnimationState( entity.getAllAnimationStates() )



And... I think this is python-ogre's bug. Right?

:D plz review about this

best regards!

andy

16-04-2007 10:37:41

Yes it's a bug -- although I'm not sure what's happening yet.

If you get a chance can you report it as a new Ticket on the Python-Ogre.ogre web site (so we can track it)

Cheers
Andy

gr8tact

16-04-2007 11:30:07

I submitted ticket. :)

Cheers!

@ thanx for doing great project. I love python-ogre

saladin

05-07-2007 14:01:22

I submitted ticket. :)

Cheers!

@ thanx for doing great project. I love python-ogre


I see this problem persists in 1.0RC2. Is it being fixed?

andy

06-07-2007 15:57:04

In the end I think it turned out to be a bug in Ogre as I had exactly the same error when I ran this test code in C++..

If you could find some test C++ code that is meant to work then I'll be happy to revisit the issue..

Cheers

Andy

smernesto

23-12-2007 22:59:35

Bug was fixed for Ogre 1.4.6