-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix Cinematic initialization and serialization bugs #2560
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
base: master
Are you sure you want to change the base?
Conversation
jme3-core/src/main/java/com/jme3/cinematic/events/AnimEvent.java
Outdated
Show resolved
Hide resolved
jme3-core/src/main/java/com/jme3/cinematic/events/AnimEvent.java
Outdated
Show resolved
Hide resolved
|
Closing because requested changes have not been addressed in a timely manner. |
Updated copyright year and refactored AnimEvent class to use spatialRef for identification. Removed unused model variable and adjusted serialization methods.
Implement dispose method to clean up resources.
|
🖼️ Screenshot tests have failed. The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. 📄 Where to find the report:
✅ If you did mean to change things: ✨ If you are creating entirely new tests: Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar". See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information Contact @richardTingle (aka richtea) for guidance if required |
Refactors and Improves the Cinematic class
This pull request enhances the
Cinematicclass, focusing on better documentation, serialization improvements, and memory management. Key updates include:SavableArrayListserialization/deserialization.Applicationfield to the class, initialized duringinitialize()and passed to event initialization for consistency.clearCameras()method to properly detach and clear all camera nodes from the scene, now called fromcleanup()to avoid memory leaks.initializedflag, clearing events, and removing camera nodes.cinematicEventslist non-final for deserialization.These changes improve maintainability, clarity, and the robustness of cinematic lifecycle management in the engine.
Enhance AnimEvent Serialization and Model Handling
This PR introduces improvements to the
AnimEventclass in thecom.jme3.cinematic.eventspackage by enhancing how animation events are associated with their models and how they are serialized/deserialized. The changes ensure more robust handling ofAnimComposerand the associatedSpatialmodel, especially when saving and loading animation events.Key Changes
Introduced a
private Spatial modelfield toAnimEventto keep track of the model associated with the animation event.modelfield from theAnimComposer.In
initEvent, if thecomposeris not set but themodelis, the code attempts to retrieve the correctAnimComposerfrom the model, ensuring reliable initialization even after deserialization.modelfield is now written to and read from the JME capsules, replacing the direct serialization ofcinematicandcomposerfields (which are no longer serialized).Added a custom
dispose()method to clean up references tocinematicandcomposerwhen the event is disposed, aiding memory management.Updated the copyright year.
Motivation
These changes address issues related to the persistence and restoration of animation events across sessions, improving the reliability of cinematic workflows in jMonkeyEngine. By serializing the model reference and reconstructing the composer as needed, the risk of null references or mismatched state is reduced.
Impact