base addon
This commit is contained in:
commit
732a647572
4 files changed
+112
No files matched your search
+15
@@ -0,0 +1,15 @@
|
||||
import bpy
|
||||
|
||||
# Import modules
|
||||
from . import ops
|
||||
from . import ui
|
||||
|
||||
# Register modules
|
||||
def register() -> None:
|
||||
ops.register()
|
||||
ui.register()
|
||||
|
||||
# Unregister modules
|
||||
def unregister() -> None:
|
||||
ops.unregister()
|
||||
ui.unregister()
|
||||
@@ -0,0 +1,28 @@
|
||||
schema_version = "1.0.0"
|
||||
|
||||
id = "wtd_tools"
|
||||
version = "0.0.1"
|
||||
name = "WTD Tools"
|
||||
tagline = "Tools of Walking The Dog"
|
||||
maintainer = "WTD"
|
||||
type = "add-on"
|
||||
website = "somesite.be"
|
||||
tags = ["tools"]
|
||||
blender_version_min = "5.2.0"
|
||||
|
||||
license = ["SPDX:GPL-2.0-or-later"]
|
||||
copyright = ["2026 WTD"]
|
||||
|
||||
[permissions]
|
||||
|
||||
[build]
|
||||
paths_exclude_pattern = [
|
||||
"__pycache__/",
|
||||
"/.git/",
|
||||
"docs/",
|
||||
".*",
|
||||
"*.blend",
|
||||
"*.md",
|
||||
"*.png",
|
||||
"*.zip",
|
||||
]
|
||||
@@ -0,0 +1,26 @@
|
||||
"""Operators."""
|
||||
|
||||
import bpy
|
||||
|
||||
class WTDBuildOp(bpy.types.Operator):
|
||||
|
||||
bl_idname = "wtd_tools.build"
|
||||
bl_label = "Build"
|
||||
|
||||
def execute(self, context):
|
||||
if bpy.ops.kabaret.cmds_call(
|
||||
actor_name="Flow",
|
||||
cmd_name="action_needs_dialog",
|
||||
args_json=json.dumps([oid]),
|
||||
) == {"FINISHED"}:
|
||||
result = json.loads(bpy.context.window_manager.kabaret_ipc_last_result)
|
||||
else:
|
||||
error = bpy.context.window_manager.kabaret_ipc_last_error
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
def register() -> None:
|
||||
bpy.utils.register_class(WTDBuildOp)
|
||||
|
||||
def unregister() -> None:
|
||||
bpy.utils.unregister_class(WTDBuildOp)
|
||||
@@ -0,0 +1,43 @@
|
||||
"""Sidebar UI."""
|
||||
|
||||
import bpy
|
||||
|
||||
|
||||
# Panel like kabaret ipc
|
||||
# class WTDToolsPanel(bpy.types.Panel):
|
||||
#
|
||||
# bl_idname = "wtd_tools.ui.panel"
|
||||
# bl_label = "WTD TOOLS"
|
||||
# bl_space_type = "VIEW_3D"
|
||||
# bl_region_type = "UI"
|
||||
# bl_category = "WTD"
|
||||
#
|
||||
# def draw(self, context) -> None:
|
||||
# #wm = context.window_manager
|
||||
# layout = self.layout
|
||||
#
|
||||
# build_op_row = layout.row()
|
||||
# build_op_row.operator("wtdtools.build", text = "Build scene")
|
||||
|
||||
|
||||
class WTDToolsMenu(bpy.types.Menu):
|
||||
bl_label = "WTDTools"
|
||||
bl_idname = "wtd_tools.ui.menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator("wtd_tools.build", text="Build")
|
||||
|
||||
def draw_item(self, context):
|
||||
self.layout.menu(WTDToolsMenu.bl_idname)
|
||||
|
||||
|
||||
def register() -> None:
|
||||
#bpy.utils.register_class(WTDToolsPanel)
|
||||
bpy.utils.register_class(WTDToolsMenu)
|
||||
bpy.types.TOPBAR_MT_editor_menus.append(draw_item)
|
||||
|
||||
def unregister() -> None:
|
||||
# bpy.utils.unregister_class(WTDToolsPanel)
|
||||
bpy.utils.unregister_class(WTDToolsMenu)
|
||||
bpy.types.TOPBAR_MT_editor_menus.remove(draw_item)
|
||||
Reference in new issue
Block a user