31 lines
906 B
Python
31 lines
906 B
Python
import bpy
|
|
|
|
from ...common.viewport import draw_crop_settings
|
|
from .selection import CropImageSelection
|
|
|
|
|
|
class CropLassoTool(bpy.types.WorkSpaceTool):
|
|
bl_space_type = "VIEW_3D"
|
|
bl_context_mode = "OBJECT"
|
|
bl_idname = "anyimage.crop_lasso"
|
|
bl_label = "Crop Lasso"
|
|
bl_description = "Crop an Image Empty with a freehand selection"
|
|
bl_icon = "ops.sculpt.lasso_mask"
|
|
bl_operator = CropImageSelection.bl_idname
|
|
bl_keymap = (
|
|
(
|
|
CropImageSelection.bl_idname,
|
|
{"type": "LEFTMOUSE", "value": "PRESS"},
|
|
{"properties": [("gesture", "LASSO")]},
|
|
),
|
|
)
|
|
|
|
def draw_settings(context, layout, _tool):
|
|
draw_crop_settings(
|
|
context,
|
|
layout,
|
|
refine_selection="crop_lasso_refine_selection",
|
|
invert="crop_lasso_invert",
|
|
keep_original="crop_lasso_keep_original",
|
|
)
|