- Implement sync_models.py for preparing and uploading ONNX artifacts. - Create build_node.py for building and validating Blender scripts. - Add docs.py for building and previewing documentation with Mike or MkDocs. - Introduce model_exports.py for exporting PyTorch models to ONNX format. - Develop pack.py for packaging the project with dependencies for different platforms. - Add test_sync_models.py to validate sync_models functionality. - Add test_tool_commands.py to ensure repository tools have correct command scripts. - Initialize tools package with __init__.py.
25 lines
736 B
Python
25 lines
736 B
Python
import bpy
|
|
|
|
from ...common.image_interaction import draw_region_settings
|
|
from .edit_mask import EditImageMask
|
|
|
|
|
|
class ImageBoxTool(bpy.types.WorkSpaceTool):
|
|
bl_space_type = "VIEW_3D"
|
|
bl_context_mode = "OBJECT"
|
|
bl_idname = "anyimage.image_box"
|
|
bl_label = "Image Box"
|
|
bl_description = "Edit an Image Empty with a rectangular mask"
|
|
bl_icon = "ops.sculpt.border_mask"
|
|
bl_operator = EditImageMask.bl_idname
|
|
bl_keymap = (
|
|
(
|
|
EditImageMask.bl_idname,
|
|
{"type": "LEFTMOUSE", "value": "PRESS"},
|
|
{"properties": [("gesture", "BOX")]},
|
|
),
|
|
)
|
|
|
|
def draw_settings(context, layout, _tool):
|
|
draw_region_settings(context, layout, "image_box_refine_region")
|