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]); |
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 import cmds | |
from maya import OpenMayaUI | |
from PySide import QtCore | |
from PySide import QtGui | |
from shiboken import wrapInstance | |
import os | |
# testing to load a transparent 24 png from the script dir | |
usrScriptDir = cmds.internalVar(userScriptDir=True) | |
img_path = os.path.join(usrScriptDir, "lighthouse_24_alpha.png") |
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 import cmds | |
from maya import OpenMayaUI | |
from PySide import QtCore | |
from PySide import QtGui | |
from shiboken import wrapInstance | |
import os | |
# testing to load a transparent 24 png from the script dir | |
usrScriptDir = cmds.internalVar(userScriptDir=True) | |
img_path = os.path.join(usrScriptDir, "lighthouse_24_alpha.png") |
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 pymel.core as pm | |
import pymel.core.general | |
# select materials | |
allMat = pm.ls(materials=True) | |
vrayID = {} | |
selectMaterial = True | |
for mat in allMat: |
NewerOlder