Files
AnyImage/src/anyimage/operators/image_edit/polyline.py
nan 1613bd3194 Add image perspective editing and related tools
- Implemented the Image Perspective tool for editing image corners in Blender.
- Created a new operator `EditImagePerspective` to handle the perspective transformation.
- Added a preview feature for the perspective adjustment.
- Introduced the `ImagePolylineTool` for editing image masks with polylines.
- Developed backend support for Real-ESRGAN model inference, including ONNX integration.
- Added functionality for image masking and background removal.
- Created unit tests for the Real-ESRGAN ONNX model to ensure correct preprocessing and inference.
2026-08-22 22:17:10 +08:00

21 lines
575 B
Python

import bpy
from .mask import EditImageMask
class ImagePolylineTool(bpy.types.WorkSpaceTool):
bl_space_type = "VIEW_3D"
bl_context_mode = "OBJECT"
bl_idname = "anyimage.image_polyline"
bl_label = "Image Polyline"
bl_description = "Edit an Image Empty with a clicked polygon mask"
bl_icon = "ops.sculpt.polyline_mask"
bl_operator = EditImageMask.bl_idname
bl_keymap = (
(
EditImageMask.bl_idname,
{"type": "LEFTMOUSE", "value": "PRESS"},
{"properties": [("gesture", "POLYLINE")]},
),
)