Skip to content

Instantly share code, notes, and snippets.

@strike-digital
strike-digital / btypes.py
Created January 13, 2023 13:24
A module containing helpers to make defining blender types easier (panels, operators etc.)
from dataclasses import dataclass
from typing import Literal
from bpy.types import Operator, Panel, Menu, Context, UILayout
from bpy.props import StringProperty
import blf
"""A module containing helpers to make defining blender types easier (panels, operators etc.)"""
# Demo:
# @BOperator("my_operator_category", label="Cool Operator", undo=True)
# class ADDON_OT_my_op():
# Copyright (C) 2021 'BD3D DIGITAL DESIGN, SLU'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the