mgear.rigbits.rbf_node

rbf node to normalize the calls across any number of supported rbf node types. First supported “weightDriver”/ingo clemens/Brave Rabit

mgear.rigbits.rbf_node.CTL_SUFFIX

str – name of the control suffixe

mgear.rigbits.rbf_node.DRIVEN_SUFFIX

str – suffix to be applied to driven group

mgear.rigbits.rbf_node.DRIVER_CTL_ATTR_NAME

str – name of the attribute to store driver control

mgear.rigbits.rbf_node.DRIVER_POSEINPUT_ATTR

str – name of attr to store control driver(holder)

mgear.rigbits.rbf_node.DRIVER_POSES_INFO_ATTR

str – name of attr to store control

mgear.rigbits.rbf_node.GENERIC_SUFFIX

str – generic suffix if one not provided by support module

mgear.rigbits.rbf_node.RBF_SCALE_ATTR

str – name of attr applied to driven control

mgear.rigbits.rbf_node.RBF_SETUP_ATTR

str – name of attr to store setup name for group of rbf

mgear.rigbits.rbf_node.ROTATE_ATTRS

list – convenience list of transform attrs

mgear.rigbits.rbf_node.SCALE_ATTRS

list – convenience list of transform attrs

mgear.rigbits.rbf_node.SUPPORTED_RBF_NODES

tuple – currently supported rbf node types

mgear.rigbits.rbf_node.TRANSFORM_SUFFIX

str – suffix of transform nodes for rbf nodes

mgear.rigbits.rbf_node.TRANSLATE_ATTRS

list – convenience list of transform attrs

Notes - refactor as more supported rbf node types are added

__author__ = “Rafael Villar” __email__ = “rav@ravrigs.com

class mgear.rigbits.rbf_node.RBFNode(name)

A class to normalize the function between different types of rbf nodes that essentially perform the same task. Look to weightNode_io for examples of normalized function calls to specific nodeType information with this class.

name

str – name of the node that either exists or to be created

rbfType

str – nodeType to create node of supported type

transformNode

str – name of transform node

__repr__()

overwritten so that the RBFNode instance can be treated as a pymal node. Convenience

Returns:name of rbfNode node correctly formated
Return type:str
__str__()

overwritten so that the RBFNode instance can be treated as a pymal node. Convenience

Returns:name of rbfNode node correctly formated
Return type:str
__unicode__()

overwritten so that the RBFNode instance can be treated as a pymal node. Convenience

Returns:name of rbfNode node correctly formated
Return type:str
addPose(poseInput, poseValue, posesIndex=None)

add pose to the weightDriver node provided. Also used for editing an existing pose, since you can specify the index. If non provided assume new

Parameters:
  • node (str) – weightedDriver
  • poseInput (list) – list of the poseInput values
  • poseValue (list) – of poseValue values
  • posesIndex (int, optional) – at desired index, if none assume
  • latest/new
applyDefaultPose(posesIndex=0)

apply default pose, WARNING. Applying default on more than one index will result in rbf decomp error.

Parameters:posesIndex (int, optional) – index to default values
copyPoses(nodeB, emptyPoseValues=True)

Copy poses from nodeA to nodeB with the option to be blank or node for syncing nodes

Parameters:
  • nodeB (str) – name of weightedNode
  • emptyPoseValues (bool, optional) – should the copy just be the same
  • of poses but blank output value (number) –
Returns:

n/a

Return type:

n/a

create()

create an RBF node of type, defined by the subclassed module

Raises:NotImplementedError – Description
deletePose(indexToPop)

gather information on node, remove desired index and reapply

Parameters:
  • node (str) – weightDriver
  • indexToPop (int) – pose index to remove
deleteRBFToggleAttr()

convenience function to delete the connected “enevelope” from the anim control node

Returns:Description
Return type:TYPE
forceEvaluation()

convenience function to force re evaluation on the rbf nodes most nodes support this

formatName()

standardized the naming of all rbf nodes for consistency

Returns:name of all supported rbf nodes
Return type:str
getConnectedRBFToggleNode()

return the node connected to the RBFNodes toggle attr

Returns:name of node
Return type:str
getDrivenNode()

get driven nodes connected to weightDriver

Returns:of driven nodes
Return type:list
getDrivenNodeAttributes()

get the connected attributes of the provided compound attr in order of index - Sanity check

Returns:of connected attrs in order
Return type:list
getDriverControlAttr()

get the driverControlAttr

Returns:the name of the control set within the attr
Return type:str
getDriverControlPoseAttr()

retrieve poseInfo from the driverControlPoseAttr as a dict

Returns:of pose information
Return type:dict
getDriverNode()

get nodes that are driving weightDriver node

Returns:of driver nodes
Return type:list
getDriverNodeAttributes()

get the connected attributes of the provided compound attr in order of index - Sanity check

Returns:of connected attrs in order
Return type:list
getNodeInfo()

get all the info for for the node in the form of a dict

Raises:
  • NotImplementedError – NotImplementedError: each rbf node is unique,
  • adhere here for rbf manager ui support
getPoseInfo()

get poseInfo dict

Raises:
  • NotImplementedError – each rbf node is unique, adhere here for
  • rbf manager ui support
getPoseValues(resetDriven=True, absoluteWorld=True)

get all pose values from rbf node

Parameters:resetDriven (bool, optional) – reset driven animControl
Returns:of poseValues
Return type:list
getRBFToggleAttr()

get the specific to the type, “envelope” attr for rbf node

getSetupName()

get the name of the setup that the RBFNode belongs to

Returns:skirt_L0, shoulder_R0
Return type:str
getTransformParent()

get a dict of all the information to be serialized to/from json

Returns:information to be recreated on import
Return type:dict
lengthenCompoundAttrs()

convenience function, sanity check for zero’d compound attrs

nodeType_suffix()

optional override with a module/node specific suffix for naming

recallDriverPose(poseIndex)

recall the pose on the controlDriver with information at the specified index

Parameters:poseIndex (int) – desired index, matches pose index on rbfNode
setDrivenNode(drivenNode, drivenAttrs, parent=True)

set the node to be driven by the weightDriver

Parameters:
  • node (str) – weightDriver node
  • drivenNode (str) – name of node to be driven
  • drivenAttrs (list) – of attributes to be driven by weightDriver
setDriverControlAttr(controlName)

create and set attr with the driver animControl string

Parameters:controlName (str) – name of animControl(usually)
setDriverControlPoseAttr(poseInfo)

set the poseInfo as a string to the DriverControlPoseAttr

Parameters:poseInfo (dict) – of pose information to set, as a str
setDriverNode(driverNode, driverAttrs)

set the node that will be driving the evaluation on our poses

Parameters:
  • node (str) – name of weightDriver node
  • driverNode (str) – name of driver node
  • driverAttrs (list) – of attributes used to perform evaluations
setSetupName(setupName)

set the name of the setup for the RBFNode

Parameters:setupName (str) – desired name
setToggleRBFAttr(value)

Toggle rbfattr on or off (any value provided)

Parameters:value (TYPE) – Description
syncPoseIndices(srcNode)
updateDriverControlPoseAttr(posesIndex)

update the driverControlPoseAttr at the specified index

Parameters:posesIndex (int) – update the pose information at the index
mgear.rigbits.rbf_node.addDrivenGroup(node)

add driven group, pad, above the provided node for direct connection

Parameters:node (str) – name of node to add group above
Returns:of node created
Return type:str
mgear.rigbits.rbf_node.connectRBFToggleAttr(node, rbfNode, rbfEnableAttr)

connect the “envelope” attr with its corresponding rbfNode

Parameters:
  • node (str) – node with attr
  • rbfNode (str) – rbf node with receiving attr
  • rbfEnableAttr (str) – targeted rbf node for disabling node
mgear.rigbits.rbf_node.copyInverseMirrorAttrs(srcNode, dstNode)

within mGear the concept of inverseAttrs, so that transforms can be accurately mirrored, exists and this copys the relavent attrs from src to dest

Parameters:
  • srcNode (str, pynode) – source node
  • dstNode (str, pynode) – destination to copy attrs to
mgear.rigbits.rbf_node.createDriverControlAttr(node)

create the string attr where information will be stored for query associated driver anim control

Parameters:node (str) – rbf node to tag with information
mgear.rigbits.rbf_node.createDriverControlPoseAttr(node)

ensure the driverControlPoseAttr exists on the (RBF)node provided

Parameters:node (str) – name of the supported RBFNode
mgear.rigbits.rbf_node.createRBFToggleAttr(node)

creates a node to toggle the rbf pose that drives the node

Parameters:node (str) – desired node to be tagged with attr
mgear.rigbits.rbf_node.decompMatrix(node, matrix)

Decomposes a MMatrix in new api. Returns an list of translation,rotation,scale in world space.

Parameters:
  • node (str) – name of node to query rotate order
  • matrix (MMatrix) – mmatrix to decompos
Returns:

Description

Return type:

TYPE

mgear.rigbits.rbf_node.deleteRBFToggleAttr(node)

remove the toggle attribute from the node

Parameters:node (str) – node to remove toggle attr from
mgear.rigbits.rbf_node.getConnectedRBFToggleNode(node, toggleAttr)

get the node connected to the rbf(node)

Parameters:
  • node (str) – rbf node
  • toggleAttr (str) – envelope attr to check
Returns:

connected node

Return type:

str

mgear.rigbits.rbf_node.getDrivenMatrix(node, absoluteWorld=True)

check if there is a control node for the provided node(driven) if so, collect the matrix information for both

Parameters:
  • node (pynode) – driven group/driven node
  • absoluteWorld (bool, optional) – get the world matrix or defaulted mat
  • the control is zeroed out. (if) –
Returns:

of total position including the control

Return type:

MMatrix

mgear.rigbits.rbf_node.getDriverControlAttr(node)

get the stored information from control attr

Parameters:node (str) – name of rbfNode
Returns:contents of attr, animControl
Return type:str
mgear.rigbits.rbf_node.getDriverControlPoseAttr(node)

record the dict, stored as a str, holding driver control pose information.

Parameters:node (str) – name of the RBFNode supported node to query
Returns:of attr:[value at index]
Return type:dict
mgear.rigbits.rbf_node.getMultipleAttrs(node, attributes)

get multiple attrs and their values in a list, in order

Parameters:
  • node (str) – name of node
  • attributes (list) – of attrs to query
Returns:

of values

Return type:

list

mgear.rigbits.rbf_node.getRbfSceneSetupsInfo(includeEmpty=True)

gather scene rbf nodes with setups in dict

Parameters:
  • includeEmpty (bool, optional) – should rbf nodes with empty setup names
  • included (be) –
Returns:

setupName(str):list associated rbf nodes

Return type:

dict

mgear.rigbits.rbf_node.getSceneRBFNodes()

get all rbf nodes in the scene of supported type

Returns:of rbf nodes, see supported types
Return type:list
mgear.rigbits.rbf_node.getSceneSetupNodes()

get rbf nodes with setups attributes

Returns:of rbf nodes with setup information
Return type:list
mgear.rigbits.rbf_node.getSetupName(node)

get setup name from specified rbf node

Parameters:node (str) – name of rbf node
Returns:name of setup associated with node
Return type:str
mgear.rigbits.rbf_node.recallDriverControlPose(driverControl, poseInfo, index)

set the driverControl to the index requested. Set as many attrs as is provided in the poseInfo

Parameters:
  • driverControl (str) – control to set poseAttr infomation on
  • poseInfo (dict) – of poses
  • index (int) – poseInfo[attrName]:[index]
mgear.rigbits.rbf_node.removeDrivenGroup(node)

remove driven group above desired node

Parameters:node (str) – name of node to check
mgear.rigbits.rbf_node.resetDrivenNodes(node)

use mgear convenience function to reset all available transform nodes

Parameters:node (str) – node to reset
mgear.rigbits.rbf_node.setDriverControlAttr(node, controlName)

create and set attr with the driver animControl string

Parameters:
  • node (str) – name of rbfnode
  • controlName (str) – name of animControl(usually)
mgear.rigbits.rbf_node.setDriverControlPoseAttr(node, poseInfo)

set the driverControlPoseAttr with the poseInfo provided, as string

Parameters:
  • node (str) – name of rbf node to set it on
  • poseInfo (dict) – of pose information
mgear.rigbits.rbf_node.setSetupName(node, setupName)

set setup name on the specified node

Parameters:
  • node (str) – name of rbf node to set
  • setupName (str) – name of setup
mgear.rigbits.rbf_node.setToggleRBFAttr(node, value, toggleAttr)

Toggle rbfattr on or off (any value provided)

Parameters:
  • node (str) – name of node with the attr to toggle rbf on/off
  • value (int, bool) – on/off
  • toggleAttr (str) – name of the attr to set
mgear.rigbits.rbf_node.updateDriverControlPoseAttr(node, driverControl, poseIndex)

get the ControlPoseDict add any additionally recorded values to and set

Parameters:
  • node (str) – name of the RBFNode supported node
  • driverControl (str) – name of the control to queary attr info from
  • poseIndex (int) – to add the collected pose information to