jMonkeyEngine / sdk

The jMonkeyEngine3 Software Development Kit based on Netbeans
BSD 3-Clause "New" or "Revised" License
312 stars 100 forks source link

Error while deleting an AnimClip #577

Closed capdevon closed 2 months ago

capdevon commented 2 months ago

If you delete an animation that is currently playing, the character continues to move with the deleted animation and the animation tree breaks oddly showing empty icons at the removed animation.

Perhaps the correct order of operations should be:

                if (animComposer.getCurrentAction() == animComposer.getAction(clipName)) {
                    animComposer.reset();
                }
                AnimClip clip = animComposer.getAnimClip(clipName);
                animComposer.removeAction(clipName);
                animComposer.removeAnimClip(clip);
                refreshAnimTree();

image

image

neph1 commented 2 months ago

Which class is that?

capdevon commented 2 months ago

I don't know, the code snippet is just a guess I made.

neph1 commented 2 months ago

Deleting AnimClips don't remove them from the list, even if it's not playing, right? I can stop the animation, removing it proved much harder :)