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
- addPanelWidget
- disableAll
- enableAll
- findWidget
- getActivePluginEntrancePosition
- getSelectControlAxises
- getWidgets
- injectMenuItems
- injectToolItems
- injectTopBarWidget
- isShownInvisibleModel
- resetAllWidgetChanges
- setCursorIcon
- setFooterViewBarOffset
- setSelectMenuTitleWidget
- showPopover
- showRealTimeMaterialEditor
- switchToCurrentPluginAssetPanel
- toggleMaterialReplacePanel
- togglePaymentVisible
- togglePropertyPanelVisibility
- toggleShowInvisibleModel
- toggleSketchToolBar
Methods
addPanelWidget
▸ addPanelWidget(options): KPanelWidget
创建面板控件
Create a panel widget
Parameters
| Name | Type | Description |
|---|---|---|
options | KPanelWidgetOptions | 面板控件选项 (Panel widget options) |
Returns
创建的面板控件实例 (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
| Name | Type | Description |
|---|---|---|
id | string | 控件ID (Widget ID) |
Returns
找到的控件实例 (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
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type |
|---|---|
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
| Name | Type | Description |
|---|---|---|
options | KTopBarWidgetOptions<KClickListener, KHoverListener> | 顶部工具栏控件选项 (Top bar widget options) |
Returns
注入的顶部工具栏控件实例 (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
| Name | Type | Description |
|---|---|---|
icon | string | icon svg string such as |
Returns
boolean
Defined in
api.d.ts:900
setFooterViewBarOffset
▸ setFooterViewBarOffset(offset): void
设置footer的操作条(2d/3d,现实模式操作按钮)向右的偏移量,仅在CustomTool激活时生效, 避免插件遮挡
take effect only when CustomTool is active
Parameters
| Name | Type |
|---|---|
offset | number |
Returns
void
Defined in
api.d.ts:911
setSelectMenuTitleWidget
▸ setSelectMenuTitleWidget(options): KSelectMenuTitleWidget
设置菜单上方快捷按钮控件
Set a select menu title widget
Parameters
| Name | Type | Description |
|---|---|---|
options | KSelectMenuTitleWidgetOptions | 菜单上方快捷按钮控件选项 (Select menu title widget options) |
Returns
设置的菜单上方快捷按钮控件实例 (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
| Name | Type | Description |
|---|---|---|
position | number[] | The position of the popover mount point |
option | KPopoverOption | The option of the popover |
Returns
void
Defined in
api.d.ts:771
showRealTimeMaterialEditor
▸ showRealTimeMaterialEditor(materialId, onSaveRealtimeMaterial): void
显示实时材质编辑窗口
show realtime material edit dialog.
Parameters
| Name | Type | Description |
|---|---|---|
materialId | string | material's id to edit. |
onSaveRealtimeMaterial | (error?: any, data?: any) => void | the 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
| Name | Type | Description |
|---|---|---|
visible | boolean | true to open and false to close |
onSoftMaterialClick? | (materialId: string, bgid: string) => void | is the callback when choose a soft material. |
defaultPosition? | Object | default 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.x | number | - |
defaultPosition.y | number | - |
Returns
void
Defined in
api.d.ts:877
togglePaymentVisible
▸ togglePaymentVisible(visible, config?): void
在酷大师中显示支付弹窗
show payment dialog in kooMaster
Parameters
| Name | Type | Description |
|---|---|---|
visible | boolean | true to show or false to hidden |
config? | Object | params for the payment type |
config.feid | string | - |
config.hunterid? | string | - |
config.kioid | string | - |
config.onClose? | () => void | - |
config.onSuccess? | (result: { obsOrderId: string }) => void | - |
config.title | string | - |
Returns
void
Defined in
api.d.ts:857
togglePropertyPanelVisibility
▸ togglePropertyPanelVisibility(visible): void
显示或者隐藏右侧属性栏
show or hidden the property panel on the right
Parameters
| Name | Type | Description |
|---|---|---|
visible | boolean | true, 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
| Name | Type | Description |
|---|---|---|
showInvisibleModel | boolean | : 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
| Name | Type | Description |
|---|---|---|
showSketchToolBar | boolean | true, turn on to show toolbar, vice versa. |
Returns
void
Defined in
api.d.ts:779