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 math | |
import urllib.request | |
class Material(dict): | |
def __init__(self, data): | |
self.update(data) | |
def __getattr__(self, key): |
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 maya import cmds | |
def proximityWrap(driven, drivers, name=''): | |
from maya.internal.nodes.proximitywrap import node_interface | |
kwargs = {'type': 'proximityWrap'} | |
if name: | |
kwargs['name'] = name | |
pw = cmds.deformer(driven, **kwargs) | |
pwni = node_interface.NodeInterface(pw[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
''' | |
I wanted to easily reproduce maya's expression in a node. | |
The value of the argument can be a node attribute name or a number (int, float). | |
All functions return the attribute name that will be the final output of the value. | |
Add(3, 2) | |
>>> plusMinusAverage1.output1D |
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.OpenMayaUI as omui | |
from PySide2 import QtWidgets | |
from shiboken2 import wrapInstance | |
def changeMayaScriptEditorFont(fontFamily='Source Code Pro'): | |
widgetStr = mel.eval('string $tempString = $gCommandLayout') | |
ptr = omui.MQtUtil.findControl(widgetStr) | |
widget = wrapInstance(long(ptr), QtWidgets.QWidget) |