https://bugs.kde.org/show_bug.cgi?id=482315

            Bug ID: 482315
           Summary: Selecting created layer does not select it
    Classification: Applications
           Product: krita
           Version: 5.2.2
          Platform: Microsoft Windows
                OS: Microsoft Windows
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Scripting
          Assignee: krita-bugs-n...@kde.org
          Reporter: keyth2363...@gmail.com
  Target Milestone: ---

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) )


"""

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to