def draw_developer_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "statistics_directory", text="Stats Directory") layout.operator(bl_operators.OpenStatsDirOperator.bl_idname, text="Open Directory") layout.operator(bl_operators.WriteStatisticsOperator.bl_idname, text="Write Statistics") layout.prop(mixer_prefs, "auto_save_statistics", text="Auto Save Statistics") layout.prop(mixer_prefs, "no_send_scene_content", text="No send_scene_content") layout.prop(mixer_prefs, "no_start_server", text="Do not start server on connect") layout.prop(mixer_prefs, "send_base_meshes", text="Send Base Meshes") layout.prop(mixer_prefs, "send_baked_meshes", text="Send Baked Meshes") layout.prop(mixer_prefs, "commands_send_interval") box = layout.box().column() box.label(text="Gizmos") box.prop(mixer_prefs, "display_own_gizmos") box.prop(mixer_prefs, "display_frustums_gizmos") box.prop(mixer_prefs, "display_names_gizmos") box.prop(mixer_prefs, "display_ids_gizmos") box.prop(mixer_prefs, "display_selections_gizmos")
def draw_version_panel( layout: bpy.types.UILayout, context: bpy.types.Context, actual_version: str, latest_version: str, ) -> None: """Draws the panel to connect to Tresorio""" user_props = context.window_manager.tresorio_user_props report_props = bpy.context.window_manager.tresorio_report_props title = layout.row() title.label(text=f"{TRADUCTOR['desc']['new_version'][CONFIG_LANG]}") title = layout.row() title.label( text= f"{TRADUCTOR['desc']['actual_version'][CONFIG_LANG]} : {actual_version}" ) title = layout.row() title.label( text= f"{TRADUCTOR['desc']['latest_version'][CONFIG_LANG]} : {latest_version}" ) layout.operator( 'tresorio.download_addon', text=f"{TRADUCTOR['desc']['download_latest'][CONFIG_LANG]}", icon_value=til.icon('TRESORIO_LEAF'))
def _emit_operator(self, layout: bpy.types.UILayout, op: Optional[Union[str, Tuple[str, Dict[str, Any]]]], icon: str): if isinstance(op, str): layout.operator(op, text="", icon=icon) else: op_name = op[0] op_args = op[1] op_instance = layout.operator(op_name, text="", icon=icon) for key, value in op_args.items(): setattr(op_instance, key, value)
def draw_connection_panel(layout: bpy.types.UILayout, context: bpy.types.Context ) -> None: """Draws the panel to connect to Tresorio""" user_props = context.window_manager.tresorio_user_props report_props = bpy.context.window_manager.tresorio_report_props case = layout.row().split(factor=0.5) case.label(text=TRADUCTOR['field']['connection'][CONFIG_LANG]) align_case = case.column().row().split(factor=0.8) align_case.column().prop(user_props, 'langs') align_case.column().operator('tresorio.advanced_settings_navigation_in', icon_value=til.icon('TRESORIO_SETTINGS'), text='') box = layout.box() box.label(text=TRADUCTOR['field']['mail'][CONFIG_LANG] + ':') box.prop(user_props, 'email', text='') box.label(text=TRADUCTOR['field']['password'][CONFIG_LANG] + ':') row = box.row().split(factor=0.9) if user_props.show_password: row.prop(user_props, 'clear_password', text='') else: row.prop(user_props, 'hidden_password', text='') row.prop(user_props, 'show_password', icon_only=True, icon='HIDE_OFF') row = layout.row().split(factor=0.5) row.column().prop(user_props, 'remember_email', text=TRADUCTOR['field']['remember_email'][CONFIG_LANG]) col = row.column() if not report_props.login_in: col.operator('tresorio.login', icon_value=til.icon('TRESORIO_LOGIN'), text=TRADUCTOR['field']['login'][CONFIG_LANG]) else: col.label(text=TRADUCTOR['notif']['login_in'][CONFIG_LANG]) layout.separator(factor=2.0) layout.operator('tresorio.redirect_forgot_password', text=TRADUCTOR['field']['forgot_password'][CONFIG_LANG], icon_value=til.icon('TRESORIO_KEY')) layout.operator('tresorio.redirect_register', text=TRADUCTOR['field']['create_account'][CONFIG_LANG], icon_value=til.icon('TRESORIO_PROFILE'))
def draw_advanced_settings_panel(layout: bpy.types.UILayout, context: bpy.types.Context) -> None: """Draws the advanced settings panel""" user_props = context.window_manager.tresorio_user_props case = layout.row().split(factor=0.5) case.label(text=TRADUCTOR['field']['advanced_settings'][CONFIG_LANG]) case = case.row().split(factor=0.7) case.operator( 'tresorio.advanced_settings_reset', text=TRADUCTOR['field']['reset_advanced_settings'][CONFIG_LANG], icon='MODIFIER') case.operator('tresorio.advanced_settings_navigation_out', text='', icon='CANCEL') latest_version = user_props.latest_version actual_version = f"{API_CONFIG['version']['major']}.{API_CONFIG['version']['minor']}.{API_CONFIG['version']['patch']}" box = layout.split(factor=0.5).box() box.enabled = False box.scale_x = 0.5 box.scale_y = 0.5 box.label(text=TRADUCTOR['field']['version'][CONFIG_LANG] + " : " + actual_version) box.label(text=TRADUCTOR['field']['latest'][CONFIG_LANG] + " : " + latest_version) box = layout.box() split = box.split(factor=0.4, align=True) split.alignment = 'RIGHT' split.label(text=TRADUCTOR['field']['backend_ip'][CONFIG_LANG]) split.prop(user_props, 'backend_ip_address', text='') split = box.split(factor=0.4) split.alignment = 'RIGHT' split.label(text=TRADUCTOR['field']['backend_port'][CONFIG_LANG]) split.prop(user_props, 'backend_port', text='') split = box.split(factor=0.4) split.alignment = 'RIGHT' split.label(text=TRADUCTOR['field']['backend_https'][CONFIG_LANG]) split.prop(user_props, 'backend_https', text='') layout.operator('tresorio.advanced_settings', icon='CHECKMARK', text=TRADUCTOR['field']['save_settings'][CONFIG_LANG])
def draw_assetbar_show_hide(layout: bpy.types.UILayout) -> None: """Draw assetbat show/hide icon. Parameters: layout: UI Layout """ wm = bpy.context.window_manager ui_props = getattr(wm, HANA3D_UI) if ui_props.assetbar_on: icon = 'HIDE_OFF' ttip = 'Click to Hide Asset Bar' else: icon = 'HIDE_ON' ttip = 'Click to Show Asset Bar' op = layout.operator(f'view3d.{HANA3D_NAME}_asset_bar', text='', icon=icon) op.keep_running = False op.do_search = False op.tooltip = ttip
def show_add_defined(parent: bpy.types.UILayout, bone: str) -> None: parent.operator( vrm_helper.Add_VRM_defined_humanbone_custom_property.bl_idname, text=f"Add {bone} property", icon="ADD", )