Skip to content

blockBuildUI


=== Author: Assaf Ben Zur ===

MANSUR - BLOCK

Main BLOCK UI.

This is the main UI for rig building (BLOCK). This is the essence of the entire library.

This tool gathers all user actions, and defines triggers for edditing rigs.

The main goal of this UI is to collect the available build-modules and draw creation buttons for them.

The core module library is defined as the block library, but additionals paths can be inserted into the collect loop.

Many UI triggers are available in this UI, but many are kept external to the UI class, to keep things as clean and independent as possible.

Most core functionalitites belong to the rig classes in 'buildModules'.



Classes


MnsBlockBuildUI [Class]

BLOCK UI Class.


Constructor: MnsBlockBuildUI(parent(str) ; [default: mnsUIUtils.get_maya_window()])
Inherits from: form_class, base_class
Class Members:
    • collapsibleWidgetPairing
    • tabIndex
    • buildModulesBtns
    • sidePlaceHolder
    • bmLib
    • bmToolTips
    • tabButtons
    • mayaSelectCallBack
Methods:

MnsBlockBuildUI methods


addMeshes [MnsBlockBuildUI class method]

Constructor: addMeshes(self, listWidget)
Return: None
Arguments:
  • self
  • listWidget
Optional Arguments:

addModulePath [MnsBlockBuildUI class method]


Add a module path line to the 'module paths' tree trigger.

Constructor: addModulePath(self)
Return: None
Arguments:
  • self
Optional Arguments:

addModulePresetPath [MnsBlockBuildUI class method]


Add a module path line to the 'module paths' tree trigger.

Constructor: addModulePresetPath(self)
Return: None
Arguments:
  • self
Optional Arguments:

applyModulePathsChange [MnsBlockBuildUI class method]


'Apply' (in build tab, module paths) trigger.

Write the additional paths entered within the UI in the stor json.

Constructor: applyModulePathsChange(self)
Return: None
Arguments:
  • self
Optional Arguments:

applyModulePresetPathsChange [MnsBlockBuildUI class method]


'Apply' (in build tab, module paths) trigger.

Write the additional paths entered within the UI in the stor json.

Constructor: applyModulePresetPathsChange(self)
Return: None
Arguments:
  • self
Optional Arguments:

bmCategoryChangedTrigger [MnsBlockBuildUI class method]

Constructor: bmCategoryChangedTrigger(self)
Return: None
Arguments:
  • self
Optional Arguments:

buildModulesDefine [MnsBlockBuildUI class method]


Define all existing build-modules within a built tab's directory.

This mehthod will run for every valid build-module's directory folder, essentially building the actual build-module button in the UI.

These will all be stored in the 'buildModulesBtns' attribute of this class.

Constructor: buildModulesDefine(self, modParentPath, listWidget)
Return: None
Arguments:
  • self
  • modParentPath
  • listWidget
Optional Arguments:

clearEcho [MnsBlockBuildUI class method]

Constructor: clearEcho(self)
Return: None
Arguments:
  • self
Optional Arguments:

closeEvent [MnsBlockBuildUI class method]

Constructor: closeEvent(self, QCloseEvent)
Return: None
Arguments:
  • self
  • QCloseEvent
Optional Arguments:

connectSignals [MnsBlockBuildUI class method]


Connect all UI signals.

Constructor: connectSignals(self)
Return: None
Arguments:
  • self
Optional Arguments:

constructRigInit [MnsBlockBuildUI class method]


Construct trigger.

Constructor: constructRigInit(self, **kwargs)
Return: None
Arguments:
  • self
  • **kwargs
Optional Arguments:

copySkin [MnsBlockBuildUI class method]

Constructor: copySkin(self)
Return: None
Arguments:
  • self
Optional Arguments:

createAllModulesSection [MnsBlockBuildUI class method]

Constructor: createAllModulesSection(self)
Return: None
Arguments:
  • self
Optional Arguments:

deconstructRigInit [MnsBlockBuildUI class method]


Deconstruct trigger.

Constructor: deconstructRigInit(self, **kwargs)
Return: None
Arguments:
  • self
  • **kwargs
Optional Arguments:

defineBuildParentModules [MnsBlockBuildUI class method]


Define build module tabs, based on the collected valid build-modules directories.

If the directory in question is a valid directory for build modules:

for every folder containing modules within it, a new tab will be inserted and named based on it.

Constructor: defineBuildParentModules(self)
Return: None
Arguments:
  • self
Optional Arguments:

duplicateModule [MnsBlockBuildUI class method]


Module duplicate.

Gather all of the requested module's settings, as well as compare against the module's default settings.

Build a new module (same module) using the gathered data, then match all guide positions for the new module guide.

Constructor: duplicateModule(self, **kwargs)
Return: None
Arguments:
  • self
  • **kwargs
Optional Arguments:

echoLog [MnsBlockBuildUI class method]

Constructor: echoLog(self, msg, svr)
Return: None
Arguments:
  • self
  • msg
  • svr
Optional Arguments:

eventFilter [MnsBlockBuildUI class method]


Override event filter to catch the tear off to override it's event.

Constructor: eventFilter(self, source, event)
Return: None
Arguments:
  • self
  • source
  • event
Optional Arguments:

extractControlShapes [MnsBlockBuildUI class method]


Extract all control shapes from the current constructed rig, and store them for future re-construction.

Constructor: extractControlShapes(self, **kwargs)
Return: None
Arguments:
  • self
  • **kwargs
Optional Arguments:

gatherAdditionalModulePaths [MnsBlockBuildUI class method]


Gather all existing additional custom patns from the UI.

Constructor: gatherAdditionalModulePaths(self)
Return: list (Paths)
Arguments:
  • self
Optional Arguments:

gatherAdditionalModulePresetPaths [MnsBlockBuildUI class method]


Gather all existing additional custom patns from the UI.

Constructor: gatherAdditionalModulePresetPaths(self)
Return: list (Paths)
Arguments:
  • self
Optional Arguments:

getConstructMode [MnsBlockBuildUI class method]


Get current UI radio-buttons construction state (All/Branch/Module).

Constructor: getConstructMode(self)
Return: int (construction mode)
Arguments:
  • self
Optional Arguments:

getCorrespondingModuleButtonForModule [MnsBlockBuildUI class method]


For the given rootGuide object, try to locate its corresponding UI button.

Look within this class's 'buildModulesBtns' attribute.

Constructor: getCorrespondingModuleButtonForModule(self, rootGuide)
Return: MnsBuildModuleBtn
Arguments:
  • self
  • rootGuide
Optional Arguments:

getCurrentMeshes [MnsBlockBuildUI class method]

Constructor: getCurrentMeshes(self, listWidget = None, **kwargs)
Return: None
Arguments:
  • self
  • listWidget(str) ; [default: None]
  • **kwargs
Optional Arguments:

getDefaultsMode [MnsBlockBuildUI class method]


Simple method to get the current UI 'defaults' mode.

Constructor: getDefaultsMode(self)
Return: int (defaults mode)
Arguments:
  • self
Optional Arguments:

getListWidgetFromSender [MnsBlockBuildUI class method]

Constructor: getListWidgetFromSender(self)
Return: None
Arguments:
  • self
Optional Arguments:

getModuleSettings [MnsBlockBuildUI class method]


Get passed in module settings.

First get the default settings and values from the build-module directory,

then compare against the rootGuide attributes, and return the filtered and altered settings.

Constructor: getModuleSettings(self, rootGuide, firstAttempt = True, **kwargs)
Return: dict,int (optionalArguments, spilt index - for dynUI)
Arguments:
  • self
  • rootGuide
  • firstAttempt(bool) ; [default: True]
  • **kwargs
Optional Arguments:

getPickerExportMode [MnsBlockBuildUI class method]

Constructor: getPickerExportMode(self)
Return: int
Arguments:
  • self
Optional Arguments:

getPickerProjectionMode [MnsBlockBuildUI class method]

Constructor: getPickerProjectionMode(self)
Return: None
Arguments:
  • self
Optional Arguments:

getPoseMode [MnsBlockBuildUI class method]

Constructor: getPoseMode(self)
Return: None
Arguments:
  • self
Optional Arguments:

getToolTipForModule [MnsBlockBuildUI class method]

Constructor: getToolTipForModule(self, buildModule)
Return: None
Arguments:
  • self
  • buildModule
Optional Arguments:

initView [MnsBlockBuildUI class method]


Initialize view:

- Set icons

- Set logger view

- Set tab index to 1

- Set-Up CollapsibleWidget view

Constructor: initView(self)
Return: None
Arguments:
  • self
Optional Arguments:

initializeAdditionalModulePaths [MnsBlockBuildUI class method]


Initialize any custom build-modules paths that already exist within the data collect json.

(Read any paths that were added before, on UI draw).

query flag will return the paths only without drawing the items into the UI.

Constructor: initializeAdditionalModulePaths(self, **kwargs)
Return: list (Existing Paths)
Arguments:
  • self
  • **kwargs
Optional Arguments:

initializeAdditionalModulePresetsPaths [MnsBlockBuildUI class method]


Initialize any custom build-modules paths that already exist within the data collect json.

(Read any paths that were added before, on UI draw).

query flag will return the paths only without drawing the items into the UI.

Constructor: initializeAdditionalModulePresetsPaths(self, **kwargs)
Return: list (Existing Paths)
Arguments:
  • self
  • **kwargs
Optional Arguments:

initializeGuidePresetCb [MnsBlockBuildUI class method]

Constructor: initializeGuidePresetCb(self)
Return: None
Arguments:
  • self
Optional Arguments:

initializePrefDirs [MnsBlockBuildUI class method]

Constructor: initializePrefDirs(self)
Return: None
Arguments:
  • self
Optional Arguments:

loadMeshes [MnsBlockBuildUI class method]

Constructor: loadMeshes(self, **kwargs)
Return: None
Arguments:
  • self
  • **kwargs
Optional Arguments:

loadModuleSettings [MnsBlockBuildUI class method]


Load selected module setting trigger.

Constructor: loadModuleSettings(self, firstAttempt = True)
Return: None
Arguments:
  • self
  • firstAttempt(bool) ; [default: True]
Optional Arguments:

loadRigSettings [MnsBlockBuildUI class method]


Load selected rig settings trigger.

Constructor: loadRigSettings(self)
Return: None
Arguments:
  • self
Optional Arguments:

loadSelectionToLineEdit [MnsBlockBuildUI class method]

Constructor: loadSelectionToLineEdit(self, lEditWidget = None)
Return: None
Arguments:
  • self
  • lEditWidget(str) ; [default: None]
Optional Arguments:

loadWindow [MnsBlockBuildUI class method]


Show window method.

Constructor: loadWindow(self)
Return: None
Arguments:
  • self
Optional Arguments:

meshListWidgetMenu [MnsBlockBuildUI class method]

Constructor: meshListWidgetMenu(self, position)
Return: None
Arguments:
  • self
  • position
Optional Arguments:

moduleBuildGuide [MnsBlockBuildUI class method]


Action trigger for any build-module button.

This trigger action will be connected procedurally within the 'drawModuleButton' method in blockUtility.

Constructor: moduleBuildGuide(self, listWidgetItemName)
Return: None
Arguments:
  • self
  • listWidgetItemName
Optional Arguments:

newRigTopTrig [MnsBlockBuildUI class method]


Utils->'New RigTop' trigger.

deselect, then initialize a MnsRig class.

Constructor: newRigTopTrig(self)
Return: None
Arguments:
  • self
Optional Arguments:

orientGuides [MnsBlockBuildUI class method]


orient guides trigger

mode 0 = All

mode 1 = Branch

mode 2 = Module

mode 3 = Selection

Constructor: orientGuides(self)
Return: None
Arguments:
  • self
Optional Arguments:

plgMatch [MnsBlockBuildUI class method]

Constructor: plgMatch(self)
Return: None
Arguments:
  • self
Optional Arguments:

poseSaveLoadTrigger [MnsBlockBuildUI class method]


Save/Load pose trigger.

Simple method to gather pose data and store it, or apply it.

Constructor: poseSaveLoadTrigger(self, saveLoadMode = 0)
Return: None
Arguments:
  • self
  • saveLoadMode(int) ; [default: 0]
Optional Arguments:

promoteModule [MnsBlockBuildUI class method]

Constructor: promoteModule(self)
Return: None
Arguments:
  • self
Optional Arguments:

pureDuplicate [MnsBlockBuildUI class method]


Module duplicate.

Gather all of the requested module's settings, as well as compare against the module's default settings.

Build a new module (same module) using the gathered data.

Constructor: pureDuplicate(self, modRoot, **kwargs)
Return: MnsBuildModule (New Module)
Arguments:
  • self
  • modRoot
  • **kwargs
Optional Arguments:

refreshSelectionState [MnsBlockBuildUI class method]

Constructor: refreshSelectionState(self, dummy = None)
Return: None
Arguments:
  • self
  • dummy(str) ; [default: None]
Optional Arguments:

removeCustomShapes [MnsBlockBuildUI class method]


Remove all custom control shapes from the current rig.

Constructor: removeCustomShapes(self)
Return: None
Arguments:
  • self
Optional Arguments:

removeMeshes [MnsBlockBuildUI class method]

Constructor: removeMeshes(self, listWidget)
Return: None
Arguments:
  • self
  • listWidget
Optional Arguments:

removeModelPath [MnsBlockBuildUI class method]


Remove a module path line from the 'module paths' tree trigger.

Constructor: removeModelPath(self)
Return: None
Arguments:
  • self
Optional Arguments:

removeModulePresetPath [MnsBlockBuildUI class method]


Remove a module path line from the 'module paths' tree trigger.

Constructor: removeModulePresetPath(self)
Return: None
Arguments:
  • self
Optional Arguments:

resizeEvent [MnsBlockBuildUI class method]

Constructor: resizeEvent(self, QResizeEvent)
Return: None
Arguments:
  • self
  • QResizeEvent
Optional Arguments:

resizeWindowBasedOnLog [MnsBlockBuildUI class method]

Constructor: resizeWindowBasedOnLog(self)
Return: None
Arguments:
  • self
Optional Arguments:

sceneSelectFromWidgets [MnsBlockBuildUI class method]

Constructor: sceneSelectFromWidgets(self)
Return: None
Arguments:
  • self
Optional Arguments:

setCollapsibleWidgetPairing [MnsBlockBuildUI class method]

Constructor: setCollapsibleWidgetPairing(self)
Return: None
Arguments:
  • self
Optional Arguments:

sortMeshLists [MnsBlockBuildUI class method]

Constructor: sortMeshLists(self)
Return: None
Arguments:
  • self
Optional Arguments:

symmetrizeControlShapes [MnsBlockBuildUI class method]


For the selected state, symmetrize all found control shapes.

sym Mode:

0: Left to Right

1: Right to Left

Constructor: symmetrizeControlShapes(self)
Return: None
Arguments:
  • self
Optional Arguments:

symmetrizeModule [MnsBlockBuildUI class method]


Symmetrize module trigger.

Exclusive class member process.

This method will attempt to symmetrize the requested module guides.

Constructor: symmetrizeModule(self)
Return: None
Arguments:
  • self
Optional Arguments:

toggleProjPerpCam [MnsBlockBuildUI class method]

Constructor: toggleProjPerpCam(self)
Return: None
Arguments:
  • self
Optional Arguments:

updateMeshWidgetsDict [MnsBlockBuildUI class method]

Constructor: updateMeshWidgetsDict(self)
Return: None
Arguments:
  • self
Optional Arguments:

updateSettings [MnsBlockBuildUI class method]


update setting trigger. This method will apply when a user altered any data within a setting window and chose to apply the changes.

The current settings will be validated against the default settings, and in case any data changed,

all neccessary actions will be called to apply and store the changes.

Constructor: updateSettings(self, **kwargs)
Return: None
Arguments:
  • self
  • **kwargs
Optional Arguments:


Defenitions


loadBlock

Load the BLOCK UI from globals, avoid UI duplication.


Constructor: loadBlock()
Return: None
Arguments:
Keyword Arguments:


reloadBlock

Constructor: reloadBlock(previousBlockWindow)
Return: None
Arguments:
  • previousBlockWindow
Keyword Arguments: