import bpy
from .utils.trans import t


def update_snap_obj(self, context):
    if self.snap_obj == context.active_object:
        self.snap_obj = None


class EasyPatchProperty(bpy.types.PropertyGroup):
    snap_obj: bpy.props.PointerProperty(
        type=bpy.types.Object,
        description=t(
            "snap_obj_setting_desc",
        ),
        update=update_snap_obj,
    )  # type: ignore


property_classes = (EasyPatchProperty,)
