Look Dev Spheres Script
#look_dev_spheres.py
import maya.cmds as cmds
import maya.mel as mel
import os
import math
class lookDevSpheres(object):
def __init__(self):
pass
#---------------------------------------------------------------------------------
def WhitePlastic (self):
cmds.polySphere ()
cmds.select("pSphere1")
newName=cmds.rename("pSphere1", 'white_plastic')
cmds.move(-4.231,8.500,5.932)
cmds.setAttr(newName + "Shape.castsShadows", 0)
cmds.shadingNode('aiStandardSurface', asShader=True, n='white_plastic_mat')
cmds.select( 'white_plastic' )
cmds.hyperShade( assign='white_plastic_mat' )
cmds.setAttr("white_plastic_mat.baseColor", 1,1,1)
cmds.setAttr("white_plastic_mat.specularRoughness", 0.325)
cmds.setAttr("white_plastic_mat.specularIOR", 1.52)
cmds.setAttr("white_plastic_mat.subsurface", 0.2)
cmds.setAttr("white_plastic_mat.subsurfaceColor", 1,1,1)
cmds.setAttr("white_plastic_mat.subsurfaceScale", 1)
return newName
#---------------------------------------------------------------------------------
def BlackPlastic (self):
cmds.polySphere ()
cmds.select("pSphere1")
newName=cmds.rename("pSphere1", 'black_plastic')
cmds.move(-4.231,8.500,5.932)
cmds.setAttr(newName + "Shape.castsShadows", 0)
cmds.shadingNode('aiStandardSurface', asShader=True, n='black_plastic_mat')
cmds.select( 'black_plastic' )
cmds.hyperShade( assign='black_plastic_mat' )
cmds.setAttr("black_plastic_mat.baseColor", 0,0,0)
cmds.setAttr("black_plastic_mat.specularRoughness", 0.325)
cmds.setAttr("black_plastic_mat.specularIOR", 1.52)
cmds.setAttr("black_plastic_mat.subsurface", 0.2)
cmds.setAttr("black_plastic_mat.subsurfaceColor", 0,0,0)
cmds.setAttr("black_plastic_mat.subsurfaceScale", 1)
return newName
#---------------------------------------------------------------------------------
def GreyClay (self):
cmds.polySphere ()
cmds.select("pSphere1")
newName=cmds.rename("pSphere1", 'grey_clay')
cmds.move(-4.231,8.500,5.932)
cmds.setAttr(newName + "Shape.castsShadows", 0)
cmds.shadingNode('aiStandardSurface', asShader=True, n='grey_clay_mat')
cmds.select( 'grey_clay' )
cmds.hyperShade( assign='grey_clay_mat' )
cmds.setAttr("grey_clay_mat.baseColor", 0.5,0.5,0.5)
cmds.setAttr("grey_clay_mat.diffuseRoughness", 0.5)
cmds.setAttr("grey_clay_mat.specularRoughness", 0.4)
cmds.setAttr("grey_clay_mat.specularIOR", 1.52)
cmds.setAttr("grey_clay_mat.specularAnisotropy", 0.5)
cmds.setAttr("grey_clay_mat.subsurface", 0.300)
cmds.setAttr("grey_clay_mat.subsurfaceColor", 0.5,0.5,0.5)
cmds.setAttr("grey_clay_mat.subsurfaceRadius", 0.162,0.162,0.162)
cmds.setAttr("grey_clay_mat.subsurfaceScale", 1)
return newName
#---------------------------------------------------------------------------------
def Chrome (self):
cmds.polySphere ()
cmds.select("pSphere1")
newName=cmds.rename("pSphere1", 'chrome')
cmds.move(-4.231,8.500,5.932)
cmds.setAttr(newName + "Shape.castsShadows", 0)
cmds.shadingNode('aiStandardSurface', asShader=True, n='chrome_mat')
cmds.select( 'chrome' )
cmds.hyperShade( assign='chrome_mat' )
cmds.setAttr("chrome_mat.baseColor", 1,1,1)
cmds.setAttr("chrome_mat.metalness", 1)
cmds.setAttr("chrome_mat.specular", 0)
cmds.setAttr("chrome_mat.specularAnisotropy", 0.5)
return newName
#---------------------------------------------------------------------------------
def groupSpheres(self):
groupName = cmds.group('white_plastic', 'black_plastic', 'grey_clay', 'chrome', n='Look_Dev_Spheres')
return groupName