This file contains hidden or 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
| # Credit to Ryan Porter (yantor3d) | |
| from maya import cmds | |
| for jnt in cmds.ls(sl=True, type="joint"): | |
| matrixPlugs = cmds.listConnections(jnt + ".worldMatrix", type="skinCluster", p=True) or [] | |
| for mp in matrixPlugs: | |
| bindPreMatrixPlug = mp.replace('matrix', 'bindPreMatrix') | |
| if cmds.listConnections(bindPreMatrixPlug, s=True, d=False): |
This file contains hidden or 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 decimal import Decimal, ROUND_DOWN | |
| import json | |
| # Base code from | |
| # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back | |
| # Code by martineau | |
| _NUMERALS = '0123456789abcdefABCDEF' | |
| _HEXDEC = {v: int(v, 16) for v in (x+y for x in _NUMERALS for y in _NUMERALS)} | |
| LOWERCASE, UPPERCASE = 'x', 'X' |
This file contains hidden or 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 rename(cmpNameField, cmpLocationField, nameField, typeField): | |
| sel = pm.ls(selection=True) | |
| # Get Values of Fields | |
| cmpName = pm.textField(cmpNameField, query=True, text=True) | |
| cmpLocation = pm.optionMenu(cmpLocationField, query=True, value=True) | |
| objName = pm.textField(nameField, query=True, text=True) | |
| objType = pm.optionMenu(typeField, query=True, value=True) |
This file contains hidden or 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 pymel.core as pm | |
| def matchXfos(): | |
| # get selection | |
| sel = pm.ls(selection=True) | |
| if len(sel) < 2: |
This file contains hidden or 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 pymel.core as pm | |
| def matchRotations(): | |
| # get selection | |
| sel = pm.ls(selection=True) | |
| if len(sel) < 2: |
This file contains hidden or 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 pymel.core as pm | |
| def matchTranslation(): | |
| # get selection | |
| sel = pm.ls(selection=True) | |
| if len(sel) < 2: |
This file contains hidden or 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 pymel.core as pm | |
| def matchScale(): | |
| # get selection | |
| sel = pm.ls(selection=True) | |
| if len(sel) < 2: |
This file contains hidden or 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 json | |
| import FabricEngine.Core as fabric | |
| import maya.cmds as cmds | |
| # Get Client | |
| contextID = cmds.fabricSplice('getClientContextID') | |
| if contextID == '': | |
| cmds.fabricSplice('constructClient') | |
| contextID = cmds.fabricSplice('getClientContextID') |
This file contains hidden or 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 MaxPlus | |
| import pymxs | |
| import random | |
| rt = pymxs.runtime | |
| bone = pymxs.runtime.boneSys.createBone(rt.Point3(0, 0, 0), rt.Point3(8, 0, 0), rt.Point3(0,0,1)) | |
| hash = random.getrandbits(128) | |
| bone.Name = str(hash) |
This file contains hidden or 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 MaxPlus | |
| p1 = MaxPlus.Point3(0, 0, 0) | |
| p2 = MaxPlus.Point3(0, 30, 0) | |
| p3 = MaxPlus.Point3(10, 30, 0) | |
| p4 = MaxPlus.Point3(10, -20, 0) | |
| obj = MaxPlus.Factory.CreateShapeObject(MaxPlus.ClassIds.SplineShape) | |
| shape = MaxPlus.SplineShape__CastFrom(obj) |