Skip to content

Allow Python callers to set mesh data on Savitar scene nodes - #10

Merged
HellAholic merged 1 commit into
mainfrom
CURA-13270_expose_setMeshData
Jul 31, 2026
Merged

Allow Python callers to set mesh data on Savitar scene nodes#10
HellAholic merged 1 commit into
mainfrom
CURA-13270_expose_setMeshData

Conversation

@HellAholic

@HellAholic HellAholic commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

getMeshData() became const in libSavitar to enforce read-only access through the getter. Expose the existing setMeshData() via the SIP binding so Python code can correctly write mesh data through the dedicated setter instead of mutating the getter's return value. (TLDR: Should allow saving 3mf files and copying the models)

Required by:
Ultimaker/Cura#21730

CURA-13270

getMeshData() became const in libSavitar to enforce read-only access through the getter. Expose the existing setMeshData() via the SIP binding so Python code can correctly write mesh data through the dedicated setter instead of mutating the getter's return value. (TLDR: Should allow saving 3mf files and copying the models)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Changes make a whole lot of sense. I am just afraid that this issue is more widely spread throughout the (cura) codebase, and python does not have catch this at compile time we will only encounter the issue when we encounter the execution path.

@HellAholic

Copy link
Copy Markdown
Contributor Author

I checked the imports of pySavitar in Cura, the locations that I could find were 3mf Writer & Reader (import pySavitar as Savitar) https://github.com/Ultimaker/Cura/blob/516d2a0075535a439c9f6e354c475312793a316d/plugins/3MFReader/ThreeMFReader.py#L8
https://github.com/Ultimaker/Cura/blob/516d2a0075535a439c9f6e354c475312793a316d/plugins/3MFWriter/ThreeMFWriter.py#L34

The reader logic did not seem to be affected as it did not try to mutate through getData. The writer was updated in the PR.
The rest of the operations were using the UM's implementation so they should be unaffected as that is not linked to the pySavitar.
🤞 🤞 🤞

@HellAholic
HellAholic merged commit 74cbe2b into main Jul 31, 2026
8 checks passed
@HellAholic
HellAholic deleted the CURA-13270_expose_setMeshData branch July 31, 2026 06:02
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.

2 participants