This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import pymel.core as pm | |
left_name = 'Left ' | |
left_suffix = '_l' | |
left_tag = '_l_' | |
right_name = 'Right ' | |
right_suffix = '_r' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def selectVertsBelowThreshold(joints=None, threshold=1.0): | |
""" | |
Selects all the vertices of the given or selected joints that have a weight below the given threshold. | |
Args: | |
joints (list): Joints to get influencing vertices from. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from piper.mayapy.rig import Rig | |
with Rig() as rig: | |
root_ctrl = rig.root()[1][0] | |
pelvis_ctrl = rig.FK('pelvis', name='Pelvis', parent=root_ctrl)[1][0] | |
butt_ctrl = rig.extra('pelvis', 'butt', scale=1.05, spaces=[pelvis_ctrl]) | |
_, mouth_ctrls, _ = rig.FK('mouth', 'lips', parent=pelvis_ctrl, name='Mouth') | |
[rig.FK(joint, parent=pelvis_ctrl, axis='y', name='Hair') for joint in ['hair_back', 'hair_mid', 'hair_front']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
import maya.internal.nodes.proximitywrap.node_interface as node_interface | |
def createProximityWrap(source, target): | |
""" | |
Creates a proximity with the given source and target transforms. | |
Args: | |
source (pm.nodetypes.Transform): Transform with skinned mesh that will drive given target. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def orientToVertex(transform, vertex): | |
""" | |
Orients the given transform to the given vertex's normal. Up/Side orientation is likely to be random. | |
Args: | |
transform (pm.nodetypes.Transform): Node to orient to given vertex. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def registerRepeatLast(function): | |
""" | |
Registers the given function to the repeat last command. | |
Args: | |
function (function): Function/method to register to repeat last. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.OpenMaya as om | |
import pymel.core as pm | |
def originCrossSection(meshes=None, side='', name=None, tolerance=128.0, clean_up=True): | |
""" | |
Creates a curve at the origin that is a cross section of the given mesh(es). | |
Args: | |
meshes (list): pm.nodetypes.Transform with mesh shapes as children to create curves from. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PySide2 import QtWidgets | |
from shiboken2 import wrapInstance | |
import maya.OpenMayaUI as omui | |
if sys.version_info > (3,): | |
long = int | |
# QObjects fall out of scope, so making them global here to keep them in scope |