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
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
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
50 51 52 53 54 55 56 57 58 59 |
|
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
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
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
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
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
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
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
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
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. |
Source code in src\helpers\selection.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|