Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix stopping and removing animclip when deleting them #578

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

neph1
Copy link
Contributor

@neph1 neph1 commented Mar 10, 2024

Fixes #577

setChanged();
} catch (InterruptedException | ExecutionException ex) {
Exceptions.printStackTrace(ex);
if (playing) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stops the animation if it's playing

lookupContents.remove(this);
SceneApplication.getApplication().enqueue( () -> {
control.removeAnimClip(this.animClip);
SwingUtilities.invokeLater(() -> jmeControl.refresh(false));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to refresh after the anim has been removed from the control


@Override
public void refresh(boolean immediate) {
((JmeAnimClipChildren) jmeChildren).refreshChildren(immediate);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refresh only happens if they are JmeSpatialChildren per default 🤷

@neph1 neph1 merged commit 9ec2cc3 into jMonkeyEngine:master Mar 11, 2024
1 check passed
@neph1 neph1 added this to the 3.7 milestone Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error while deleting an AnimClip
2 participants