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 | |
def _centre_objects(*args): | |
'''Centres a selection of object's to the first selected objects | |
rotate pivot. | |
args : This is a list of objects that can also be used by | |
the user. If this is blank, then a selection is used instead. | |
On Exit : Moves all of the objects apart from the first to the |
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
Here is just a selection of GUI gists I've written which I have found useful when creating my own GUI's. | |
Hope you find them useful! |
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 | |
def fit_to_group_bbox(obj, group): | |
'''Used to scale and translate a 3d projection node used for planar | |
mapping onto the size of a group or object. I haven't found any | |
other use for it as of yet, but I have kept the variables open | |
in-case someone does. | |
obj : is the name of the object or projection you want to | |
resize |
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
#Creats a list of all selected objects name of shape/mesh node | |
import maya.cmds as cmds | |
cmds.listRelatives(cmds.ls(selection=True), type='mesh') |
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
'''Allows a simple offset of all keyframes from a list of selected objects. | |
selection => all of the currently selected objects in the seen. This will be the translate nodes for each object. | |
time=(0,100) => set this to the time range of the animation | |
''' | |
selection = cmds.ls(selection=True) | |
for s in selection: | |
cmds.keyframe('%s.rotateX' % s, edit=True, time=(0,100) ,valueChange=90, relative=True) |
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 | |
for win in cmds.lsUI(windows=True): | |
cmds.window(win, e=True, tlc=[0,0]) |
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 | |
def getInheritedRotation(obj): | |
rotation = [0,0,0] | |
p = cmds.listRelatives(obj, allParents=True) | |
while p != None: | |
if cmds.nodeType(p) != "joint": |
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 | |
from collections import namedtuple | |
PivotCtrl = namedtuple("PivotCtrl", "jnt ctrl sdk offset") | |
def getInheritedRotation(obj): | |
rotation = [0,0,0] | |
p = cmds.listRelatives(obj, allParents=True) |
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 | |
from collections import namedtuple | |
PivotCtrl = namedtuple("PivotCtrl", "jnt ctrl sdk offset") | |
def getInheritedRotation(obj): | |
rotation = [0,0,0] | |
p = cmds.listRelatives(obj, allParents=True) |
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
var hashParams = window.location.hash.substr(1).split('&'); // substr(1) to remove the `#` | |
if (hashParams[0] != ""){ | |
for(var i = 0; i < hashParams.length; i++){ | |
var p = hashParams[i].split('='); | |
document.getElementById(p[0]).value = decodeURIComponent(p[1]); | |
} | |
} |
OlderNewer