Summary: | python copy paste selection - Paste issue (not paste action) | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | keyth_qcfx2 <keyth2363214> |
Component: | Scripting | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED INTENTIONAL | ||
Severity: | normal | CC: | griffinvalley, halla, scottpetrovic |
Priority: | NOR | ||
Version: | 4.2.8 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | copy paste code |
Description
keyth_qcfx2
2020-01-29 18:11:54 UTC
Created attachment 125525 [details]
copy paste code
just some code that copies the selection and then pastes it.
file : https://ufile.io/uu1g1myk this file is just a random image with a active selection on it running the code will give the same exact result as in the video. I am not getting errors with this in Krita Version: 4.3.0-prealpha (git 33e8716), Qt version compiled: 5.13.2, loaded: 5.13.2. Process ID: 25526 it only starts doing something funny here when I do it twice. only on the 2nd try? with me it does it right away every time, on the recording I opened krita with 2 grid lines a selection and a random image and nothing else. You think is a problem in the code I made (like in the sequence order or is it lacking some other command then) or is it really in the paste command then? I tryed to look up as much info as I could on the topic but I can't say for certain, but my feeling is that it's on the command itself somewhere. I compared the C++ file and the Python one, and the python one looked to lack some cases inside (but I dont read C++ to know better). This was written a little while ago, but I looked at it briefly. The way the paste() works right now, it requires a selection. When you do the deselect action in your code snippet, you are making it so the paste operation doesn't work. See this code. https://api.kde.org/appscomplete-api/krita-apidocs/libs/libkis/html/Selection_8cpp_source.html#l00177 If there is no selection, the paste isn't going to work. The way it works otherwise is that it will truncate some of your copied content depending on what you put fot he x and y position. My recommendation is probably just not to use the paste(). It is probably better to just use the paste action. You can move it around as needed, then merge down to a below layer if it needs to be on another layer. If there are coding questions like this, we also have a new krita-artists website that you can post questions to (https://krita-artists.org/). There is a good community of developers on there to help with scripting questions like this too. I am going to close this for now. If there is something else that comes up we can make a new ticket. |