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
{ | |
"path" : "C:\\downloaded\\ptvsd-4.2.9\\src", | |
"attach" : true, | |
"host" : "localhost", | |
"port" : 5678, | |
"wait" : 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 pymel.core as pm | |
def GetDistanceBetweenVectors (objA, objB): | |
''' | |
returns a float. | |
Expects the name of two objects. | |
Uses Pymel to get translation - probably a better way to do this. | |
''' | |
Ax, Ay, Az = pm.PyNode(objA).getTranslation(space="world") | |
Bx, By, Bz = pm.PyNode(objB).getTranslation(space="world") |
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 pyfmodex | |
system = pyfmodex.System() | |
system.init() | |
sound = system.create_sound('audio.wav') | |
channel = sound.play(paused=True) | |
channel.frequency=9000 | |
channel.paused=False | |
channel.frequency=4000 |
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 finder | |
objects = ( | |
'door', | |
'mirror', | |
'bonnet', | |
'lense', | |
'focallength', | |
'lenscap', | |
'milkcrate', |
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
def findSkinClusters (): | |
skins = [] | |
shapes = pm.listRelatives(shapes=True, noIntermediate=True) | |
for shape in shapes: | |
skinClusters = pm.ls(type=pm.nodetypes.SkinCluster) | |
for skin in skinClusters: | |
mesh = pm.skinCluster(skin, q=True, g=True) | |
if mesh[0] == shape: | |
relatedSkinCluster = sc | |
skins.append(skin) |
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 | |
skin = pm.ls(type=pm.nodetypes.SkinCluster)[0] | |
# assign all weight to first influence | |
pm.skinPercent(skin, transformValue = (skin.getInfluence()[0].name(),1)) | |
# clear skin | |
pm.skinPercent(skin, normalize=False, zeroRemainingInfluences=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 pymel.core as pm | |
import maya.mel as mel | |
topLevelShelf = mel.eval('string $m = $gShelfTopLevel') | |
shelves = pm.shelfTabLayout(topLevelShelf, query=True, tabLabelIndex=True) | |
for index, shelf in enumerate(shelves): | |
pm.optionVar(stringValue=('shelfName%d' % (index+1), str(shelf))) | |
# print shelf |
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 os | |
import pymel.core as pm | |
cameras = pm.ls(type=pm.nodetypes.Camera) | |
for each in cameras: | |
val = True if 'preview' in each.name() else False | |
if val: playblasting = True | |
pm.setAttr(each.renderable,val) | |
each.setFilmFit('verticalFilmFit') |
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 | |
import re | |
from pprint import pprint | |
class NodeGetter: | |
def __init__(self,args): | |
''' | |
Unpacks args to: nodename, searchmethod. | |
''' | |
( |
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 quickSelect(search): | |
nodes = pm.ls(type=pm.nodetypes.Transform) | |
pm.select(clear=True) | |
for each in nodes: | |
for subeach in search: | |
if subeach == each.name().replace(':','|').split('|')[-1]: | |
pm.select(each,add=True) | |
quickSelect(['somename']) |
NewerOlder