-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmotion_render_data.py
82 lines (78 loc) · 3.07 KB
/
motion_render_data.py
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from skeleton import NodeType as NT
import glm
import collections
import functools
PartRenderData = collections.namedtuple("PartRenderData",
"scale_func enabled color")
def get_squared_character_render_data():
def non_uniform_scale_func(sx, sy, sz, length):
return glm.vec3(length * sx,
length * sy,
length * sz)
default_scale = 0.8
def y_axis_scale_func(fixed_scale, length):
return glm.vec3(fixed_scale,
max(fixed_scale, length),
fixed_scale)
RENDER_DATA = {}
RENDER_DATA[NT.HEAD] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(213/255, 0.0, 249.0/255, 1.0)
)
RENDER_DATA[NT.EYE] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = False,
color = glm.vec4(1.0, 1.0, 1.0, 1.0)
)
RENDER_DATA[NT.NECK] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(213/255, 0.0, 249.0/255, 1.0)
)
RENDER_DATA[NT.SPINE] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(1.0, 0.0 / 255, 7.0 / 255, 1.0)
)
RENDER_DATA[NT.TORSO] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(1.0, 193.0 / 255, 7.0 / 255, 1.0)
)
RENDER_DATA[NT.UPPER_LEG] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(63.0/255, 81.0/255, 181.0/255, 1.0)
)
RENDER_DATA[NT.LOWER_LEG] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(63.0/255, 81.0/255, 181.0/255, 1.0)
)
RENDER_DATA[NT.FOOT] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(26.0/255, 35.0/255, 126.0/255, 1.0)
)
RENDER_DATA[NT.UPPER_ARM] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(63.0/255, 81.0/255, 181.0/255, 1.0)
)
RENDER_DATA[NT.LOWER_ARM] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(63.0/255, 81.0/255, 181.0/255, 1.0)
)
RENDER_DATA[NT.FINGER] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(26.0/255, 35.0/255, 126.0/255, 1.0)
)
RENDER_DATA[NT.HAND] = PartRenderData(
scale_func = functools.partial(y_axis_scale_func, default_scale),
enabled = True,
color = glm.vec4(26.0/255, 35.0/255, 126.0/255, 1.0)
)
return RENDER_DATA