OSDN Git Service

add ik_index.
[meshio/meshio.git] / swig / englishmap.py
1 #!/usr/bin/env python
2 # coding: utf8
3 import sys
4
5 ###############################################################################
6 # 日本語名との変換マップ
7 ###############################################################################
8 boneMap=[
9 ("center", "センター", 1),
10 ("upper body", "上半身"),
11 ("neck", "首"),
12 ("head", "頭"),
13 ("eye_L", "左目", 5),
14 ("eye_R", "右目", 5),
15 ("necktie1", "ネクタイ1"),
16 ("necktie2", "ネクタイ2"),
17 ("necktie3", "ネクタイ3"),
18 ("lower body", "下半身"),
19 ("waist accessory", "腰飾り"),
20 ("hair1_L", "左髪1"),
21 ("hair2_L", "左髪2"),
22 ("hair3_L", "左髪3"),
23 ("hair4_L", "左髪4"),
24 ("hair5_L", "左髪5"),
25 ("hair6_L", "左髪6"),
26 ("shoulder_L", "左肩"),
27 ("arm_L", "左腕"),
28 ("arm twist_L", "左腕捩", 8),
29 ("elbow_L", "左ひじ"),
30 ("wrist twist_L", "左手捩", 8),
31 ("wrist_L", "左手首"),
32 ("sleeve_L", "左袖", 1),
33 ("thumb1_L", "左親指1"),
34 ("thumb2_L", "左親指2"),
35 ("fore1_L", "左人指1"),
36 ("fore2_L", "左人指2"),
37 ("fore3_L", "左人指3"),
38 ("middle1_L", "左中指1"),
39 ("middle2_L", "左中指2"),
40 ("middle3_L", "左中指3"),
41 ("third1_L", "左薬指1"),
42 ("third2_L", "左薬指2"),
43 ("third3_L", "左薬指3"),
44 ("little1_L", "左小指1"),
45 ("little2_L", "左小指2"),
46 ("little3_L", "左小指3"),
47 ("front skirt_L", "左スカート前"),
48 ("back skirt_L", "左スカート後"),
49 ("leg_L", "左足"),
50 ("knee_L", "左ひざ"),
51 ("ankle_L", "左足首"),
52 ("hair1_R", "右髪1"),
53 ("hair2_R", "右髪2"),
54 ("hair3_R", "右髪3"),
55 ("hair4_R", "右髪4"),
56 ("hair5_R", "右髪5"),
57 ("hair6_R", "右髪6"),
58 ("shoulder_R", "右肩"),
59 ("arm_R", "右腕"),
60 ("arm twist_R", "右腕捩", 8),
61 ("elbow_R", "右ひじ"),
62 ("wrist twist_R", "右手捩", 8),
63 ("wrist_R", "右手首"),
64 ("sleeve_R", "右袖", 1),
65 ("thumb1_R", "右親指1"),
66 ("thumb2_R", "右親指2"),
67 ("fore1_R", "右人指1"),
68 ("fore2_R", "右人指2"),
69 ("fore3_R", "右人指3"),
70 ("middle1_R", "右中指1"),
71 ("middle2_R", "右中指2"),
72 ("middle3_R", "右中指3"),
73 ("third1_R", "右薬指1"),
74 ("third2_R", "右薬指2"),
75 ("third3_R", "右薬指3"),
76 ("little1_R", "右小指1"),
77 ("little2_R", "右小指2"),
78 ("little3_R", "右小指3"),
79 ("front skirt_R", "右スカート前"),
80 ("back skirt_R", "右スカート後"),
81 ("leg_R", "右足"),
82 ("knee_R", "右ひざ"),
83 ("ankle_R", "右足首"),
84 ("eyes", "両目"),
85 ("front hair1", "前髪1"),
86 ("front hair2", "前髪2"),
87 ("front hair3", "前髪3"),
88 ("eyelight_L", "左目光"),
89 ("eyelight_R", "右目光"),
90 ("necktie3_t", "ネクタイ4"),
91 ("hair6_L_t", "左髪7"),
92 ("hair6_R_t", "右髪7"),
93 ("ankle_L_t", "左つま先"),
94 ("ankle_R_t", "右つま先"),
95 ("necktie IK", "ネクタイIK"),
96 ("hair IK_L", "左髪IK"),
97 ("hair IK_R", "右髪IK"),
98 ("leg IK_L", "左足IK"),
99 ("leg IK_R", "右足IK"),
100 ("toe IK_L", "左つま先IK"),
101 ("toe IK_R", "右つま先IK"),
102
103 ("lower body_t", "下半身先"),
104 ("head_t", "頭先"),
105 ("eye_L_t", "左目先"),
106 ("eye_R_t", "右目先"),
107 ("waist accessory_t", "腰飾り先"),
108
109 ("sleeve_L_t", "左袖先"),
110 ("wrist_L_t", "左手先"),
111 ("thumb2_L_t", "左親指先"),
112 ("fore3_L_t", "左人差指先"),
113 ("middle3_L_t", "左中指先"),
114 ("third3_L_t", "左薬指先"),
115 ("little3_L_t", "左小指先"),
116 ("front skirt_L_t", "左スカート前先"),
117 ("back skirt_L_t", "左スカート後先"),
118
119 ("sleeve_R_t", "右袖先"),
120 ("wrist_R_t", "右手先"),
121 ("thumb2_R_t", "右親指先"),
122 ("fore3_R_t", "右人差指先"),
123 ("middle3_R_t", "右中指先"),
124 ("third3_R_t", "右薬指先"),
125 ("little3_R_t", "右小指先"),
126 ("front skirt_R_t", "右スカート前先"),
127 ("back skirt_R_t", "右スカート後先"),
128
129 ("center_t", "センター先"),
130 ("eyes_t", "両目先"),
131 ("necktie IK_t", "ネクタイIK先"),
132 ("hair IK_L_t", "左髪IK先"),
133 ("hair IK_R_t", "右髪IK先"),
134 ("leg IK_L_t", "左足IK先"),
135 ("leg IK_R_t", "右足IK先"),
136 ("toe IK_L_t", "左つま先IK先"),
137 ("toe IK_R_t", "右つま先IK先"),
138 ("front hair1_t", "前髪1先"),
139 ("front hair2_t", "前髪2先"),
140 ("front hair3_t", "前髪3先"),
141 ("eyelight_L_t", "左目光先"),
142 ("eyelight_R_t", "右目光先"),
143 ("arm twist_L_t", "左腕捩先"),
144 ("wrist twist_L_t", "左手捩先"),
145 ("arm twist_R_t", "右腕捩先"),
146 ("wrist twist_R_t", "右手捩先"),
147 ("arm twist1_L", "左腕捩1", 9),
148 ("arm twist2_L", "左腕捩2", 9),
149 ("arm twist3_L", "左腕捩3", 9),
150 ("arm twist1_R", "右腕捩1", 9),
151 ("arm twist2_R", "右腕捩2", 9),
152 ("arm twist3_R", "右腕捩3", 9),
153 #
154 ("arm twist1_L_t", "左腕捩1先"),
155 ("arm twist2_L_t", "左腕捩2先"),
156 ("arm twist3_L_t", "左腕捩3先"),
157 ("arm twist1_R_t", "右腕捩1先"),
158 ("arm twist2_R_t", "右腕捩2先"),
159 ("arm twist3_R_t", "右腕捩3先"),
160 ]
161 def getEnglishBoneName(name):
162     for v in boneMap:
163         if v[1]==name:
164             return v[0]
165
166 def getIndexByEnglish(name):
167     for i, v in enumerate(boneMap):
168         if v[0]==name:
169             return i
170
171 def getUnicodeBoneName(name):
172     for v in boneMap:
173         if v[0]==name:
174             return v
175
176 skinMap={
177 "skin000":"base",
178 "serious":"真面目",
179 "sadness":"困る",
180 "cheerful":"にこり",
181 "anger":"怒り",
182 "go up":"上",
183 "go down":"下",
184 "blink":"まばたき",
185 "smile":"笑い",
186 "wink":"ウィンク",
187 "wink2":"ウィンク2",
188 "wink_R":"ウィンク右",
189 "wink2_R":"ウィンク2右",
190 "close><":"はぅ",
191 "calm":"なごみ",
192 "surprise":"びっくり",
193 "doubt":"じと目",
194 "confuse":"なぬ!",
195 "pupil":"瞳小",
196 "a":"あ",
197 "i":"い",
198 "u":"う",
199 "o":"お",
200 "triangle":"▲",
201 "regret":"∧",
202 "omega":"ω",
203 "omegabox":"ω□",
204 "fool":"はんっ!",
205 "tongue":"ぺろっ",
206 "e-":"えー",
207 "grin":"にやり",
208 }
209 def getEnglishSkinName(name):
210     for k, v in skinMap.items():
211         if v==name:
212             return k
213
214 def getUnicodeSkinName(name):
215     if name in skinMap:
216         return skinMap[name]
217
218 if sys.version_info[0]<3:
219     print 'convert boneMap and skinMap to unicode...',
220     # python2.x
221     # unicodeに変換
222     for i, l in enumerate(boneMap):
223         replace=[]
224         for j, m in enumerate(l):
225             if j==1:
226                 replace.append(m.decode('utf-8'))
227             else:
228                 replace.append(m)
229         boneMap[i]=replace
230
231     for k in skinMap.keys():
232         skinMap[k]=skinMap[k].decode('utf-8')
233     print('done')        
234