panel order and default open logic
Replaced hardcoded panel order and default open/closed options with dynamic values using get_panel_order and should_open_by_default from panel_layout.
This commit is contained in:
@@ -3,6 +3,7 @@ from typing import Set
|
||||
from bpy.types import Panel, Context, UILayout, Operator, Event, WindowManager
|
||||
from .main_panel import AvatarToolKit_PT_AvatarToolkitPanel, CATEGORY_NAME
|
||||
from .ui_utils import UIStyle, draw_section_header, wrap_text_label
|
||||
from .panel_layout import get_panel_order, should_open_by_default
|
||||
from ..core.translations import t
|
||||
from ..core.common import get_active_armature, get_all_meshes
|
||||
from ..functions.eye_tracking import (
|
||||
@@ -27,8 +28,8 @@ class AvatarToolKit_PT_EyeTrackingPanel(Panel):
|
||||
bl_region_type: str = 'UI'
|
||||
bl_category: str = CATEGORY_NAME
|
||||
bl_parent_id: str = AvatarToolKit_PT_AvatarToolkitPanel.bl_idname
|
||||
bl_order: int = 6
|
||||
bl_options: Set[str] = {'DEFAULT_CLOSED'}
|
||||
bl_order: int = get_panel_order('eye_tracking')
|
||||
bl_options: Set[str] = set() if not should_open_by_default('EYE_TRACKING') else {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context: Context) -> None:
|
||||
"""Draw the eye tracking panel interface"""
|
||||
|
||||
Reference in New Issue
Block a user