Logo Ui Panels

Ui Panels

Cộng đồng
TMHSDigital
ui-panels

Author bpy.types.Panel UI: bl_space_type, bl_region_type, bl_category sidebar tabs, declarative draw(), layout row, column and split, sub-panels, and conditional UI with enabled and active. Use when the user adds an N-panel tab or properties-editor panel, exposes add-on properties or operator buttons, or has a panel that does not appear, shows the wrong labels or warns about a missing _PT_ in its bl_idname. Targets 5.2 LTS.

Tổng quan

Nhà phát hànhTMHSDigital
Kho mãBlender-Developer-Tools
Tên kỹ năngui-panels
Sao
20
Bản fork
5
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được TMHSDigital công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Ui Panels trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/ui-panels
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TMHSDigital/Blender-Developer-Tools.git /tmp/Blender-Developer-Tools
mkdir -p .claude/skills
cp -r /tmp/Blender-Developer-Tools/skills/ui-panels .claude/skills/ui-panels
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Ui Panels trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Ui Panels ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Ui Panels không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

UI Panels

Trigger

Use this skill when the user:

  • Wants a sidebar tab in the 3D viewport, properties editor, or any other space
  • Mentions bpy.types.Panel, bl_space_type, bl_region_type, "N panel", "sidebar"
  • Needs to expose properties or operators in a custom UI
  • Asks why a property is showing without a label or in the wrong column

Required inputs

  • Where the panel lives: the editor (3D viewport, Properties, etc.) and the region (sidebar, header, tools)
  • Tab name if it lives in a sidebar (bl_category)
  • Class name convention: EDITOR_PT_name (VIEW3D_PT_my_addon)

The minimum viable panel

python
import bpy


class VIEW3D_PT_my_addon(bpy.types.Panel):
    bl_label = "My Addon"
    bl_idname = "VIEW3D_PT_my_addon"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "My Addon"

    def draw(self, context):
        layout = self.layout
        layout.label(text="Hello from the N panel")

After registering the class, the panel appears in the 3D viewport's sidebar (press N) under a "My Addon" tab.

The bl_* fields that decide where it lives

FieldCommon valuesEffect
bl_space_type'VIEW_3D', 'PROPERTIES', 'NODE_EDITOR', 'IMAGE_EDITOR', 'TEXT_EDITOR', 'OUTLINER', 'SEQUENCE_EDITOR'Which editor the panel appears in
bl_region_type'UI' (sidebar), 'TOOLS' (toolbar, deprecated for new add-ons), 'WINDOW' (main, used in PROPERTIES), 'HEADER'Which region within the editor
bl_categoryAny stringTab name in 'UI' regions
bl_labelAny stringVisible header on the panel
bl_idnameConventional EDITOR_PT_nameInternal, also used as the parent for sub-panels
bl_context'objectmode', 'mesh_edit', 'render', etc.Restrict to a context (mainly Properties editor)
bl_parent_idAnother panel's bl_idnameMakes this a sub-panel under that parent
bl_options{'DEFAULT_CLOSED'}, {'HIDE_HEADER'}UI options

The EDITOR_PT_name convention is checked, not enforced: a bl_idname without the _PT_ infix still registers, and Blender prints Warning: 'mypanel' does not contain '_PT_' with prefix and suffix (4.5.11 and 5.2.1). Follow it anyway; the editor prefix maps to bl_space_type, and sub-panels reference the parent by this id.

The declarative draw method

draw runs every redraw. It must be cheap and idempotent. Do not mutate scene state from inside draw. Use layout.prop, layout.operator, layout.label, and the layout container methods.

python
def draw(self, context):
    layout = self.layout
    settings = context.scene.my_addon

    layout.prop(settings, "intensity")
    layout.prop(settings, "use_smoothing")

    row = layout.row()
    row.prop(settings, "min_value")
    row.prop(settings, "max_value")

    layout.operator("mesh.my_addon_action")

layout.prop reads the property metadata (label, description, range, subtype) from the bpy.props definition. You do not pass the label. If you want to override:

python
layout.prop(settings, "intensity", text="Strength")

layout.prop(..., text="") removes the label entirely, useful inside aligned columns.

Layout primitives

MethodUse for
layout.row()Horizontal arrangement
layout.row(align=True)Horizontal with no gap, like a button group
layout.column()Vertical (default for layout itself)
layout.column(align=True)Vertical with no gap, useful for aligned prop rows
layout.split(factor=0.5)Two-column split with explicit ratio
layout.box()Bordered group
layout.separator()Vertical spacer
layout.separator(factor=2.0)Larger vertical spacer

Aligned property rows

python
col = layout.column(align=True)
col.prop(settings, "min_value")
col.prop(settings, "max_value")

Without align=True you get a small gap between rows. With it the boxes touch, which is the conventional look for paired min/max controls.

Split for label + control

python
split = layout.split(factor=0.4)
split.label(text="Mode")
split.prop(settings, "mode", text="")

This lays out a left-aligned label that takes 40% of the width with the dropdown filling the rest.

Conditional UI: .enabled, not show/hide

Showing and hiding individual controls based on state causes the panel to "jump" as the user works. The Blender convention is to keep the layout stable and gray out controls that don't apply:

python
def draw(self, context):
    layout = self.layout
    settings = context.scene.my_addon

    layout.prop(settings, "use_smoothing")

    sub = layout.column()
    sub.enabled = settings.use_smoothing
    sub.prop(settings, "smoothing_passes")
    sub.prop(settings, "smoothing_strength")

sub.enabled = False grays out the controls but keeps them in place. Users instinctively read this as "available but not active right now."

For genuinely dependent UI (the entire concept disappears in the other state), use a sub-panel with bl_parent_id and toggle the parent's poll instead.

Worked example: panel calling an operator on a Scene-bound property

python
import bpy


class MY_ADDON_PG_settings(bpy.types.PropertyGroup):
    intensity: bpy.props.FloatProperty(name="Intensity", default=1.0, min=0.0, max=10.0)
    use_smoothing: bpy.props.BoolProperty(name="Smooth Result", default=True)
    smoothing_passes: bpy.props.IntProperty(name="Passes", default=2, min=1, max=10)


class MESH_OT_apply_my_addon(bpy.types.Operator):
    bl_idname = "mesh.apply_my_addon"
    bl_label = "Apply"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):
        return context.active_object is not None and context.active_object.type == 'MESH'

    def execute(self, context):
        obj = context.active_object
        if obj is None:
            return {'CANCELLED'}
        settings = context.scene.my_addon
        self.report({'INFO'}, f"Apply at intensity={settings.intensity:.2f}")
        return {'FINISHED'}


class VIEW3D_PT_my_addon(bpy.types.Panel):
    bl_label = "My Addon"
    bl_idname = "VIEW3D_PT_my_addon"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "My Addon"

    def draw(self, context):
        layout = self.layout
        settings = context.scene.my_addon

        layout.prop(settings, "intensity")
        layout.prop(settings, "use_smoothing")

        sub = layout.column()
        sub.enabled = settings.use_smoothing
        sub.prop(settings, "smoothing_passes")

        layout.separator()
        layout.operator("mesh.apply_my_addon", icon='PLAY')


classes = (
    MY_ADDON_PG_settings,
    MESH_OT_apply_my_addon,
    VIEW3D_PT_my_addon,
)

_register_classes, _unregister_classes = bpy.utils.register_classes_factory(classes)


def register():
    _register_classes()
    bpy.types.Scene.my_addon = bpy.props.PointerProperty(type=MY_ADDON_PG_settings)


def unregister():
    del bpy.types.Scene.my_addon
    _unregister_classes()

Common AI mistakes

  1. Mutating state from draw. draw runs on every redraw, dozens of times per second. If you create or delete data there, you will leak, crash, or block the UI.

  2. Hardcoding the label twice:

    python
    layout.prop(settings, "intensity", text="Intensity")  # redundant

    The label comes from the property definition. Pass text= only to override or to suppress with text="".

  3. Mixing bl_region_type='UI' with no bl_category. Blender silently files the panel under a fallback sidebar tab you did not choose, mixed in with other add-ons, where users will not look for it. Always set bl_category.

  4. Using bl_region_type='TOOLS' for new add-ons. The tools region was deprecated in 2.8 in favor of the UI region for sidebar panels. Stick to 'UI'.

  5. Show/hide instead of .enabled. The panel jumps and confuses the user. Gray out unless the entire concept is gone.

  6. bl_idname not matching the convention. Registration still succeeds but prints a _PT_ warning on every load, and the editor prefix should match bl_space_type.

Related

  • operators for the operator that the panel button calls
  • custom-properties for the property definitions the panel reads
  • addon-scaffolding for class registration

Runnable examples

Each example runs headless, asserts the contract, and exits non-zero when it breaks. Run one with blender --background --python <script> --; pass a falsifier flag to watch the check fail.

  • addon-register-lifecycle: Check-only witness for the first things every add-on author writes. Falsify: --drop-manifest (exit 3).

References

Câu hỏi thường gặp

Kỹ năng AI Ui Panels làm được gì?

Author bpy.types.Panel UI: bl_space_type, bl_region_type, bl_category sidebar tabs, declarative draw(), layout row, column and split, sub-panels, and conditional UI with enabled and active. Use when the user adds an N-panel tab or properties-editor panel, exposes add-on properties or operator buttons, or has a panel that does not appear, shows the wrong labels or warns about a missing _PT_ in its bl_idname. Targets 5.2 LTS.

Vì sao nên dùng Ui Panels trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Ui Panels là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Ui Panels trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/ui-panels. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Ui Panels?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Ui Panels với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Ui Panels với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Ui Panels có miễn phí không?

Kỹ năng này được TMHSDigital phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇