-
-
Notifications
You must be signed in to change notification settings - Fork 67
Conversation
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.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #273 +/- ## ========================================== - Coverage 94.56% 94.52% -0.04% ========================================== Files 47 47 Lines 9144 9154 +10 ========================================== + Hits 8647 8653 +6 - Misses 497 501 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9e35ddf to
eac5a4b
Compare
camUrban
commented
Aug 10, 2026
Hi @BorniaPedro. I'm a bit busy with work at the moment, so I won't be able to review this until next week. Thank you for putting in the time to contribute, it means a lot!
@camUrban
camUrban
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.
Hi @BorniaPedro. Apologies for the delay in getting a review out for this PR. I think you did a great job implementing what I suggested in #265, but interacting with this method made me re-think the approach. The main issue with my spec is that some methods of re-sizing windows (e.g., maximizing and snapping) are unobservable to PyVista. Even if we made a workaround, I think it's very likely there will be some edge case on some OS that we don't or can't cover.
I think a better approach may be to just render the saved scene off-screen, where we can specify the exact window size without any interference. This does leave an open question: should still show the rendering frame-by-frame of the preview render? If a user manually re-sized, it will look slightly different than what is saved, and it costs another scene creation per-frame. However, if we drop it, that might surprise users or make the function appear to be frozen. Perhaps a middle ground approach would be to display a text message that the animate render is in progress, while keeping the preview window open, frozen on the preview frame. What are your thoughts?
If you are interesting in working on whatever method we settle on, feel free to continue implementing it in this PR. No pressure if not! Either way, thank you for the work you've put in thus far.
Uh oh!
There was an error while loading. Please reload this page.
Description
Locks the render window size in
drawandanimatethrough a two-layer strategy using a VTKConfigureEventobserver during interactive phases and explicitSetSizere-assertions during non-interactive rendering passes.Motivation
Dragging, maximizing, or tile-snapping the render window after creation caused screenshots to capture at the resized live window dimensions while text sizes and line widths remained scaled to the initial requested
window_size. Additionally, window resizes during the rendering loop ofanimateresulted in frames of varying dimensions, causingwebp.save_imagesto fail deep in its CFFI layer with anAttributeError: cdata 'struct WebPAnimEncoder *' points to an opaque type. Enforcing the requested window size in both interactive and rendering phases guarantees that saved outputs consistently match the requested dimensions and styling scale.Relevant Issues
Fixes #265
Changes
ConfigureEventobserver to the interactor indrawandanimateto snap the render window back to the requested dimensions viaSetSizeupon OS-level resizes.SetSizeon the render window prior to taking the screenshot indrawand before rendering each frame inanimate.Dependency Updates
None.
Change Magnitude
Minor: Small change such as a bug fix, small enhancement, or documentation update.
Checklist (check each item when completed or not applicable)
mainand is up to date with the upstreammainbranch.--in-place --black). See the style guide for type hints and docstrings for more details.pterasoftwarepackage use type hints. See the style guide for type hints and docstrings for more details.testspackage.testspackage.ascii-only,pre-commit-hooks, andzizmorGitHub actions.lintjob of theCIGitHub action.testjobs of theCIGitHub action.