-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscene.py
More file actions
65 lines (53 loc) · 1.8 KB
/
scene.py
File metadata and controls
65 lines (53 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import pymel.core as pm
NAMESPACE = 'LOOKDEV'
def create():
'''
Creates three spheres (white, 50% grey and chrome ball) and a colorchecker/Macbeth chart
Args:
name(String): Name of the object
Returns:
colorchecker
'''
white_ball = create_lightchecker(name='white')
grey_ball = create_lightchecker(name='grey')
chrome_ball = create_lightchecker(name='chrome')
colorchecker = create_colorchecker(name='colorchart')
colorcheckers_grp = pm.group(white_ball, grey_ball, chrome_ball, colorchart,
name='%s:colorcheckers_grp' % NAMESPACE)
white_ball.translate.set(0, 20, 0)
grey_ball.translate.set(-7.5, 7, 0)
chrome_ball.translate.set(7.5, 7, 0)
colorchart.translate.set(0, -13.65, 0)
def create_colorchecker(name):
'''
Creates three spheres (white, 50% grey and chrome ball) and a colorchecker/Macbeth chart
Args:
name(String): Name of the object
Returns:
colorchecker
'''
colorchart = pm.polyPlane(name='%s:colorchart_geo' % NAMESPACE,
width=35.83, height=25.25, axis=(0, 0, 1),
constructionHistory=False)[0]
return colorchart
def create_lightchecker(name):
'''
Creates a poly mesh to use as lightchecker.
Args:
name(String): Name of the object
Returns:
lightchecker
'''
lightchecker = pm.polySphere(name='{0}:{1}_geo'.format(NAMESPACE, name), radius=7,
subdivisionsX=60, subdivisionsY=40,
constructionHistory=False)[0]
return lightchecker
def create_shader(name):
'''
Creates a shader to assign to each colorchecker.
Args:
name(String): Name of the shader
Returns:
Shader
'''
pass