- 添加Blender插件核心文件:__init__.py、ui.py、property.py、preference.py - 添加插件工具模块:g.py、loop.py、generate_loop.py、const.py、op.py - 添加翻译工具:utils/trans.py - 添加PuLP线性规划库及其依赖文件,包括CBC求解器二进制文件 - 添加.gitignore和VSCode配置文件
24 lines
807 B
Python
24 lines
807 B
Python
import bpy
|
||
from .utils.trans import t
|
||
from .utils import functions
|
||
|
||
|
||
class EasyPatchPrefs(bpy.types.AddonPreferences):
|
||
bl_idname = functions.get_package_name() # 設置爲package的名字否則不識別
|
||
|
||
desc_position_x: bpy.props.IntProperty(name=t("font_size"), default=5, min=0, max=100) # type: ignore
|
||
desc_position_y: bpy.props.IntProperty(name=t("font_size"), default=15, min=0, max=100) # type: ignore
|
||
|
||
# TODO:经典模式开关,注意要在g建立一个变量确保一致性
|
||
|
||
def draw(self, context):
|
||
layout = self.layout
|
||
layout.label(text=t("hotkey_display_position"))
|
||
|
||
row = layout.row()
|
||
row.prop(self, "desc_position_x", text="x", expand=True)
|
||
row.prop(self, "desc_position_y", text="y", expand=True)
|
||
|
||
|
||
classes = (EasyPatchPrefs,)
|