-
Notifications
You must be signed in to change notification settings - Fork 2
/
AddonProps.py
172 lines (162 loc) · 5.97 KB
/
AddonProps.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import bpy
yerFaceAxisMapEnumItems = [
('p.x', '+X', "Positive X Axis", 0),
('n.x', '-X', "Negative X Axis", 1),
('p.y', '+Y', "Positive Y Axis", 2),
('n.y', '-Y', "Negative Y Axis", 3),
('p.z', '+Z', "Positive Z Axis", 4),
('n.z', '-Z', "Negative Z Axis", 5),
('p._', 'N/A', "Disabled", 6)
]
yerFaceInputModeItems = [
('live', 'Live/Network Input', "Live Websocket Input", 0),
('file', 'File Input', "Perfcap File Input", 1)
]
yerFaceSamplingModeItems = [
('first', 'First', "Take the first sample for each frame", 0),
('last', 'Last', "Take the last sample for each frame", 1),
('average', 'Average', "Average samples within a frame", 2)
]
class YerFaceBlenderProperties(bpy.types.PropertyGroup):
translationTargetObject = bpy.props.StringProperty(
name = "Object",
default = "")
translationTargetBone = bpy.props.StringProperty(
name = "Bone",
default = "")
translationShowAdvanced = bpy.props.BoolProperty(default=False)
translationScale = bpy.props.FloatProperty(
name = "Scale",
default = 0.00328084, # millimeters to feet
min = 0.0)
translationScaleX = bpy.props.FloatProperty(
name = "X",
default = 1.0,
min = 0.0)
translationScaleY = bpy.props.FloatProperty(
name = "Y",
default = 1.0,
min = 0.0)
translationScaleZ = bpy.props.FloatProperty(
name = "Z",
default = 1.0,
min = 0.0)
translationAxisMapX = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map X",
default = "p.x")
translationAxisMapY = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map Y",
default = "p.y")
translationAxisMapZ = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map Z",
default = "p.z")
translationAnticipationFrames = bpy.props.IntProperty(
name = "Anticipate Motion N Frames Ago",
description = "If we're holding a property via deduplicated keyframes, but the property is about to change, how many frames ago should we anticipate this.",
min = 1,
default = 15)
rotationTargetObject = bpy.props.StringProperty(
name = "Object",
default = "")
rotationTargetBone = bpy.props.StringProperty(
name = "Bone",
default = "")
rotationShowAdvanced = bpy.props.BoolProperty(default=False)
rotationScale = bpy.props.FloatProperty(
name = "Scale",
default = 1.0,
min = 0.0)
rotationScaleX = bpy.props.FloatProperty(
name = "X",
default = 1.0,
min = 0.0)
rotationScaleY = bpy.props.FloatProperty(
name = "Y",
default = 1.0,
min = 0.0)
rotationScaleZ = bpy.props.FloatProperty(
name = "Z",
default = 1.0,
min = 0.0)
rotationAxisMapX = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map X",
default = "p.x")
rotationAxisMapY = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map Y",
default = "p.y")
rotationAxisMapZ = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map Z",
default = "p.z")
rotationAnticipationFrames = bpy.props.IntProperty(
name = "Anticipate Motion N Frames Ago",
description = "If we're holding a property via deduplicated keyframes, but the property is about to change, how many frames ago should we anticipate this.",
min = 1,
default = 15)
faceArmatureObject = bpy.props.StringProperty(
name = "Rig",
default = "")
faceBoneTranslationScale = bpy.props.FloatProperty(
name = "Scale",
default = 0.01,
min = 0.0)
faceShowAdvanced = bpy.props.BoolProperty(default=False)
faceBoneAxisMapX = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map X",
default = "p.x")
faceBoneAxisMapY = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map Y",
default = "p.y")
faceBoneAxisMapZ = bpy.props.EnumProperty(
items = yerFaceAxisMapEnumItems,
name = "Map Z",
default = "p.z")
faceAnticipationFrames = bpy.props.IntProperty(
name = "Anticipate Motion N Frames Ago",
description = "If we're holding a property via deduplicated keyframes, but the property is about to change, how many frames ago should we anticipate this.",
min = 1,
default = 15)
phonemesTargetObject = bpy.props.StringProperty(
name = "Object",
default = "")
phonemesShowAdvanced = bpy.props.BoolProperty(default=False)
phonemesScale = bpy.props.FloatProperty(
name = "Scale",
default = 1.0,
min = 0.0)
phonemesAnticipationFrames = bpy.props.IntProperty(
name = "Anticipate Motion N Frames Ago",
description = "If we're holding a property via deduplicated keyframes, but the property is about to change, how many frames ago should we anticipate this.",
min = 1,
default = 1)
tickCallback = bpy.props.StringProperty(
name = "Tick Callback",
default = "")
tickUserData = bpy.props.StringProperty(
name = "User Data",
default = "")
inputMode = bpy.props.EnumProperty(
items = yerFaceInputModeItems,
name = "Active Input Mode",
default = "live")
samplingMode = bpy.props.EnumProperty(
items = yerFaceSamplingModeItems,
name = "Keyframe Sampling Mode",
default = "average")
websocketURI = bpy.props.StringProperty(
name = "Websocket URI",
default = "ws://localhost:9002")
inputFilePath = bpy.props.StringProperty(
name="Perfcap JSON File",
description="Exported performance capture data from YerFace!",
subtype="FILE_PATH")
importStartFrame = bpy.props.IntProperty(
name = "Start Frame",
default = 1)