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
| class Item(object): | |
| def __init__(self, name): | |
| self.name = name | |
| self.links = [] | |
| def __repr__(self): | |
| return self.name | |
| a, b, c, d, e, f, g, h = (Item(x) for x in 'abcdefgh') |
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 mc | |
| refs = [] | |
| message = 'No corrupted references to delete.' | |
| for ref in mc.ls(references=True): | |
| try: | |
| mc.referenceQuery(ref, filename=True) | |
| except RuntimeError: | |
| mc.lockNode(ref, lock=False) | |
| refs.append(ref) |
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 re | |
| from PySide2.QtCore import * | |
| from PySide2.QtGui import * | |
| from PySide2.QtWidgets import * | |
| from shiboken2 import wrapInstance | |
| import maya.cmds as mc | |
| from maya.OpenMayaUI import MQtUtil |
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
| [VarDef, crlf, [StrMerge, [StrFromAsc, 13], [StrFromAsc, 10]]] | |
| [VarDef, quot, [StrFromAsc, 34]] | |
| [VarDef, temp, [FileNameResolvePath, "_deleteme"]] | |
| [VarDef, bat, [StrMerge, temp, ".bat"]] | |
| [VarDef, txt, [StrMerge, temp, ".txt"]] | |
| [VarSet, offset, 0] | |
| [RoutineDef, write, | |
| [VarAdd, offset, [MemWriteString, externalPlugins, | |
| [StrMerge, text, crlf], offset, 0] |
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
| # Retime a tracked object to better fit a target curve | |
| # Select two Transform nodes: the first with a jerky tracked curve, the | |
| # second with a smooth target curve | |
| # Group effort by Lewis Saunders, Unai Martínez Barredo, Erwan Leroy | |
| # Make a function to calculate the distance between two points | |
| def distance(a, b): | |
| return pow((a[0]-b[0])**2 + (a[1]-b[1])**2, 0.5) | |
| # Find the closest point to p on the line ab |
NewerOlder