Description: Using PyKrita scripting (Krita 5.2.9), I've observed the following severe limitations: 1. Calling 'convert_to_selection_mask' always converts the original active base layer, regardless of attempts to set the active node explicitly (via `doc.setActiveNode()` or GUI actions like 'activateNextLayer'). 2. Using global selection (`select_all` → setPixelData → 'add_new_selection_mask') allows creation of only one functioning selection mask. Creating subsequent masks overwrites or clears selection pixels from previously created masks, making multiple independent masks impossible. 3. Attempting to duplicate masks programmatically results in masks incorrectly turning into base image layers or disappearing entirely from the layer stack. These issues explicitly prevent reliable scripted creation of multiple independent selection masks. Expected Behavior: - Allow explicit scripting-based activation of nodes so GUI actions affect intended layers. - Allow global selection-based creation of multiple independent selection masks without overwriting previous selections. - Provide clear and stable API methods to programmatically create and manage selection masks independently. Actual Behavior: - GUI actions ignore scripting-based active node changes. - Global selection state is transient, preventing stable multi-mask creation. - Duplicating masks causes unintended layer-type conversions and deletions. Reproduction steps and detailed test results available upon request.