Allow Python callers to set mesh data on Savitar scene nodes - #10
Conversation
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)
Casper Lamboo (casperlamboo)
left a comment
There was a problem hiding this comment.
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.
|
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 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. |
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