Selection¶
src.helpers.selection.select_bounds(bounds: tuple[int, int, int, int], selection: Optional[Selection] = None) -> None
¶
Create a selection using a list of bound values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bounds
|
tuple[int, int, int, int]
|
List of bound values (left, top, right, bottom). |
required |
selection
|
Selection | None
|
App selection object, pull from active document if not provided. |
None
|
Source code in src\helpers\selection.py
src.helpers.selection.select_layer_bounds(layer: ArtLayer = None, selection: Optional[Selection] = None) -> None
¶
Select the bounding box of a given layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
ArtLayer
|
Layer to select the pixels of. Uses active layer if not provided. |
None
|
selection
|
Selection | None
|
App selection object, pull from active document if not provided. |
None
|
Source code in src\helpers\selection.py
src.helpers.selection.select_overlapping(layer: ArtLayer) -> None
¶
Select pixels in the given layer overlapping the current selection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
ArtLayer
|
Layer with pixels to select. |
required |
Source code in src\helpers\selection.py
src.helpers.selection.select_canvas(docref: Optional[Document] = None, bleed: int = 0)
¶
Select the entire canvas of a provided or active document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
docref
|
Document | None
|
Document reference, use active if not provided. |
None
|
bleed
|
int
|
Amount of bleed edge to leave around selection, defaults to 0. |
0
|
Source code in src\helpers\selection.py
src.helpers.selection.select_layer_pixels(layer: Optional[ArtLayer] = None) -> None
¶
Select pixels of the active layer, or a target layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
ArtLayer | None
|
Layer to select. Uses active layer if not provided. |
None
|
Source code in src\helpers\selection.py
src.helpers.selection.select_vector_layer_pixels(layer: Optional[ArtLayer] = None) -> None
¶
Select pixels of the active vector layer, or a target layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
ArtLayer | None
|
Layer to select. Uses active layer if not provided. |
None
|
Source code in src\helpers\selection.py
src.helpers.selection.check_selection_bounds(selection: Optional[Selection] = None) -> Optional[tuple[int, int, int, int]]
¶
Verifies if a selection has valid bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selection
|
Selection | None
|
Selection object to test, otherwise use current selection of active document. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[int, int, int, int] | None
|
An empty list if selection is invalid, otherwise return bounds of selection. |