mgear.rigbits.sdk_manager.core module

mgear.rigbits.sdk_manager.core.ctl_from_list(in_list, SDK=False, animTweak=False)

Returns either the SDK’s or animTweaks from the in_list. If given a SDK, it will find the animTweak pair and vise versa. To qualify as SDK ctl must have “is_SDK” attr, or “is_tweak” attr for animTweak

Parameters:
  • in_list (list[PyNode]) – List of PyNodes to sort through

  • SDK (bool) – If you want SDK ctls

  • animTweak (bool) – If you want animTweak ctls

Returns:

list [List of either SDK ctls or animTweaks]

mgear.rigbits.sdk_manager.core.delete_current_value_keys(current_driver_val, node, sourceDriverFilter)
Parameters:
  • () (sourceDriverFilter) –

  • ()

Returns:

n/a

mgear.rigbits.sdk_manager.core.driver_ctl_from_joint(joint)

Will try find the Driver control given the joint by searching through the mGear nodes.

Parameters:

joint (PyNode) – joint to search connections on

Returns:

Control

Return type:

PyNode

mgear.rigbits.sdk_manager.core.get_current_SDKs()

If SDK ctls are selected, will return only the SDK nodes Attatched to those in the selection. If nothing is selected, will get all the SDK nodes in the scene and return them.

Returns:

SDKs_to_set (list) - list of SDKs as Pynodes

mgear.rigbits.sdk_manager.core.get_driven_from_attr(driverAttr, is_SDK=False)

Returns a list of driven controls given the driver attr

Parameters:
  • driverAttr (PyNode) – the driver attr to search

  • is_SDK (bool) – if True, will check if the is_SDK attr is present before

  • list. (adding to driven_ctls) –

Returns:

list [List of unicode names]

mgear.rigbits.sdk_manager.core.get_driver_from_driven(drivenCtl)

Finds the Driver controls for a given driven ctl

Parameters:

drivenCtl (PyNode) – A Driven Node to query.

Returns:

list [All found Driver Nodes]

mgear.rigbits.sdk_manager.core.get_driver_keys(driverAttr, firstKey=None, prevKey=None, nextKey=None, lastKey=None)

Returns a list of Driver key values for the given driverAttr.

If all optional arguments are None, will return list of all values

Parameters:
  • driverAttr (PyNode.Attribute) – Driver Ctl.attr

  • firstKey (bool) –

  • prevKey (bool) –

  • nextKey (bool) –

  • lastKey (bool) –

Returns:

List (If all optional None) - List of driver key values float (If one specified) - The float value for the driver on that key.

mgear.rigbits.sdk_manager.core.get_info(node)

Given either the SDK box, or Anim ctl, will find other and return it

Parameters:

node (PyNode) – either the SDK box or Anim ctl

Returns:

list [PyNode(SDK box), PyNode(anim ctl)]

mgear.rigbits.sdk_manager.core.joint_from_driver_ctl(node)

Will try find the joint given the Driver control by searching through the mGear nodes.

TO DO:

Expand this to be more robust. Check all channels / not rely on translate connections only.

Parameters:

node (PyNode) – node to search connections on

Returns:

joint

Return type:

PyNode

mgear.rigbits.sdk_manager.core.key_at_current_values(drivenCtls, keyChannels, driver, driverAtt, inTanType='linear', outTanType='linear', zeroKey=False)

Helper function to set SDK’s at Driven nodes current values :param drivenCtls: List of String names of the Driven Ctls. :type drivenCtls: list :param keyChannels: List of Channels to Key :type keyChannels: list :param driver: Driver Node :type driver: PyNode :param driverAtt: Driver Attr given as a string :type driverAtt: str :param inTanType: Tangent type, by default is linear. :type inTanType: str / optional :param outTanType: Tangent type, by default is linear. :type outTanType: str / optional :param zeroKey: if True, will set a zero key before

setting the key at current value.

Returns:

n/a

mgear.rigbits.sdk_manager.core.mirror_SDK(driverCtl)

Takes in a driver control and extrapolates out all the other information needed to mirror it’s connected SDK’s.

Parameters:

driverCtl (PyNode) –

Returns:

None

mgear.rigbits.sdk_manager.core.next_biggest(target, in_list)

Returns the next highest number in the in_list. If target is greater the the last number in in_list, will return the last item in the list.

mgear.rigbits.sdk_manager.core.next_smallest(target, in_list)

Returns the next Lowest number in the in_list. If target is smaller the the last number in in_list, will return the first item in the list.

mgear.rigbits.sdk_manager.core.prune_DK_nodes(white_list=[])

Finds all the driven key nodes that have no input or output connected and removes them. Nodes with the word profile in are excluded so that no guide components are broken.

Parameters:

white_list (list / optional) – List of nodes to ignore

Returns:

list (All the names of the deleted nodes)

mgear.rigbits.sdk_manager.core.reset_to_default(mode, clear_sel=False)

Reset All the Rig Driver Ctls or Anim Ctls to Default

Parameters:

mode (str) – All Ctl Curves - drv : Driver Ctls - anim : Anim Ctls

Returns:

None

mgear.rigbits.sdk_manager.core.select_all(mode)

Select all the Driver Ctls, Anim Ctls Joints or SDK Nodes in the scene.

Parameters:

mode (str) – Driver Ctls - anim : Anim Ctls - jnts : Joints - nodes : SDK Nodes

Returns:

None

mgear.rigbits.sdk_manager.core.set_driven_key(driverAttr, drivenAttr, driverVal, drivenVal, preInfinity=0, postInfinity=0, inTanType='linear', outTanType='linear')

Convinience function to aid in setting driven keys.

Parameters:
  • driverAttr (PyNode.attribute) – Driver.attr to drive the SDK

  • drivenAttr (PyNode.attribute) – Driven.attr to be driven by the SDK

  • driverVal (float) – Value to use for driver

  • drivenVal (float) – Value to use for driven

  • preInfinity (int) – IndexKey - constant[0], linear[1], cycle[2], cycleOffset[3], Oscillate[4]

  • postInfinity (int) – IndexKey - constant[0], linear[1], cycle[2], cycleOffset[3], Oscillate[4]

  • inTanType (str) – spline, linear, fast, slow, flat, stepped, step next, fixed, clampedand plateau

  • outTanType (str) – spline, linear, fast, slow, flat, stepped, step next, fixed, clampedand plateau

Returns:

new Anim UU node or the Edited one.

TO DO:

fix the return.

mgear.rigbits.sdk_manager.core.set_limits_from_current(axis, controls=None, upperLimit=False, lowwerLimit=False)

Sets either the upper or lowwer limits on the provided control and axis

> get current limits > update either the lower or the upper > set limits to Enabled.

There is a lot of duplicate code but its a bit unavoidable with how transformLimits flags are set up.

Aruments:

axis (str): x,y,z axis to use. controls (list): List of PyNodes to iterate over upperLimit (bool): If True will set the upper Limit lowwerLimit (bool): If True will set the lowwer Limit

mgear.rigbits.sdk_manager.core.set_zero_key(drivenCtls, keyChannels, driver, driverAtt, inTanType='linear', outTanType='linear')

Takes a Current “state”, Sets a ZERO SDK then resets to the “state”.

Parameters:
  • drivenCtls (list) – List of String names of the Driven Ctls.

  • keyChannels (list) – List of Channels to Key

  • driver (PyNode) – Driver Node

  • driverAtt (str) – Driver Attr given as a string

  • inTanType (str / optional) – Tangent type, by default is linear.

  • outTanType (str / optional) – Tangent type, by default is linear.

Returns:

n/a

mgear.rigbits.sdk_manager.core.toggle_limits(axis, controls=None)

Toggles the controller translate Limits On or Off from their current values, both upper and lower.

Aruments:

axis (str): x,y,z axis to use. controls (list / optional): List of PyNodes to iterate over

If None, use Selection