[2.1] Bug OgreSkeletonInstance setSceneNodeAsParentOfBone

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
Gdlk
Halfling
Posts: 53
Joined: Mon Dec 05, 2011 9:43 pm

[2.1] Bug OgreSkeletonInstance setSceneNodeAsParentOfBone

Post by Gdlk » Mon Nov 26, 2018 4:30 pm

Hello!

I think it could be a bug in the setSceneNodeAsParentOfBone method:
- First call setSceneNodeAsParentOfBone with a nodeParent to be set to the bone
- Then call again, but use nullptr like nodeParent, so we can remove the attachment

The first if (line 340) will go in (because the bone exists in the mCustomParentSceneNodes), so we would call nodeParent->_detachBone although the nodeParent is nullptr =(. Also, when call the second time using a not null nodeParent, it crash when try to detach the bone.

I think the right code must be this:

Code: Select all

if( itor != end && itor->boneChild == bone )
{
    itor->sceneNodeParent->_detachBone( this, itor->boneChild );
    efficientVectorRemove( mCustomParentSceneNodes, itor );
}
Best regards!
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4116
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 243
Contact:

Re: [2.1] Bug OgreSkeletonInstance setSceneNodeAsParentOfBone

Post by dark_sylinc » Mon Nov 26, 2018 6:20 pm

Indeed, your fix is what the code should be doing. Fix pushed.

Thanks!
0 x

Post Reply