IC Python API:RLPy RUi

From Reallusion Wiki!
Revision as of 01:50, 28 March 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class provides UI related operations. <syntaxhighlight lang="Python"> # add hot key -...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Main article: Modules.

Detailed Description

This class provides UI related operations.

# add hot key - space
def do_somthing():
 print("do something.")

sapce_hot_key = RLPy.RUi.AddHotKey("Space")
space_action = wrapInstance(int(sapce_hot_key), PySide2.QtWidgets.QAction)
space_action.triggered.connect(do_somthing)
# remove hot key
RLPy.RUi.RemoveHotKey(sapce_hot_key)

# add Test menu
plugin_menu = wrapInstance(int(RLPy.RUi.AddMenu("Test", RLPy.EMenu_Plugins)), PySide2.QtWidgets.QMenu)
plugin_action = plugin_menu.addAction("sub menu action")
plugin_action.triggered.connect(do_somthing)
# remove menu
RLPy.RUi.RemoveMenu(plugin_menu)

# open file dialog
file_path = RLPy.RUi.OpenFileDialog("Json Files(*.json)")
print(file_path)
  
# open multiple files dialog
file_path_list = RLPy.RUi.OpenFilesDialog("Json Files(*.json)")
print(file_path_list)
  
# save file dialog
file_path = RLPy.RUi.SaveFileDialog("Json Files(*.json)")
print(file_path)
  
# show message box
RLPy.RUi.ShowMessageBox("Title", "Msg", RLPy.EMsgButton_Ok)

# show message box with checked option
RLPy.RUi.ShowMessageBox("Title", "Msg", RLPy.EMsgButton_Ok, True, "CheckBoxMsg")

Member Functions

AddHotKey

RLPy.RUi.AddHotKey ( strKeySequence )

Add HotKey.

Parameters

strKeySequence [IN] Hot key sequence - string

Returns

HotKey action - QAction

AddMenu

RLPy.RUi.AddMenu ( args )

Add menu.

Parameters

strMenuName [IN] Name of the menu - string

eParent [IN] Parent of the menu - RLPy.EMenu

  • RLPy.EMenu_Plugins Plugins menu.

Returns

Address of menu - QMenu

CreateRDialog

RLPy.RUi.CreateRDialog ( args )

Create dialog.

Parameters

eDialogType [IN] dialog is normal or exclusive - RLPy.EDialogType

  • RLPy.EDialogType_Normal
  • RLPy.EDialogType_Exclusive

Returns

RIDialog smart pointer - RLPy.RIDialog

CreateRDockWidget

RLPy.RUi.CreateRDockWidget ( )

Create dockwidget.

Returns

RIDockWidget smart pointer - RLPy.RIDockWidget

GetCSSType

RLPy.RUi.GetCSSType ( )

Get CSS type.

Returns

Type of CSS - RLPy.ECSSType
  • RLPy.ECSSType_Color_0
  • RLPy.ECSSType_Color_1

GetMainWindow

RLPy.RUi.GetMainWindow ( )

Get MainWindow's address.

Returns

Address of main window - QWidget

GetResolutionType

RLPy.RUi.GetResolutionType ( )

Get resolution type.

Returns

Type of resolution - RLPy.EResolutionType
  • RLPy.EResolutionType_Large
  • RLPy.EResolutionType_Original
  • RLPy.EResolutionType_Small

OpenFileDialog

RLPy.RUi.OpenFileDialog ( args )

Show the open file dialog and returns the selected file path name.

Parameters

strFilter [IN] File filter - string

Returns

File path of selected file - string

OpenFilesDialog

RLPy.RUi.OpenFilesDialog ( args )

Show the open file dialog and returns multiple selected file path names.

Parameters

strFilter [IN] File filter - string

Returns

File paths of selected files - string

RemoveHotKey

RLPy.RUi.RemoveHotKey ( pAction )

Remove HotKey.

Parameters

pAction [IN] HotKey to remove - QAction

Returns

Success or Failure - RLPy.RStatus

RemoveMenu

RLPy.RUi.RemoveMenu ( pMenu )

Remove Menu.

Parameters

pMenu [IN] menu to remove - QMenu

Returns

Success or Failure - RLPy.RStatus

SaveFileDialog

RLPy.RUi.SaveFileDialog ( strFilter )

Show the save file dialog and returns the selected file path name.

Parameters

strFilter [IN] File filter - string

Returns

File path of selected file - string

ShowMessageBox

RLPy.RUi.ShowMessageBox ( args )

Show message.

Parameters

strTitle [IN] Title of message box - string

strMsg [IN] Message in message box - string

eBtn [IN] Button configuration - RLPy.EMsgButton

  • RLPy.EMsgButton_NoButton
  • RLPy.EMsgButton_Ok
  • RLPy.EMsgButton_Save
  • RLPy.EMsgButton_SaveAll
  • RLPy.EMsgButton_Open
  • RLPy.EMsgButton_Yes
  • RLPy.EMsgButton_YesToAll
  • RLPy.EMsgButton_No
  • RLPy.EMsgButton_NoToAll
  • RLPy.EMsgButton_Abort
  • RLPy.EMsgButton_Retry
  • RLPy.EMsgButton_Overlook
  • RLPy.EMsgButton_Close
  • RLPy.EMsgButton_Cancel
  • RLPy.EMsgButton_Discard
  • RLPy.EMsgButton_Help
  • RLPy.EMsgButton_Apply
  • RLPy.EMsgButton_Reset
  • RLPy.EMsgButton_RestoreDefaults
  • RLPy.EMsgButton_OkDontAskAgain

bChecked [IN] show checked message box if True - bool

strCheckBoxMsg [IN] Checked message - string

Returns

Button status - int