Skip to main content

KApplicationUI

kds-plugin-document / Exports / KApplicationUI

Interface: KApplicationUI

本接口代表酷大师的 UI 面板,如工具栏、菜单栏、属性栏等。

目前只提供了激活、抑制所有 UI 面板元素的方法

The KApplicationUI contains a number of methods for manipulating the application UI, such as tool bar, menu bar, resource panel, etc.

Table of contents

Methods

Methods

addPanelWidget

addPanelWidget(options): KPanelWidget

创建面板控件

Create a panel widget

Parameters

NameTypeDescription
optionsKPanelWidgetOptions面板控件选项 (Panel widget options)

Returns

KPanelWidget

创建的面板控件实例 (Created panel widget instance)

Defined in

api.d.ts:953


disableAll

disableAll(): void

抑制所有 UI 面板元素

Disable tool bar, menu bar, resource panel, etc.

Returns

void

Defined in

api.d.ts:739


enableAll

enableAll(): void

激活所有 UI 面板元素

Enable tool bar, menu bar, resource panel, etc.

Returns

void

Defined in

api.d.ts:730


findWidget

findWidget(id): KWidget

根据控件ID查找控件

Find a widget by its ID

Parameters

NameTypeDescription
idstring控件ID (Widget ID)

Returns

KWidget

找到的控件实例 (Found widget instance)

Defined in

api.d.ts:928


getActivePluginEntrancePosition

getActivePluginEntrancePosition(): number[]

获取当前激活插件的入口位置

Get the position of the active plugin entrance

Returns

number[]

Defined in

api.d.ts:762


getSelectControlAxises

getSelectControlAxises(): KVector3d[]

获取SelectControl控件当前的三轴方向

get current axises of SelectControl

Returns

KVector3d[]

current axises of SelectControl: [axisX, axisY, axisZ]

Defined in

api.d.ts:889


getWidgets

getWidgets(): KWidget[]

获取所有控件

Get all widgets in the UI

Returns

KWidget[]

控件数组

Defined in

api.d.ts:919


injectMenuItems

injectMenuItems(menuItems): void

注入SelectMenu选项

inject menuItems to SelectMenu

Parameters

NameTypeDescription
menuItems{ disabledFilter?: () => boolean ; icon: string ; onClick: () => void ; title: string ; visibleFilter?: () => boolean }[]can't exceed 3 items,

Returns

void

Defined in

api.d.ts:807


injectToolItems

injectToolItems(menuItems): void

注入工具栏工具选项

inject toolItems to Tools Bar

Parameters

NameType
menuItems{ disabledFilter?: () => boolean ; icon: string ; onClick: () => void ; title: string ; visibleFilter?: () => boolean }[]

Returns

void

Defined in

api.d.ts:828


injectTopBarWidget

injectTopBarWidget(options): KTopBarWidget

注入顶部工具栏控件

Inject a top bar widget

Parameters

NameTypeDescription
optionsKTopBarWidgetOptions<KClickListener, KHoverListener>顶部工具栏控件选项 (Top bar widget options)

Returns

KTopBarWidget

注入的顶部工具栏控件实例 (Injected top bar widget instance)

Defined in

api.d.ts:944


isShownInvisibleModel

isShownInvisibleModel(): boolean

获取当前“查看隐藏对象”是否打开

Get the status of "show all invisible models" is turned on or turned off.

Returns

boolean

Defined in

api.d.ts:754


resetAllWidgetChanges

resetAllWidgetChanges(): void

重置所有控件的更改

Reset all changes made to widgets

Returns

void

Defined in

api.d.ts:935


setCursorIcon

setCursorIcon(icon): boolean

设置鼠标icon样式,仅在CustomTool激活时生效

Set the mouse icon style to take effect only when CustomTool is active

Parameters

NameTypeDescription
iconstringicon svg string such as content

Returns

boolean

Defined in

api.d.ts:900


setFooterViewBarOffset

setFooterViewBarOffset(offset): void

设置footer的操作条(2d/3d,现实模式操作按钮)向右的偏移量,仅在CustomTool激活时生效, 避免插件遮挡

take effect only when CustomTool is active

Parameters

NameType
offsetnumber

Returns

void

Defined in

api.d.ts:911


setSelectMenuTitleWidget

setSelectMenuTitleWidget(options): KSelectMenuTitleWidget

设置菜单上方快捷按钮控件

Set a select menu title widget

Parameters

NameTypeDescription
optionsKSelectMenuTitleWidgetOptions菜单上方快捷按钮控件选项 (Select menu title widget options)

Returns

KSelectMenuTitleWidget

设置的菜单上方快捷按钮控件实例 (Set select menu title widget instance)

Defined in

api.d.ts:962


showPopover

showPopover(position, option): void

在 UI 的某个二维坐标下显示 popover

Show popover in the UI at a two-dimensional coordinate

Parameters

NameTypeDescription
positionnumber[]The position of the popover mount point
optionKPopoverOptionThe option of the popover

Returns

void

Defined in

api.d.ts:771


showRealTimeMaterialEditor

showRealTimeMaterialEditor(materialId, onSaveRealtimeMaterial): void

显示实时材质编辑窗口

show realtime material edit dialog.

Parameters

NameTypeDescription
materialIdstringmaterial's id to edit.
onSaveRealtimeMaterial(error?: any, data?: any) => voidthe callback when material edit successful and has been saved.

Returns

void

Defined in

api.d.ts:845


switchToCurrentPluginAssetPanel

switchToCurrentPluginAssetPanel(): void

左侧导航栏切换到当前插件面板,仅限于支持multiView的插件

The left navigation bar switches to the current plugin panel, only for plugins with multiView settings.

Returns

void

Defined in

api.d.ts:794


toggleMaterialReplacePanel

toggleMaterialReplacePanel(visible, onSoftMaterialClick?, defaultPosition?): void

打开或者关闭材质替换面板

toggle the material replace panel

Parameters

NameTypeDescription
visiblebooleantrue to open and false to close
onSoftMaterialClick?(materialId: string, bgid: string) => voidis the callback when choose a soft material.
defaultPosition?Objectdefault position of the panel, with x and y coordinates(When x=0, the panel is aligned to the right; increasing x moves the panel to the left)
defaultPosition.xnumber-
defaultPosition.ynumber-

Returns

void

Defined in

api.d.ts:877


togglePaymentVisible

togglePaymentVisible(visible, config?): void

在酷大师中显示支付弹窗

show payment dialog in kooMaster

Parameters

NameTypeDescription
visiblebooleantrue to show or false to hidden
config?Objectparams for the payment type
config.feidstring-
config.hunterid?string-
config.kioidstring-
config.onClose?() => void-
config.onSuccess?(result: { obsOrderId: string }) => void-
config.titlestring-

Returns

void

Defined in

api.d.ts:857


togglePropertyPanelVisibility

togglePropertyPanelVisibility(visible): void

显示或者隐藏右侧属性栏

show or hidden the property panel on the right

Parameters

NameTypeDescription
visiblebooleantrue, turn on to show property panel, vice versa.

Returns

void

Defined in

api.d.ts:787


toggleShowInvisibleModel

toggleShowInvisibleModel(showInvisibleModel): void

打开或者关闭“查看隐藏对象”按钮

turn on/turn off the button to show/not show all invisible models.

Parameters

NameTypeDescription
showInvisibleModelboolean: true, turn on to show all invisible models, vice versa.

Returns

void

Defined in

api.d.ts:747


toggleSketchToolBar

toggleSketchToolBar(showSketchToolBar): void

显示或者隐藏工具栏

show or hidden the toolbar

Parameters

NameTypeDescription
showSketchToolBarbooleantrue, turn on to show toolbar, vice versa.

Returns

void

Defined in

api.d.ts:779