-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Show layer height in Simulation View slider labels #21201
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
Conversation
Adds display of the current and minimum layer heights (in mm) to the Simulation View slider labels. Implements new properties and logic in SimulationView and SimulationViewProxy to retrieve accurate layer heights for both sliced and gcode data. Bumps plugin version to 1.1.0.
| @pyqtProperty(float, notify=currentLayerChanged) | ||
| def currentLayerHeight(self): | ||
| return self._simulation_view.getCurrentLayerHeight() | ||
|
|
||
| @pyqtProperty(float, notify=currentLayerChanged) | ||
| def minimumLayerHeight(self): | ||
| return self._simulation_view.getMinimumLayerHeight() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will recalculate (go through the entire scene, for every layer) each time, every time you request an update.
Please cache this at the very least, but even better, just go through the layers once on receiving them, and then save all of that; then you can query that structure.
Introduced a cache for layer heights to avoid recalculating them on every query. Added a method to populate the cache for all layers at once, and updated layer height retrieval methods to use the cache, improving efficiency when accessing layer height data.
|
"Feature Request" #7683 is slightly different. They wanted the "Time Remaining" added to the slider as well. |
|
For displaying Time we need to return time per layer from the engine side, the layer message only has id, height, thickness. |
|
it works for me with aldos tabbed & sidebar plugins apart from a niche case where if I'm in the preview tab, change a setting, hit slice, wait for the model to grey out then switch to the prepare tab while it's slicing. When the slice completes & I switch back to the preview tab wherever the slider is reports 0.00mm until I move the slider where it starts to display the height again. I didn't see this scenario as worthy of a bug post given the minimal impact |
Added logic to track which node's layer heights are cached and only recalculate the cache if the data source changes. This improves performance by avoiding unnecessary recalculations and ensures cache validity when the scene changes.
Updated the caching logic in SimulationView to use the id of the layer_data object instead of the node. This ensures the cache is correctly invalidated when layer_data changes, preventing potential issues when nodes are reused.
|
I added the last commit and it looks good now. |
rburema
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Another long-time feature request bites the dust. Congratulations!! (No one will ever know that it was all because you didn't want to write a calculator into "HellaFusion") |
|
I'm too lazy to write it in the plugin, I'll do many times the work just to avoid the work 🤣 |


Description
Adds display of the current and minimum layer heights (in mm) to the Simulation View slider labels. Implements new properties and logic in SimulationView and SimulationViewProxy to retrieve accurate layer heights for both sliced and gcode data. Bumps plugin version to 1.1.0.





Adaptive layer height + Raft
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: