-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add copy, paste, cut functionality #16383
Conversation
cura/CuraActions.py
Outdated
# Parse the scene from the clipboard | ||
scene_string = QApplication.clipboard().text() | ||
|
||
mesh_reader = application.getMeshFileHandler().getReaderForFile(".3mf") |
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.
Derp. I didn't notice this the previous time. But you can actually disable 3mf reader
If the user did this, there won't be mesh_reader returned here.
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.
You could make the 3mf reader a required plugin, or you could disable copy/paste if the plugin is not available.
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.
c393d91, this change also required a change in uranium: Ultimaker/Uranium@83f88ac
In response to the screen recording above: people are going to complain that the resulting objects get auto-arranged, disregarding the original relative positions. One of the main usecases for copy/paste - I imagine - would be to create grids. |
This PR adds copy, past and cut of buildplate models to cura.
Screen.Recording.2023-08-04.at.13.25.29.mov
Copy/paste works even after a model has been deleted for the build plate (no reference is needed to the orginal model). This works by writing the serialized model data to the clipboard. As a consequence a users clipboard might look similar to this after using cura
After a model has been pasted the newly added objects are automatically selected.
The "cut" functionality is also added which simply works by sequencing the copy and delete selected actions.
https://github.com/Ultimaker/Cura/blob/f07faac4223d3d15d36b486e1fce18a84ea55fb0/cura/CuraActions.py#L191C6-L193
Copy paste cut can be executed by either pressing
ctrl+c
,ctrl+v
,ctrl+x
keys or by the right click context menuCURA-7912