Skip to content

Conversation

@HellAholic
Copy link
Contributor

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.
image
image
image
image
Adaptive layer height + Raft
image

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Load model, Slice and inspect the heights (with extra settings such as Raft / Adaptive layer)
  • Load Gcode, inspect the heights
  • Initiate @GregValiant protocol

Test Configuration:

  • Operating System:
  • Windows 11

Checklist:

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.
@HellAholic HellAholic added Type: Improvement Improvement to existing functionality. PR: Community Contribution 👑 Community Contribution PR's labels Dec 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Test Results

24 506 tests  ±0   24 504 ✅ ±0   51s ⏱️ +8s
     1 suites ±0        2 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit f5a9cb2. ± Comparison against base commit 9edd99f.

♻️ This comment has been updated with latest results.

@GregValiant
Copy link
Collaborator

GregValiant commented Dec 9, 2025

This is outstanding. The term "Totally bad-ass" comes to mind.
I found 3 Feature Requests that relate to this:
#20347
#5744
#6179

Comment on lines +49 to +55
@pyqtProperty(float, notify=currentLayerChanged)
def currentLayerHeight(self):
return self._simulation_view.getCurrentLayerHeight()

@pyqtProperty(float, notify=currentLayerChanged)
def minimumLayerHeight(self):
return self._simulation_view.getMinimumLayerHeight()
Copy link
Member

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.
@GregValiant
Copy link
Collaborator

"Feature Request" #7683 is slightly different. They wanted the "Time Remaining" added to the slider as well.

@HellAholic
Copy link
Contributor Author

For displaying Time we need to return time per layer from the engine side, the layer message only has id, height, thickness.
The data we use for the print time estimation on the front end also doesn't contain per layer info, it only has the per feature times.
Parsing the gcode does not seem like a good approach so I don't think the time part can be done neatly within this feature from front-end only.

@GregValiant
Copy link
Collaborator

Everything was working fine until I started playing with Aldo's plugins (trying to get them to work in 5.11).
I have not re-installed Cura, but I think I need to.
I did re-install the files for the Simulation View, and deleted "Sidebar GUI" and "Tabbed Settings" but I still get a label showing a height of "0.00mm" at all layers.

image

@PartySausage
Copy link

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.
@GregValiant
Copy link
Collaborator

I added the last commit and it looks good now.

@PartySausage
Copy link

I added the last commit and it looks good now.

Still working here too. The observation I made above still exists but I could live with that

I did tinker with my install of the SimulationSliderLabel.py so the layer height box matches the height of layer no. box. I don't know if it would work for everyone or if you think that is worthy of a change to the official version

image

SimulationSliderLabel.zip

Copy link
Member

@rburema rburema left a comment

Choose a reason for hiding this comment

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

LGTM!

@HellAholic HellAholic merged commit e5508f5 into main Dec 19, 2025
2 checks passed
@HellAholic HellAholic deleted the SimulationView_display_height_plugin_update branch December 19, 2025 09:14
@GregValiant
Copy link
Collaborator

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")

@HellAholic
Copy link
Contributor Author

I'm too lazy to write it in the plugin, I'll do many times the work just to avoid the work 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Community Contribution 👑 Community Contribution PR's Type: Improvement Improvement to existing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants