Bug 482315 - Selecting created layer does not select it
Summary: Selecting created layer does not select it
Status: RESOLVED WORKSFORME
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 5.2.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-03 14:48 UTC by keyth_qcfx2
Modified: 2024-12-05 03:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screenshot that shows my new layer being selected right after run (320.83 KB, image/png)
2024-11-05 14:12 UTC, Halla Rempt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description keyth_qcfx2 2024-03-03 14:48:52 UTC
SUMMARY
Creating a new layer and selecting that new layer does not select it


STEPS TO REPRODUCE
1. open Krita with a image
2. run the code provided

OBSERVED RESULT
the selected layer is still the previously selected layer

EXPECTED RESULT
created layer to be the active layer

SOFTWARE/OS VERSIONS
Windows:  10
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Code:

"""
# Imports
import krita

# Function
def Wait( ad ):
    ad.waitForDone()
    ad.refreshProjection()

# Read
ki = Krita.instance()
ad = ki.activeDocument()
node = ad.activeNode()

# Create New Layer
new_node = ad.createNode( "New Layer", "paintLayer" )
ad.activeNode().parentNode().addChildNode( new_node, node )
Wait( ad )
# Select New Layer
ad.setActiveNode( new_node )
Wait( ad )
# Output
active_node = ad.activeNode().name()
print( str(active_node) )


"""
Comment 1 radian 2024-08-21 08:18:35 UTC
This sounds very similar to bug I planned to submit but turned out different thing. Tested it and can confirm in krita 5.2.3 and 5.2.1 on win. 

Can add some info tho - new layer actually get selected but after script is done but if there is some actions that should be done to new layer they will be done on previous node (merge layer for example).
Comment 2 Evan Lee 2024-11-05 03:28:07 UTC
Related bug: https://bugs.kde.org/show_bug.cgi?id=495811
Comment 3 Halla Rempt 2024-11-05 14:12:00 UTC
Hm, I just tried this, and I cannot reproduce it. The new layer is selected here. I wonder what I'm missing?
Comment 4 Halla Rempt 2024-11-05 14:12:25 UTC
Created attachment 175547 [details]
screenshot that shows my new layer being selected right after run
Comment 5 Bug Janitor Service 2024-11-20 03:46:34 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2024-12-05 03:46:27 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.