Interface Class Reference

#include <interface.h>

Class Description

The Interface class provides access to user interface related functions and events.

To get a pointer to the current Mudbox interface, call Kernel()->Interface().

Definition at line 43 of file interface.h.

+ Inheritance diagram for Interface:

Classes

class  MenuManipulator
 

Public Types

enum  LayerUIType { ltSculptUI, ltPaintUI }
 
enum  MessageBoxType { msgInformation, msgWarning, msgQuestion, msgError }
 
enum  MessageBoxButton {
  buttonNone = 0x00000000, buttonOk = 0x00000400, buttonCancel = 0x00400000, buttonClose = 0x00200000,
  buttonYes = 0x00004000, buttonYesToAll = 0x00008000, buttonNo = 0x00010000, buttonNoToAll = 0x00020000,
  buttonAbort = 0x00040000, buttonRetry = 0x00080000, buttonIgnore = 0x00100000, buttonHelp = 0x01000000
}
 
enum  HUDMessageType { HUDmsgPin, HUDmsgFade }
 
enum  StatusType { stNormal, stWarning, stError }
 
enum  HotkeySetName { HotkeySetMudbox = 0, HotkeySetMaya = 1, HotkeySet3dsMax = 2, HotkeySetSoftimage = 3 }
 
enum  MenuType {
  ddmFile, ddmEdit, ddmCreate, ddmMesh,
  ddmCurves, ddmDisplay, ddmMaps, ddmRender,
  ddmWindows, ddmHelp, ddmLayerContext, ddmObjectListContext,
  ddmHotbox, ddmMarking
}
 
- Public Types inherited from Node
enum  DiagnosticLevel { dgnLevel1, dgnLevel2, dgnLevel3 }
 Indicates the level of validity checking that is performed in CheckValidity() More...
 

Public Member Functions

 Interface (void)
 
QMenuDropDownMenu (MenuType eType) const
 
QWidgetMainWindow (void) const
 Returns a pointer to the main window. More...
 
void ShowNewPaintLayerDialog (void)
 
void ShowBrushRing (bool bShow)
 This function turns on/off displaying the brush indicator ring. More...
 
bool RestorePreviousBrush (void)
 Restores the current brush to the previous one. More...
 
void SetSelectedBrush (const QString &sBrushName)
 Set the currently selected brush. More...
 
void ActivateLayerSystem (LayerUIType eType)
 Activates the given system in the Layer UI window. More...
 
void Load (QString filename, Scene::LoadData &cData)
 Loads scene data. More...
 
void ShowProperties (Node *pNode, bool bFloating) const
 Open a new properties dialog for the given node. More...
 
void ClearProperties ()
 Clears the property dialog. More...
 
int MessageBox (MessageBoxType iType, const QString &sTitle, const QString &sText, int iButtons=buttonNone, int iDefaultButton=buttonNone)
 Displays a modal message box to the user. More...
 
int OneTimeMessageBox (MessageBoxType iType, const QString &sTitle, const QString &sText, int buttons=0)
 Displays a informational modal message box to the user with a checkbox option to not show the dialog again. More...
 
void HUDMessageShow (const QString &sMessage, HUDMessageType iType=HUDmsgFade)
 Displays a message as text overlay (HUD) in the 3d view. More...
 
void HUDMessageHide ()
 Hides a text overlay (HUD) message created with a call to HUDMessageShow(). More...
 
void SetStatus (StatusType iType, const QString &sMsg)
 Display a message in the status bar, which is on the bottom edge of the Mudbox window. More...
 
void AddClassMenuItem (const QString &sMenu, const QString &sSubmenu, const ClassDesc *pClass, const QString &sCreatorText, const int &index=-1, const int &subindex=-1, const bool addSeparator=false, int version=0)
 Adds a new submenu to the interface that can be used to create and edit instances of a class you define in your plug-in. More...
 
void AddCallbackMenuItem (const QString &sMenu, const QString &sSubmenu, const QString &sItemName, void(*pCallback)(), const QString &sID="", const int &index=-1, const int &subindex=-1, const bool addSeparator=false, int version=0)
 Adds a new menu item that calls a callback function you specify in your plug-in. More...
 
void AddWelcomeWindowButton (const QString &sItemName, void(*pCallback)(), const QString &icon="", const QString &styleSheet="")
 Adds a new button to the "More" section of the welcome window. More...
 
void RemoveWelcomeWindowButton (const QString &sItemName)
 Removes a button that was added via AddWelcomeWindowButton. More...
 
void SelectHotkeySet (HotkeySetName newKeySet, bool forceSetHotkey=false)
 Changes the hotkeys to more closely match those in other Autodesk applications. More...
 
HotkeySetName CurrentHotkeySet () const
 Returns a code indicating the current Hotkey presets in use by Mudbox. More...
 
void AddToCreateMeshMenu (QFileInfo fileInfo)
 Adds a mesh to the Create->Mesh menu. More...
 
void AddObjectListContextMenuItem (const ClassDesc *pObjectType, const QString &sItemName, void(*pCallback)(), int index=-1, bool addSeparator=false, int version=0)
 Adds a menu item to the context menu that comes up when you right-click an object in the Object List. More...
 
void AddLayerCallbackMenuItem (mudbox::Interface::LayerUIType ltType, const QString &sItemName, void(*pCallback)(), int version=0)
 Adds a menu item to the context menu that comes up when you right-click on a sculpt or paint layer. More...
 
QActionCreateHighlightableMenuItem (const QString &text, QObject *parent, int version=0)
 Returns a special QAction (see Qt documentation) that can be highlighted when the user turns on "What's New Highlighting". More...
 
void ProgressStart (const QString &sDescription, unsigned int iMaxValue, float fWeight=1.0f, int iDelayTime=0)
 Displays a progress bar, to show a process beginning. This will set the current progess value to 0. More...
 
void ProgressStartGroup (const QString &sDescription, float fTotalWeight, int iDelayTime=0)
 Displays a progress bar, which embeds other processes which has their own progress bar. More...
 
bool ProgressSet (unsigned int iValue)
 Updates the current progress bar. Return true if cancel was requested, false otherwise. More...
 
bool ProgressAdd (void)
 Updates the current progress bar by adding one to the progress value used. Return true if cancel was requested, false otherwise. More...
 
void ProgressEnd (void)
 Removes the current progress bar, whether or not the process is complete. More...
 
bool ProgressIsCancelRequested (void)
 Returns true if the user cancelled an operation in progress. More...
 
void ProgressRequestCancel (void)
 When this function is called, Mudbox is trying to cancel the current operation. More...
 
QString LoadFileDialog (const QString &sTitle, const QString &sPath, const QString &sFilter, QString *sSelectedFilter=0) const
 Opens a modal file dialog so the user can choose an existing file to open. More...
 
QString SaveFileDialog (const QString &sTitle, const QString &sPath, const QString &sFilter, bool bAskForOverwrite=true, QString *sSelectedFilter=0) const
 Opens a modal file dialog so the user can choose a file name to save to. More...
 
QString GetDirectoryDialog (const QString &sTitle, const QString &sPath) const
 Opens a modal file dialog so the user can choose an existing folder. More...
 
QStringList LoadFilesDialog (const QString &sTitle, const QString &sPath, const QString &sFilter) const
 Opens a modal file dialog so the user can choose existing files to open. More...
 
void WaitCursorStart (void)
 Show the wait cursor. More...
 
void WaitCursorEnd (void)
 Restore the previous cursor after calling WaitCursorStart(). More...
 
void RefreshUI (void) const
 Refresh all dialogs. More...
 
void AddView (QString className, QString windowTitle, const bool select=false) const
 Adds a view in the central widget. More...
 
float currentTabletPressure () const
 Returns the current tablet pressure. Range is 0.0 to 1.0. More...
 
float LastPatchXPosition (void)
 Returns the X coordinate of the screen pixel where the last patch was taken. More...
 
float LastPatchYPosition (void)
 Returns the Y coordinate of the screen pixel where the last patch was taken. More...
 
bool IsInStroke () const
 Returns true if we are in the middle of a stroke. More...
 
bool IsInTumble () const
 Returns true if we are in the middle of tumbling the scene. More...
 
void SetInTumble (bool b)
 Allows plugin to override and force the in tumble state to be true. More...
 
bool IsInDoubleClick () const
 Returns true if we are in double-click event. More...
 
bool IsInCameraNavigation () const
 Returns true if we are in the middle of a camera navigation Currently this is used to indicate viewcube and/or multitouch navigation It should be generalized to include mudbox alt+mouse navigation IsInTumble does not serve this purpose for the following reasons: More...
 
void SetInCameraNavigation (bool bInCameraNavigation=false)
 Set camera navigation state. More...
 
- Public Member Functions inherited from Node
 Node (const QString &sStringID="", const QString &sDisplayName="")
 Standard constructor. More...
 
virtual ~Node (void)
 
virtual void Initialize (void)
 
void LoadTemplate (const QString &sFileName="", bool bStartEvent=false)
 Use an external XML file to initialize the attributes. More...
 
void SaveTemplate (const QString &sFileName="", bool bSaveOnlyVisible=false)
 Save current attributes as an XML template. More...
 
unsigned int Version (void) const
 Returns the current version of the node. This number increases when the content of the node changed (when ContentChanged() called). More...
 
void SetVersion (unsigned int iVersion)
 Sets the current version number for the node. More...
 
unsigned int ReferenceCount (void) const
 Returns the number of pointers referencing this node. More...
 
AttributeReferencePointer (unsigned int iIndex) const
 Returns the address of an attribute which refers to this node. The type of the attribute is always aptr. More...
 
NodeReferenceNode (unsigned int iIndex) const
 Returns the address of a node referencing this node. More...
 
virtual QString Name (const ClassDesc *pClass=0) const
 Deprecated. More...
 
virtual void SetName (const QString &sName)
 Deprecated. More...
 
virtual QString StringID (const ClassDesc *pClass=0) const
 Returns the string id of the node. More...
 
virtual void SetStringID (const QString &sStringID)
 Sets the string id of the node. More...
 
virtual QString DisplayName (void) const
 Returns the display name of the node. More...
 
virtual void SetDisplayName (const QString &sDisplayName)
 Sets the display name of the node. More...
 
virtual QString HelpID (void) const
 Returns the help entry id of the node. Can be overwritten in derived classes. More...
 
virtual void SetHelpID (const QString &sHelpID)
 Sets the help entry id of the node. More...
 
void Annex (Node *pSource, const QString &sCategory="")
 Relink all the attributes of the source node to this one. More...
 
virtual void Serialize (Stream &s)
 Serializes the node. More...
 
bool IsKindOf (const ClassDesc *pClass) const
 Returns true if this node is derived from the pClass class. More...
 
void ContentChanged (void) const
 This function must be called if the content of the node is changed. More...
 
virtual void CheckValidity (DiagnosticLevel iLevel=dgnLevel2) const
 Checks the validity of this node. More...
 
virtual void CopyTo (Node *pNode) const
 
virtual NodeDuplicate (void) const
 
virtual void OnNodeEvent (const Attribute &cAttribute, NodeEventType cType)
 This function is called if an event occurs with any of the attributes of the node. More...
 
virtual void OnEvent (const EventGate &cEvent)
 This function is called when a generic event occurs. See EventGate class. More...
 
void RequestDeferredEvent (Attribute &cAttribute)
 Request for a deferred event, which will occur only in the main loop. More...
 
unsigned int AttributeCount (void) const
 Returns the number of attributes owned by the node. More...
 
AttributeAttributeByIndex (int iIndex) const
 Returns a specified attribute (or 0 if iIndex is greater than the number of attributes). More...
 
AttributeAttributeByName (const QString &sName) const
 Returns a specified attribute by its name. Returns 0 if the attribute not found. More...
 
AttributeAttributeByID (const QString &sID) const
 Returns a specified attribute by its ID. Returns 0 if the attribute not found. More...
 
void SetAttributeValue (const QString &sAttributeID, const QString &sNewValue)
 Set the value of an attribute from a string. More...
 
QString AttributeValue (const QString &sAttributeID) const
 Returns the current value of an attribute as a string. More...
 
void LogAttributes (void) const
 Write all attributes into the log file. More...
 
virtual QWidgetCreatePropertiesWindow (QWidget *pParent)
 Create a window which displays the attributes of the node. Can be overriden to provide a custom interface. More...
 
AttributeAddAttribute (Attribute::AttributeType type, const QString &id)
 Allows SDK users to add attributes at runtime. More...
 
NodeNext (void) const
 Returns the next node in the chain. Used to enumerate the current nodes. See also First(). More...
 
int ID (void) const
 Returns an ID for the node. The ID is unique in the whole application life. More...
 
bool SetID (int iID)
 Set ID for the node. More...
 

Public Attributes

aptr< BrushOperationSelectedBrush
 This pointer contains the address of the currently selected brush. More...
 
aptr< KeyboardEventNotifierKeyboardEvent
 This is a pointer to the latest keyboard event. More...
 
aevent PostUIInitializationEvent
 This event is triggered after the Mudbox main UI window is created. More...
 
aptr< MenuManipulatorCurrentMenu
 This attribute contains the address of the current menu creator object. More...
 
- Public Attributes inherited from Node
AttributeThisPointer m_pThis
 
 DECLARE_CLASS
 

Static Public Attributes

static QString menuFile
 
static QString menuEdit
 
static QString menuCreate
 
static QString menuCurves
 
static QString menuDisplay
 
static QString menuHelp
 
static QString menuPlugins
 
static QString menuMesh
 
static QString menuRender
 
static QString menuScripts
 
static QString menuMaps
 
static QString menuWindows
 

Additional Inherited Members

- Static Public Member Functions inherited from Node
static void StartHashing ()
 This is called once in main once static ctors are done. More...
 
static NodeFirst (void)
 This function will return the first node in the memory. Used to enumerate all the current nodes. See also Next(). More...
 
static NodeByID (int iID)
 Returns the node with the specified ID, or zero if such a node does not exists. More...
 
static NodeByName (const QString &sClass, const QString &sName)
 Search for a node with the name sName. More...
 

Member Enumeration Documentation

Enumerator
ltSculptUI 

Sculpt Layer UI.

ltPaintUI 

Paint Layer UI.

Definition at line 48 of file interface.h.

49  {
50  ltSculptUI,
51  ltPaintUI
52  };
Sculpt Layer UI.
Definition: interface.h:50
Paint Layer UI.
Definition: interface.h:51
Enumerator
msgInformation 
msgWarning 
msgQuestion 
msgError 

Definition at line 53 of file interface.h.

Enumerator
buttonNone 
buttonOk 
buttonCancel 
buttonClose 
buttonYes 
buttonYesToAll 
buttonNo 
buttonNoToAll 
buttonAbort 
buttonRetry 
buttonIgnore 
buttonHelp 

Definition at line 60 of file interface.h.

Enumerator
HUDmsgPin 

keep the HUD message up until specifically cancelled

HUDmsgFade 

make the message fade away after a few seconds

Definition at line 75 of file interface.h.

76  {
77  HUDmsgPin,
78  HUDmsgFade
79  };
keep the HUD message up until specifically cancelled
Definition: interface.h:77
make the message fade away after a few seconds
Definition: interface.h:78
enum StatusType
Enumerator
stNormal 

message

stWarning 

warning

stError 

error

Definition at line 81 of file interface.h.

Enumerator
HotkeySetMudbox 
HotkeySetMaya 
HotkeySet3dsMax 
HotkeySetSoftimage 

Definition at line 88 of file interface.h.

enum MenuType
Enumerator
ddmFile 
ddmEdit 

For I/O related functions.

ddmCreate 

For editing related functions.

ddmMesh 

For functions which create new objects in the scene.

ddmCurves 

For mesh functions.

ddmDisplay 

For curve related functions.

ddmMaps 

For functions related to the 3d viewport.

ddmRender 

For functions related to textures.

ddmWindows 

For rendering related functions.

ddmHelp 

For functions related to windows.

ddmLayerContext 

For help related functions.

ddmObjectListContext 

For the layer context menu, which the user activates by right clicking on a layer in the layer list.

ddmHotbox 

For the object context menu, which the user activates by right clicking on an object in the object list.

ddmMarking 

For the hotbox menu, which is activated by the space bar.

For a marking menu, which is activated by the RMB, or a submenu of the hotbox

Definition at line 96 of file interface.h.

97  {
98  ddmFile,
99  ddmEdit,
100  ddmCreate,
101  ddmMesh,
102  ddmCurves,
103  ddmDisplay,
104  ddmMaps,
105  ddmRender,
106  ddmWindows,
107  ddmHelp,
110  ddmHotbox,
111  ddmMarking
112  };
For rendering related functions.
Definition: interface.h:106
For mesh functions.
Definition: interface.h:102
For curve related functions.
Definition: interface.h:103
For I/O related functions.
Definition: interface.h:99
For help related functions.
Definition: interface.h:108
For the object context menu, which the user activates by right clicking on an object in the object li...
Definition: interface.h:110
For the hotbox menu, which is activated by the space bar.
Definition: interface.h:111
For functions related to windows.
Definition: interface.h:107
For functions related to the 3d viewport.
Definition: interface.h:104
For editing related functions.
Definition: interface.h:100
For the layer context menu, which the user activates by right clicking on a layer in the layer list...
Definition: interface.h:109
For functions which create new objects in the scene.
Definition: interface.h:101
For functions related to textures.
Definition: interface.h:105

Constructor & Destructor Documentation

Interface ( void  )

Member Function Documentation

QMenu* DropDownMenu ( MenuType  eType) const
QWidget* MainWindow ( void  ) const

Returns a pointer to the main window.

void ShowNewPaintLayerDialog ( void  )
void ShowBrushRing ( bool  bShow)

This function turns on/off displaying the brush indicator ring.

bool RestorePreviousBrush ( void  )

Restores the current brush to the previous one.

void SetSelectedBrush ( const QString sBrushName)

Set the currently selected brush.

void ActivateLayerSystem ( LayerUIType  eType)

Activates the given system in the Layer UI window.

Parameters
[in]eTypeThe layer system to activate.
void Load ( QString  filename,
Scene::LoadData cData 
)

Loads scene data.

This method loads a file from disk the same way the File Menu > Open command does. Note that this method differs from Scene::Load in that it automatically adds filename to the list of recent files, and updates other UI elements, whereas Scene::Load does not.

Parameters
[in]filenamepath to the file on disk, by default this can be a .obj, .mud or .fbx file.
[in]cDataThe load options. Note if m_bMerge is true, the contents of the file are merged into the current scene. Otherwise they are added to a new scene.
void ShowProperties ( Node pNode,
bool  bFloating 
) const

Open a new properties dialog for the given node.

Parameters
[in]pNodeAddress of the node whose parameters should be shown.
[in]bFloatingDeclares if the properties shoulod be in a floating panel or in the docked Properties pane
void ClearProperties ( )

Clears the property dialog.

int MessageBox ( MessageBoxType  iType,
const QString sTitle,
const QString sText,
int  iButtons = buttonNone,
int  iDefaultButton = buttonNone 
)

Displays a modal message box to the user.

Parameters
[in]iTypeOne of mudbox::Interface::msgInformation, mudbox::Interface::msgWarning, mudbox::Interface::msgQuestion or mudbox::Interface::msgError
[in]sTitleThe title of the message box
[in]sTextThe text of the message
[in]iButtonsThe buttons to include. Specify this as a bitwise OR of the available MessageBoxButton flags.
[in]iDefaultButtonSpecifies which of the buttons should be the default when the window opens
int OneTimeMessageBox ( MessageBoxType  iType,
const QString sTitle,
const QString sText,
int  buttons = 0 
)

Displays a informational modal message box to the user with a checkbox option to not show the dialog again.

Returns the ID of the button pressed by the user. Returns QMessageBox::Ok if the user had previously chosen not to show the dialog again

Parameters
[in]iTypeOne of mudbox::Interface::msgInformation, mudbox::Interface::msgWarning, mudbox::Interface::msgQuestion or mudbox::Interface::msgError
[in]sTitleThe title of the message box
[in]sTextThe text of the message
[in]buttonsButtons to appear in the dialog
void HUDMessageShow ( const QString sMessage,
HUDMessageType  iType = HUDmsgFade 
)

Displays a message as text overlay (HUD) in the 3d view.

You can specify if the message is temporary (fading after a few seconds) or if it should stay "pinned" on the screen until overwritten or dismissed with HUDMessageHide(). New messages will replace previous ones.

Parameters
[in]sMessageThe text of the message (may include some HTML tags, such as for bold or italics)
[in]iTypeOne of mudbox::Interface::HUDmsgPin or mudbox::Interface::HUDmsgFade
void HUDMessageHide ( )

Hides a text overlay (HUD) message created with a call to HUDMessageShow().

Note: if a message was displayed with the mudbox::Interface::HUDmsgFade parameter, then it will go away after a few seconds with no intervention.

void SetStatus ( StatusType  iType,
const QString sMsg 
)

Display a message in the status bar, which is on the bottom edge of the Mudbox window.

Parameters
[in]iTypeDetermines the color of the message. One of mudbox::Interface::stNormal, mudbox::Interface::stWarning, or mudbox::Interface::stError
[in]sMsgThe text of the message
void AddClassMenuItem ( const QString sMenu,
const QString sSubmenu,
const ClassDesc pClass,
const QString sCreatorText,
const int index = -1,
const int subindex = -1,
const bool  addSeparator = false,
int  version = 0 
)

Adds a new submenu to the interface that can be used to create and edit instances of a class you define in your plug-in.

For example, if you call:

Kernel()->Interface()->AddClassMenuItem( mudbox::Interface::menuMaps, "MyItem", myClass::StaticClass(), "Make New Instance" );

A new submenu (named "MyItem") will be added to the end of the "Maps" menu. This new submenu will initially contain one item, called "Make New Instance". If you select this item, a new instance of myClass will be created, and an editor opened for it so you can change its values. The name of the new instance will also be added to the "MyItem" submenu, so that you can go back and edit it later.

Note that "StaticClass()" is automatically defined for any class that uses the IMPLEMENT_CLASS macro.

Parameters
[in]sMenuThe name of the menu to which your sub-menu will be added.
[in]sSubmenuThe name of the sub-menu to be created
[in]pClassThe class to be created by the new menu item
[in]sCreatorTextThe name of the menu item that will create your new class
[in]indexThe index where you want to insert the new menu item. -1 means append to the end of menu
[in]subindexThe index where you want to insert the submenu if it does not exist already, -1 means append to the end of menu
[in]addSeparatorSet this to true if you want separators around this item
[in]versionThe version of Mudbox where this functionality was added. Use constants found in mudboxVersions.h
void AddCallbackMenuItem ( const QString sMenu,
const QString sSubmenu,
const QString sItemName,
void(*)()  pCallback,
const QString sID = "",
const int index = -1,
const int subindex = -1,
const bool  addSeparator = false,
int  version = 0 
)

Adds a new menu item that calls a callback function you specify in your plug-in.

The signature of your callback function must be:

void myCallback();
Parameters
[in]sMenuThe name of the menu to which the item should be added
[in]sSubmenuThe name of a submenu to which the item should be added (if you don't want a submenu, pass in an empty QString)
[in]sItemNameThe display name of the new menu item that will call your callback
[in]pCallbackA pointer to the callback function
[in]sIDThe internal ID of the new menu item
[in]indexThe index where you want to insert the new menu item. -1 means append to the end of menu
[in]subindexThe index where you want to insert the submenu if it does not exist already, -1 means append to the end of menu
[in]addSeparatorSet this to true if you want separators around this item.
[in]versionThe version of Mudbox where this functionality was added. Use constants found in mudboxVersions.h
void AddWelcomeWindowButton ( const QString sItemName,
void(*)()  pCallback,
const QString icon = "",
const QString styleSheet = "" 
)

Adds a new button to the "More" section of the welcome window.

The signature of your callback function must be:

void myCallback();
Parameters
[in]sItemNameThe display name of the new button that will be added (should be unique)
[in]pCallbackA pointer to the callback function to be called when the user presses the button
[in]iconA file path to an optional icon, which will be displayed in the button
[in]styleSheetAn optional Qt stylesheet, that can be used to change the appearance of the button
void RemoveWelcomeWindowButton ( const QString sItemName)

Removes a button that was added via AddWelcomeWindowButton.

Parameters
[in]sItemNameThe display name of the button to be removed
void SelectHotkeySet ( HotkeySetName  newKeySet,
bool  forceSetHotkey = false 
)

Changes the hotkeys to more closely match those in other Autodesk applications.

Parameters
[in]newKeySetThe desired keyset: HotkeySetMudbox, HotkeySetMaya, HotkeySet3dsMax or HotkeySetSoftimage
[in]forceSetHotkeyIf true, force an update even if there is no change to the current preset
HotkeySetName CurrentHotkeySet ( ) const

Returns a code indicating the current Hotkey presets in use by Mudbox.

void AddToCreateMeshMenu ( QFileInfo  fileInfo)

Adds a mesh to the Create->Mesh menu.

void AddObjectListContextMenuItem ( const ClassDesc pObjectType,
const QString sItemName,
void(*)()  pCallback,
int  index = -1,
bool  addSeparator = false,
int  version = 0 
)

Adds a menu item to the context menu that comes up when you right-click an object in the Object List.

Parameters
[in]pObjectTypeThe new menu item will only appear when you click on objects of this type
[in]sItemNameThe name of the new menu item
[in]pCallbackA pointer to the callback function
[in]indexThe index where you want to insert the new menu item. -1 means append to the end of menu
[in]addSeparatorSet this to true if you want separators around this item.
[in]versionThe version of Mudbox where this functionality was added. Use constants found in mudboxVersions.h
void AddLayerCallbackMenuItem ( mudbox::Interface::LayerUIType  ltType,
const QString sItemName,
void(*)()  pCallback,
int  version = 0 
)

Adds a menu item to the context menu that comes up when you right-click on a sculpt or paint layer.

Parameters
[in]ltTypeOne of ltSculptUI or ltPaintUI, depending on what kind of layer you want to display this menu item
[in]sItemNameThe name of the new menu item
[in]pCallbackA pointer to the callback function
[in]versionThe version of Mudbox where this functionality was added. Use constants found in mudboxVersions.h
QAction* CreateHighlightableMenuItem ( const QString text,
QObject parent,
int  version = 0 
)

Returns a special QAction (see Qt documentation) that can be highlighted when the user turns on "What's New Highlighting".

Parameters
[in]textThe name of the menu item
[in]parentA pointer to the parent widget (usually the menu into which the item will be added)
[in]versionThe version of Mudbox where this functionality was added. Use constants found in mudboxVersions.h
void ProgressStart ( const QString sDescription,
unsigned int  iMaxValue,
float  fWeight = 1.0f,
int  iDelayTime = 0 
)

Displays a progress bar, to show a process beginning. This will set the current progess value to 0.

Parameters
[in]sDescriptionA name or description for the process whose progress is being shown
[in]iMaxValueA positive value representing the completion of the process
iDelayTime< [in] A number indicating how long does it take to complete this process, compared to others This is only used for approximating the length of groups. See ProgressStartGroup [in] Delay time in millisecond used to hide the progress bar, when time out, the progress bar will be displayed
void ProgressStartGroup ( const QString sDescription,
float  fTotalWeight,
int  iDelayTime = 0 
)

Displays a progress bar, which embeds other processes which has their own progress bar.

The progress bar of the embedded processes will not be visible, only a common progress bar for all of them.

Parameters
[in]sDescriptionA name or description for the process whose progress is being shown
iDelayTime< [in] Sum of the weights of all the embedded processes.
bool ProgressSet ( unsigned int  iValue)

Updates the current progress bar. Return true if cancel was requested, false otherwise.

Parameters
[in]iValueThe new progress value (the maximum allowed value was specified in ProgressStart() )
bool ProgressAdd ( void  )

Updates the current progress bar by adding one to the progress value used. Return true if cancel was requested, false otherwise.

void ProgressEnd ( void  )

Removes the current progress bar, whether or not the process is complete.

bool ProgressIsCancelRequested ( void  )

Returns true if the user cancelled an operation in progress.

When a progress bar is displayed, the user can cancel out of the operation in progress by clicking the cancel button, or by hitting the ESC key. If your plug-in is running a long process with a progress bar showing, it should call this method regularly to see if the user has cancelled the operation.

void ProgressRequestCancel ( void  )

When this function is called, Mudbox is trying to cancel the current operation.

QString LoadFileDialog ( const QString sTitle,
const QString sPath,
const QString sFilter,
QString sSelectedFilter = 0 
) const

Opens a modal file dialog so the user can choose an existing file to open.

Returns the path to the file.

If the user cancels out of the file dialog, an empty QString is returned.

Parameters
[in]sTitleThe title to display in the file dialog
[in]sPathThe initial path to display when the file dialog opens
[in]sFilterA QString that specifies which kind of files should be displayed. For example: "TIFF images (*.tif);;PNG images (*.png)"
[in,out]sSelectedFilterThe default filter to be used, and the selected filter by the user, if the pointer is not null
QString SaveFileDialog ( const QString sTitle,
const QString sPath,
const QString sFilter,
bool  bAskForOverwrite = true,
QString sSelectedFilter = 0 
) const

Opens a modal file dialog so the user can choose a file name to save to.

Returns the path to the file.

If the user cancels out of the file dialog, an empty QString is returned.

Parameters
[in]sTitleThe title to display in the file dialog
[in]sPathThe initial path to display when the file dialog opens
[in]sFilterA string that filters which kind of files should be displayed. For example: "TIFF images (*.tif);;PNG images (*.png)"
[in]bAskForOverwriteIf true, when the user chooses an existing file, he will be asked if he wants to overwrite it.
[in,out]sSelectedFilterThe default filter to be used, and the selected filter by the user, if the pointer is not null
QString GetDirectoryDialog ( const QString sTitle,
const QString sPath 
) const

Opens a modal file dialog so the user can choose an existing folder.

Returns the path to the folder.

If the user cancels out of the file dialog, an empty QString is returned.

Parameters
[in]sTitleThe title to display in the file dialog
[in]sPathThe initial path to display when the file dialog opens
QStringList LoadFilesDialog ( const QString sTitle,
const QString sPath,
const QString sFilter 
) const

Opens a modal file dialog so the user can choose existing files to open.

Returns the paths to these files.

If the user cancels out of the file dialog, an empty QString is returned.

Parameters
[in]sTitleThe title to display in the file dialog
[in]sPathThe initial path to display when the file dialog opens
[in]sFilterA QString that specifies which kind of files should be displayed. For example: "TIFF images (*.tif);;PNG images (*.png)"
void WaitCursorStart ( void  )

Show the wait cursor.

void WaitCursorEnd ( void  )

Restore the previous cursor after calling WaitCursorStart().

void RefreshUI ( void  ) const

Refresh all dialogs.

void AddView ( QString  className,
QString  windowTitle,
const bool  select = false 
) const

Adds a view in the central widget.

float currentTabletPressure ( ) const

Returns the current tablet pressure. Range is 0.0 to 1.0.

float LastPatchXPosition ( void  )

Returns the X coordinate of the screen pixel where the last patch was taken.

float LastPatchYPosition ( void  )

Returns the Y coordinate of the screen pixel where the last patch was taken.

bool IsInStroke ( ) const

Returns true if we are in the middle of a stroke.

bool IsInTumble ( ) const

Returns true if we are in the middle of tumbling the scene.

void SetInTumble ( bool  b)

Allows plugin to override and force the in tumble state to be true.

Certain optimizations can be performed in a tumble – like postponing rendering pick buffers, and computing texture tile histograms, for example.

bool IsInDoubleClick ( ) const

Returns true if we are in double-click event.

bool IsInCameraNavigation ( ) const

Returns true if we are in the middle of a camera navigation Currently this is used to indicate viewcube and/or multitouch navigation It should be generalized to include mudbox alt+mouse navigation IsInTumble does not serve this purpose for the following reasons:

  1. it checks for alt key state to determine navigation state
  2. it checks for tumble/track/dolly etc although its name reflects tumble only
  3. it only covers mudbox alt+mouse navigation
void SetInCameraNavigation ( bool  bInCameraNavigation = false)

Set camera navigation state.

Member Data Documentation

QString menuFile
static
+ Examples:

Definition at line 191 of file interface.h.

QString menuEdit
static
+ Examples:

Definition at line 192 of file interface.h.

QString menuCreate
static

Definition at line 193 of file interface.h.

QString menuCurves
static

Definition at line 194 of file interface.h.

QString menuDisplay
static

Definition at line 195 of file interface.h.

QString menuHelp
static

Definition at line 196 of file interface.h.

QString menuPlugins
static
QString menuMesh
static
+ Examples:

Definition at line 198 of file interface.h.

QString menuRender
static

Definition at line 199 of file interface.h.

QString menuScripts
static

Definition at line 200 of file interface.h.

QString menuMaps
static
+ Examples:

Definition at line 201 of file interface.h.

QString menuWindows
static

Definition at line 202 of file interface.h.

aptr<BrushOperation> SelectedBrush

This pointer contains the address of the currently selected brush.

Plugins can connect their own pointer of the same type to this attribute if they want to respond to brush activation events.

See also
Attribute::Connect().

Definition at line 221 of file interface.h.

aptr<KeyboardEventNotifier> KeyboardEvent
mutable

This is a pointer to the latest keyboard event.

Plugins can use this pointer to catch and respond to keyboard events. When a new event occurs, the value of this pointer changes to a structure which describes the event. The class should have it's own instance of a pointer with the same type, which should be connected to this pointer using the Attribute::AddTarget() function. The class can then catch and respond any changes made to this variable in its the OnNodeEvent() function.

Definition at line 487 of file interface.h.

aevent PostUIInitializationEvent

This event is triggered after the Mudbox main UI window is created.

Plugins can connect to this event to add additional UI or make modifications to the existing UI widgets in the window, after the window has been created.

Definition at line 492 of file interface.h.

aptr<MenuManipulator> CurrentMenu

This attribute contains the address of the current menu creator object.

Each time when mudbox is about to display a new menu, a new menucreator object is created, and its address is stored in this attribute. Plugins can watch this pointer by connecting their own attribute with the same type to it. It is possible to check the type of the menu and other circumstances, and based on those, modify the menu (remove items, add new items, make something disabled, etc..) Do not store the value in this attribute, since the menucreator object is only temporary. See the example plugin MenuMessenger for more details.

Definition at line 507 of file interface.h.


The documentation for this class was generated from the following file: