mgear.rigbits.rbf_manager_ui

A tool to manage a number of rbf type nodes under a user defined setup(name)

Steps -
set Driver set Control for driver(optional, recommended) select attributes to driver RBF nodes Select Node to be driven in scene(Animation control, transform) Name newly created setup select attributes to be driven by the setup add any additional driven nodes position driver(via the control) position the driven node(s) select add pose

Add notes - Please ensure the driver node is NOT in the same position more than once. This will cause the RBFNode to fail while calculating. This can be fixed by deleting any two poses with the same input values.

Edit Notes - Edit a pose by selecting “pose #” in the table. (which recalls recorded pose) reposition any controls involved in the setup select “Edit Pose”

Delete notes - select desired “pose #” select “Delete Pose”

Mirror notes - setups/Controls will succefully mirror if they have had their inverseAttrs configured previously.

2.0 ——- LOOK into coloring the pose and how close it is import replace name support (will work through json manually) support live connections settings support for suffix, etc rename existing setup newScene callback

mgear.rigbits.rbf_manager_ui.CTL_SUFFIX

str – suffix for anim controls

mgear.rigbits.rbf_manager_ui.DRIVEN_SUFFIX

str – suffix for driven group nodes

mgear.rigbits.rbf_manager_ui.EXTRA_MODULE_DICT

str – name of the dict which holds additional modules

mgear.rigbits.rbf_manager_ui.MGEAR_EXTRA_ENVIRON

str – environment variable to query for paths

mgear.rigbits.rbf_manager_ui.TOOL_NAME

str – name of UI

mgear.rigbits.rbf_manager_ui.TOOL_TITLE

str – title as it appears in the ui

mgear.rigbits.rbf_manager_ui.__version__

float – UI version

Deleted Attributes:
RBF_MODULES (dict): of supported rbf modules

__author__ = “Rafael Villar” __email__ = “rav@ravrigs.com” __credits__ = [“Miquel Campos”, “Ingo Clemens”]

class mgear.rigbits.rbf_manager_ui.ClickableLineEdit

subclass to allow for clickable lineEdit, as a button

clicked

QtCore.Signal – emitted when clicked

clicked = <PySide2.QtCore.Signal object>
mousePressEvent(event)
staticMetaObject = <PySide2.QtCore.QMetaObject object>
mgear.rigbits.rbf_manager_ui.HLine()

seporator line for widgets

Returns:line for seperating UI elements visually
Return type:Qframe
class mgear.rigbits.rbf_manager_ui.RBFManagerUI(parent=None, hideMenuBar=False, newSceneCallBack=True)

A manager for creating, mirroring, importing/exporting poses created for RBF type nodes.

absWorld

bool – Type of pose info look up, world vs local

addRbfButton

QPushButton – button for adding RBFs to setup

allSetupsInfo

dict – setupName:[of all the RBFNodes in scene]

attrMenu

TYPE – Description

currentRBFSetupNodes

list – currently selected setup nodes(userSelect)

driverPoseTableWidget

QTableWidget – poseInfo for the driver node

genericWidgetHight

int – convenience to adjust height of all buttons

mousePosition

QPose – if tracking mouse position on UI

rbfTabWidget

QTabWidget – where the driven table node info is

displayed
addNewTab(rbfNode)

Create a new tab in the setup

Parameters:rbfNode (RBFNode) – to pull information from
Returns:created widget
Return type:QWidget
addPose()

Add pose to rbf nodes in setup. Additional index on all nodes

Returns:Description
Return type:TYPE
addRBFToSetup()

query the user in case of a new setup or adding additional RBFs to existing.

Returns:Description
Return type:TYPE
addRemoveButtonWidget(label1, label2, horizontal=True)
attrListMenu(attributeListWidget, driverLineEdit, QPos, nodeToQuery=None)

right click menu for queie qlistwidget

Parameters:
  • attributeListWidget (QListWidget) – widget to display menu over
  • driverLineEdit (QLineEdit) – widget to query the attrs from
  • QPos (QtCore.QPos) – due to the signal, used
  • nodeToQuery (None, optional) – To display attrs from this nodes
  • menu placement (for) –
No Longer Returned:
n/a: n/a
callBackFunc(*args)

super safe function for trying to refresh the UI, should anything fail.

Parameters:*args – Description
clearDrivenTabs()

force deletion on tab widgets

closeEvent(evnt)

on UI close, ensure that all attrControlgrps are destroyed in case the user is just reopening the UI. Properly severs ties to the attrs

Parameters:evnt (Qt.QEvent) – Close event called
connectSignals()

connect all the signals in the UI Exceptions being MenuBar and Table header signals

createAndTagDrivenWidget(weightInfo, lockWidgets=True)

create and associate a widget, populated with the information provided by the weightInfo

Parameters:
  • weightInfo (dict) – information to populate the widgets with
  • lockWidgets (bool, optional) – should they be locked from editing
Returns:

parent widget that houses all the information to display

Return type:

QWidget

createCentralWidget()

main UI assembly

Returns:main UI to be parented to as the centralWidget
Return type:QtWidget
createDrivenAttributeWidget()

the widget that displays the driven information

Returns:[of widgets]
Return type:list
createDriverAttributeWidget()

widget where the user inputs information for the setups

Returns:[of widgets]
Return type:list
createMenuBar(hideMenuBar=False)

Create the UI menubar, with option to hide based on mouse input

Parameters:hideMenuBar (bool, optional) – should it autoHide
Returns:for parenting
Return type:QMenuBar
createOptionsButtonsWidget()

add, edit, delete buttons for modifying rbf setups.

Returns:[QPushButtons]
Return type:list
createSetupSelectorWidget()

create the top portion of the weidget, select setup + refresh

Returns:QLayout, QCombobox, QPushButton
Return type:list
createTabWidget()

Tab widget to add driven widgets too. Custom TabBar so the tab is easier to select

Returns:
Return type:QTabWidget
createTableWidget()

create table widget used to display poses, set tooltips and colum

Returns:QTableWidget
Return type:QTableWidget
deletePose()

delete a pose from the UI and all the RBFNodes in the setup.

Returns:n/a
Return type:n/a
deleteSetup(setupName=None)

Delete all the nodes within a setup.

Parameters:setupName (None, optional) – Description
displayRBFSetupInfo(index)

Display the rbfnodes within the desired setups

Parameters:index (int) – signal information
editPose()

edit an existing pose. Specify the index

Returns:Description
Return type:TYPE
exportNodes(allSetups=True)

export all nodes or nodes from current setup

Parameters:allSetups (bool, optional) – If all or setup
Returns:nada
Return type:n/a
gatherMirroredInfo(rbfNodes)

gather all the info from the provided nodes and string replace side information for its mirror. Using mGear standard naming convections

Parameters:rbfNodes (list) – [of RBFNodes]
Returns:with all the info mirrored
Return type:dict
getDrivenNodesFromSetup()

based on the user selected setup, get the associated RBF nodes

Returns:driven rbfnodes
Return type:list
getMirroredSetupTargetsInfo()

convenience function to get all the mirrored info for the new side

Returns:mirrored dict information
Return type:dict
getRBFNodesInfo(rbfNodes)

create a dictionary of all the RBFInfo(referred to as weightNodeInfo a lot) for export

Parameters:rbfNodes (list) – [of RBFNodes]
Returns:of all the rbfNodes provided
Return type:dict
getSelectedSetup()

return the string name of the selected setup from user and type

Returns:name, nodeType
Return type:str, str
getUserSetupInfo(drivenNode, drivenAttrs, setupField=True)

prompt the user for information needed to create setup or add rbf node to existing setup

Parameters:
  • drivenAttrs (list) – of attrs to display to user to select from
  • setupField (bool, optional) – should the user be asked to input
  • name for setup (a) –
Returns:

list of selected attrs, name specified

Return type:

list

hideMenuBar(x, y)

rules to hide/show the menubar when hide is enabled

Parameters:
  • x (int) – coord X of the mouse
  • y (int) – coord Y of the mouse
highlightListEntries(listWidget, toHighlight)

set the items in a listWidget to be highlighted if they are in list

Parameters:
  • listWidget (QListWidget) – list to highlight items on
  • toHighlight (list) – of things to highlight
importNodes()

import a setup(s) from file select by user

Returns:nada
Return type:n/a
labelListWidget(label, horizontal=True)

create the listAttribute that users can select their driver/driven attributes for the setup

Parameters:
  • label (str) – to display above the listWidget
  • horizontal (bool, optional) – should the label be above or infront
  • the listWidget (of) –
Returns:

QLayout, QListWidget

Return type:

list

lockDriverWidgets(lock=True)

toggle the ability to edit widgets after they have been set

Parameters:lock (bool, optional) – should it be locked
mirrorSetup()

gather all info on current setup, mirror the info, use the creation func from that rbf module type to create the nodes in the setup with mirrored information.

THE ONLY nodes created will be the ones created during normal “add pose” creation. Assumption is that all nodes that need drive, driven by the setup exist.

Returns:nada
Return type:n/a
mouseMoveEvent(event)

used for tracking the mouse position over the UI, in this case for menu hiding/show

Parameters:event (Qt.QEvent) – events to filter
mousePosition = <PySide2.QtCore.Signal object>
newSceneCallBack()

create a new scene callback to refresh the UI when scene changes.

populateDrivenWidgetInfo(drivenWidget, weightInfo, rbfNode)

set the information from the weightInfo to the widgets child of drivenWidget

Parameters:
  • drivenWidget (QWidget) – parent widget
  • weightInfo (dict) – of information to display
  • rbfNode (RBFNode) – instance of the RBFNode
Returns:

n/a

Return type:

n/a

populateDriverInfo(rbfNode, weightInfo)

populate the driver widget, driver, control, driving attrs

Parameters:
  • rbfNode (RBFNode) – node for query
  • weightInfo (dict) – to pull information from, since we have it
recallDriverPose(indexSelected)

recall a pose recorded from one of the RBFNodes in currentSelection it should not matter when RBFNode in setup is selected as they should all be in sync

Parameters:indexSelected (int) – index of the pose to recall
Returns:nada
Return type:n/a
recreateDrivenTabs(rbfNodes)

remove tabs and create ones for each node in rbfNodes provided

Parameters:rbfNodes (list) – [of RBFNodes]
reevalluateAllNodes()

for evaluation on all nodes in any setup. In case of manual editing

refresh(rbfSelection=True, driverSelection=True, drivenSelection=True, currentRBFSetupNodes=True, *args)

Refreshes the UI

Parameters:
  • rbfSelection (bool, optional) – desired section to refresh
  • driverSelection (bool, optional) – desired section to refresh
  • drivenSelection (bool, optional) – desired section to refresh
  • currentRBFSetupNodes (bool, optional) – desired section to refresh
refreshAllTables()

Convenience function to refresh all the tables on all the tabs with latest information.

refreshRbfSetupList(setToSelection=False)

refresh the list of setups the user may select from

Parameters:setToSelection (bool, optional) – after refresh, set to desired
removeRBFFromSetup(drivenWidgetIndex)

remove RBF tab from setup. Delete driven group, attrs and clean up

Parameters:
  • drivenWidgetIndex (QWidget) – parent widget that houses the contents
  • info of the rbf node (and) –
Returns:

n/a

Return type:

n/a

removeSceneCallback()

remove the callback associated witht he UI, quietly fail.

selectNodeWidget(label, buttonLabel='Select')

create a lout with label, lineEdit, QPushbutton for user input

setAttributeDisplay(attrListWidget, driverName, displayAttrs)
setConsistentHeaderSelection(headerIndex)

when a pose is selected in one table, ensure the selection in all other tables, to avoid visual confusion

Parameters:headerIndex (int) – desired header to highlight
setDrivenTable(drivenWidget, rbfNode, weightInfo)

set the widgets with information from the weightInfo for dispaly

Parameters:
  • drivenWidget (QWidget) – parent widget, the tab to populate
  • rbfNode (RBFNode) – node associated with widget
  • weightInfo (dict) – of information to display
setDriverControlOnSetup(controlName)

make sure to set the driverControlAttr when the user supplies one

Parameters:controlName (str) – name of the control to set in an attr
setDriverTable(rbfNode, weightInfo)

Set the driverTable widget with the information from the weightInfo

Parameters:
  • rbfNode (RBFNode) – node to query additional info from
  • weightInfo (dict) – to pull information from
Returns:

n/a

Return type:

n/a

setEditDeletePoseEnabled(enable=False)

toggle buttons that can or cannot be selected

Parameters:enable (bool, optional) – to disable vs not
setNodeToField(lineEdit, multi=False)

take the currently selected node and set its name to the lineedit provided

Parameters:
  • lineEdit (QLineEdit) – widget to set the name to
  • multi (bool, optional) – should multiple nodes be supported
Returns:

str set to the lineedit

Return type:

str

setSetupDriverControl(lineEditWidget)

should the user wish to set a different driverControl pose setup creation, prompt them prior to proceeding

Parameters:lineEditWidget (QLineEdit) – to query for the name
Returns:nada
Return type:n/a
staticMetaObject = <PySide2.QtCore.QMetaObject object>
syncDriverTableCells(attrEdit, rbfAttrPlug, poseIndex, valueIndex, attributeName, *args)

When you edit the driver table, it will update all the sibling rbf nodes in the setup.

Parameters:
  • attrEdit (QLineEdit) – cell that was edited in the driver table
  • rbfAttrPlug (str) – node.attr the cell represents
  • *args – signal throws additional args
tabConextMenu(qPoint)

create a pop up menu over the tabs when right clicked

Parameters:qPoint (int) – the mouse position when menu requested
Returns:diddly
Return type:n/a
toggleDefaultType(toggleState)

records whether the user wants default poses to be zeroed

Parameters:toggleState (bool) – default True
toggleGetPoseType(toggleState)

records whether the user wants poses recorded in worldSpace or check local space

Parameters:toggleState (bool) – default True
updateAllSetupsInfo(includeEmpty=False)

refresh the instance dictionary of all the setps in the scene.

Parameters:
  • includeEmpty (bool, optional) – there could be rbf nodes with no
  • names. (setup) –
updateAttributeDisplay(attrListWidget, driverNames, highlight=[], attrType='all')

update the provided listwidget with the attrs collected from the list of nodes provided

Parameters:
  • attrListWidget (QListWidget) – widget to update
  • driverNames (list) – of nodes to query for attrs to display
  • highlight (list, optional) – of item entries to highlight
  • keyable (bool, optional) – should the displayed attrs be keyable
Returns:

n/a

Return type:

n/a

class mgear.rigbits.rbf_manager_ui.RBFSetupInput(listValues, setupField=True, parent=None)

Allow the user to select which attrs will drive the rbf nodes in a setup

drivenListWidget

QListWidget – widget to display attrs to drive setup

okButton

QPushButton – BUTTON

result

list – of selected attrs from listWidget

setupField

bool – Should the setup lineEdit widget be displayed

setupLineEdit

QLineEdit – name selected by user

setup the UI widgets

Parameters:
  • listValues (list) – attrs to be displayed on the list
  • setupField (bool, optional) – should the setup line edit be shown
  • parent (QWidget, optional) – widget to parent this to
exec_()

Convenience

Returns:[str, [of selected attrs]]
Return type:list
getValue()

convenience to get result

Returns:Description
Return type:TYPE
onOK()

collect information from the displayed widgets, userinput, return

Returns:of user input provided from user
Return type:list
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class mgear.rigbits.rbf_manager_ui.TabBar

Subclass to get a taller tab widget, for readability

staticMetaObject = <PySide2.QtCore.QMetaObject object>
tabSizeHint(index)
mgear.rigbits.rbf_manager_ui.VLine()

seporator line for widgets

Returns:line for seperating UI elements visually
Return type:Qframe
mgear.rigbits.rbf_manager_ui.genericWarning(parent, warningText)

generic prompt warning with the provided text

Parameters:
  • parent (QWidget) – Qwidget to be parented under
  • warningText (str) – information to display to the user
Returns:

of what the user chose. For warnings

Return type:

QtCore.Response

mgear.rigbits.rbf_manager_ui.getControlAttrWidget(nodeAttr, label='')

get a cmds.attrControlGrp wrapped in a qtWidget, still connected to the specified attr

Parameters:
  • nodeAttr (str) – node.attr, the target for the attrControlGrp
  • label (str, optional) – name for the attr widget
Returns:

qwidget created from attrControlGrp

Return type:

QtWidget

mgear.rigbits.rbf_manager_ui.getEnvironModules()

if there are any environment variables set that load additional modules for the UI, query and return dict

Returns:displayName:funcObject
Return type:dict
mgear.rigbits.rbf_manager_ui.getPlugAttrs(nodes, attrType='all')

Get a list of attributes to display to the user

Parameters:
  • nodes (str) – name of node to attr query
  • keyable (bool, optional) – should the list only be kayable attrs
Returns:

list of attrplugs

Return type:

list

mgear.rigbits.rbf_manager_ui.promptAcceptance(parent, descriptionA, descriptionB)

Warn user, asking for permission

Parameters:
  • parent (QWidget) – to be parented under
  • descriptionA (str) – info
  • descriptionB (str) – further info
Returns:

accept, deline, reject

Return type:

QtCore.Response

mgear.rigbits.rbf_manager_ui.selectNode(name)

Convenience function, to ensure no errors when selecting nodes in UI

Parameters:name (str) – name of node to be selected
mgear.rigbits.rbf_manager_ui.show(dockable=True, newSceneCallBack=True, *args)

To launch the ui and not get the same instance

Returns:instance
Return type:DistributeUI
Parameters:*args – Description
mgear.rigbits.rbf_manager_ui.sortRBF(name, rbfType=None)

Get node wrapped in RBFNode class based on the type of node

Parameters:
  • name (str) – name of the RBFNode in scene
  • rbfType (str, optional) – type of RBF to get instance from
Returns:

instance of RBFNode

Return type:

RBFNode

mgear.rigbits.rbf_manager_ui.testFunctions(*args)

test function for connecting signals during debug

Parameters:*args – Description