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 ctr_dist(objA, objB): | |
Ax, Ay, Az = objA.getRotatePivot(space="world") | |
Bx, By, Bz = objB.getRotatePivot(space="world") | |
return ((Ax-Bx)**2 + (Ay-By)**2 + (Az-Bz)**2 )**0.5 | |
def get_closest_node(src, nodes): | |
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
Input this expression into the window scale u and v: | |
(root.format.w/root.format.h)/(haperture/vaperture) | |
Example: | |
set cut_paste_input [stack 0] | |
version 9.0 v7 | |
push $cut_paste_input | |
Camera2 { |
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 | |
for node in pymel.core.ls(selection=True): | |
grp1 = pymel.core.group(empty=True) | |
grp2 = pymel.core.group(empty=True) | |
pymel.core.delete(pymel.core.parentConstraint(node, grp1)) | |
pymel.core.delete(pymel.core.parentConstraint(node, grp2)) | |
pymel.core.parent(node, grp1) |
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 os | |
import pymel.core | |
def replaceReference(): | |
basicFilter = "*.mb" | |
f = pymel.core.fileDialog2(fileFilter=basicFilter, dialogStyle=1, fileMode=1) | |
if not f: |
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 traceback | |
import pymel.core | |
import maya.mel | |
def importAnim(): | |
sel = pymel.core.ls(selection=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
""" | |
Select the geometry to make the renderlayers from. | |
Will find all the materials (lambert), make a renderlayer per material only showing that material. | |
""" | |
import traceback | |
import pymel.core | |
selection = pymel.core.ls(selection=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 os | |
import difflib | |
import nuke | |
import nukescripts | |
class KnobsPanel(nukescripts.PythonPanel): | |
def __init__(self, knobs): | |
nukescripts.PythonPanel.__init__(self, 'KnobsPanel') |
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 nuke | |
items = ['polySurfaceShape15'] | |
node = nuke.selectedNode() | |
scene_view = node['scene_view'] | |
scene_view.setSelectedItems([]) | |
selection = [] | |
for item in scene_view.getAllItems(): | |
for split in item.split('/'): |
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 | |
import traceback | |
def place_highlight(cam, obj): | |
""" Creates a highlight rig for placing highlights on an object | |
""" | |
parent_loc = pymel.core.spaceLocator() | |
up_vector = pymel.core.spaceLocator() | |
aim_loc = pymel.core.spaceLocator() |
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 sys | |
import maya.cmds as cmds | |
import pymel | |
import pymel.core | |
from PySide import QtGui | |
class Example(QtGui.QWidget): | |