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
from PySide import QtCore, QtGui | |
from shiboken import wrapInstance | |
import maya.OpenMayaUI as omui | |
from functools import partial | |
import pymel.core as pm | |
def maya_main_window(): | |
main_window_ptr = omui.MQtUtil.mainWindow() | |
return wrapInstance(long(main_window_ptr), QtGui.QWidget) |
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
from PySide import QtCore, QtGui | |
from shiboken import wrapInstance | |
import maya.OpenMayaUI as apiUI | |
import sys | |
def getMayaWindow(): | |
""" | |
Get the main Maya window as a QtGui.QMainWindow instance | |
@return: QtGui.QMainWindow instance of the top level Maya windows | |
""" |
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.api.OpenMaya as om | |
import pymel.core as pm | |
rot_order = 5 | |
kRotateOrders = [om.MEulerRotation.kXYZ, | |
om.MEulerRotation.kYZX, | |
om.MEulerRotation.kZXY, | |
om.MEulerRotation.kXZY, | |
om.MEulerRotation.kYXZ, |
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 nuke | |
import os.path | |
sel_nodes = nuke.selectedNodes() | |
frame = nuke.frame() | |
node = sel_nodes[0] | |
file_path = nukescripts.replaceHashes( node['file'].value() ) % frame |
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
from maya.app import renderSetup | |
import pprint | |
import maya.cmds as cmds | |
rs = renderSetup.model.renderSetup.instance() | |
ov = renderSetup.model.override | |
def addOverride(override_name, shader_name, node_names): | |
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.api.OpenMaya as om | |
import pymel.core as pm | |
def intersect_mesh(pos, vec, mesh_name): | |
selectionList = om.MSelectionList() | |
selectionList.add(mesh_name) | |
dagPath = selectionList.getDagPath(0) | |
fnMesh = om.MFnMesh(dagPath) |
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
try: | |
# Python2 | |
from Tkinter import Tk | |
except ImportError: | |
# Python3 | |
from tkinter import Tk | |
def setClipboard(text): |
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
using UnityEngine; | |
using System.Collections; | |
public class RotateCar : MonoBehaviour { | |
public GameObject car; | |
public GameObject doorLeft; | |
public GameObject doorRight; | |
private float rotateInc = 45.0f; |
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
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication, QMainWindow, QFrame, QTableView, QVBoxLayout, QAbstractItemView | |
from PyQt5 import QtGui, QtCore | |
class MyTableView(QTableView): | |
# Model with activated DragDrop functionality |
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
L = thisComp.layer("Camera 1"); | |
u = fromWorldVec(L.toWorldVec([1,0,0])); | |
v = fromWorldVec(L.toWorldVec([0,1,0])); | |
w = normalize(fromWorldVec(L.toWorldVec([0,0,1]))); | |
sinb = clamp(w[0],-1,1); | |
b = Math.asin(sinb); | |
cosb = Math.cos(b); | |
if (Math.abs(cosb) > .0005){ | |
c = -Math.atan2(v[0],u[0]); |
NewerOlder