X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=swig%2Fenglishmap.py;h=d3e2a224c1498725053249c9a071f46075f15c4d;hb=16747520a6f143bfed46cf02617ad0ab306ecdf8;hp=0a5a1160fa99746ec5d523b556a7af0a3da2044c;hpb=bc4f1e0f7da2f5447e0612569153971284d1155e;p=meshio%2Fmeshio.git diff --git a/swig/englishmap.py b/swig/englishmap.py index 0a5a116..d3e2a22 100644 --- a/swig/englishmap.py +++ b/swig/englishmap.py @@ -5,211 +5,237 @@ import sys ############################################################################### # 日本語名との変換マップ ############################################################################### -boneMap={ -"center":"センター", -"upper body":"上半身", -"neck":"首", -"head":"頭", -"eye_L":"左目", -"eye_R":"右目", -"necktie1":"ネクタイ1", -"necktie2":"ネクタイ2", -"necktie3":"ネクタイ3", -"lower body":"下半身", -"waist accessory":"腰飾り", -"hair1_L":"左髪1", -"hair2_L":"左髪2", -"hair3_L":"左髪3", -"hair4_L":"左髪4", -"hair5_L":"左髪5", -"hair6_L":"左髪6", -"shoulder_L":"左肩", -"arm_L":"左腕", -"arm twist_L":"左腕捩", -"elbow_L":"左ひじ", -"wrist twist_L":"左手捩", -"wrist_L":"左手首", -"sleeve_L":"左袖", -"thumb1_L":"左親指1", -"thumb2_L":"左親指2", -"fore1_L":"左人指1", -"fore2_L":"左人指2", -"fore3_L":"左人指3", -"middle1_L":"左中指1", -"middle2_L":"左中指2", -"middle3_L":"左中指3", -"third1_L":"左薬指1", -"third2_L":"左薬指2", -"third3_L":"左薬指3", -"little1_L":"左小指1", -"little2_L":"左小指2", -"little3_L":"左小指3", -"front skirt_L":"左スカート前", -"back skirt_L":"左スカート後", -"leg_L":"左足", -"knee_L":"左ひざ", -"ankle_L":"左足首", -"hair1_R":"右髪1", -"hair2_R":"右髪2", -"hair3_R":"右髪3", -"hair4_R":"右髪4", -"hair5_R":"右髪5", -"hair6_R":"右髪6", -"shoulder_R":"右肩", -"arm_R":"右腕", -"arm twist_R":"右腕捩", -"elbow_R":"右ひじ", -"wrist twist_R":"右手捩", -"wrist_R":"右手首", -"sleeve_R":"右袖", -"thumb1_R":"右親指1", -"thumb2_R":"右親指2", -"fore1_R":"右人指1", -"fore2_R":"右人指2", -"fore3_R":"右人指3", -"middle1_R":"右中指1", -"middle2_R":"右中指2", -"middle3_R":"右中指3", -"third1_R":"右薬指1", -"third2_R":"右薬指2", -"third3_R":"右薬指3", -"little1_R":"右小指1", -"little2_R":"右小指2", -"little3_R":"右小指3", -"front skirt_R":"右スカート前", -"back skirt_R":"右スカート後", -"leg_R":"右足", -"knee_R":"右ひざ", -"ankle_R":"右足首", -"eyes":"両目", -"front hair1":"前髪1", -"front hair2":"前髪2", -"front hair3":"前髪3", -"eyelight_L":"左目光", -"eyelight_R":"右目光", -"necktie4":"ネクタイ4", -"hair7_L":"左髪7", -"hair7_R":"右髪7", -"toe_L":"左つま先", -"toe_R":"右つま先", -"necktie IK":"ネクタイIK", -"hair IK_L":"左髪IK", -"hair IK_R":"右髪IK", -"leg IK_L":"左足IK", -"leg IK_R":"右足IK", -"toe IK_L":"左つま先IK", -"toe IK_R":"右つま先IK", -"bone093":"下半身先", -"bone094":"頭先", -"bone095":"左目先", -"bone096":"右目先", -"bone097":"腰飾り先", -"bone098":"左袖先", -"bone099":"左手先", -"bone100":"左親指先", -"bone101":"左人差指先", -"bone102":"左中指先", -"bone103":"左薬指先", -"bone104":"左小指先", -"bone105":"左スカート前先", -"bone106":"左スカート後先", -"bone107":"右袖先", -"bone108":"右手先", -"bone109":"右親指先", -"bone110":"右人差指先", -"bone111":"右中指先", -"bone112":"右薬指先", -"bone113":"右小指先", -"bone114":"右スカート前先", -"bone115":"右スカート後先", -"bone116":"センター先", -"bone117":"両目先", -"bone118":"ネクタイIK先", -"bone119":"左髪IK先", -"bone120":"右髪IK先", -"bone121":"左足IK先", -"bone122":"右足IK先", -"bone123":"左つま先IK先", -"bone124":"右つま先IK先", -"bone125":"前髪1先", -"bone126":"前髪2先", -"bone127":"前髪3先", -"bone128":"左目光先", -"bone129":"右目光先", -"bone130":"左腕捩先", -"bone131":"左手捩先", -"bone132":"右腕捩先", -"bone133":"右手捩先", -"ude hineri1_L":"左腕捩1", -"ude hineri2_L":"左腕捩2", -"ude hineri3_L":"左腕捩3", -"ude hineri1_R":"右腕捩1", -"ude hineri2_R":"右腕捩2", -"ude hineri3_R":"右腕捩3", -} +boneMap=[ +("center", "センター", 1), +("upper body", "上半身"), +("neck", "首"), +("head", "頭"), +("eye_L", "左目", 5), +("eye_R", "右目", 5), +("necktie1", "ネクタイ1"), +("necktie2", "ネクタイ2"), +("necktie3", "ネクタイ3"), +("lower body", "下半身"), +("waist accessory", "腰飾り"), +("hair1_L", "左髪1"), +("hair2_L", "左髪2"), +("hair3_L", "左髪3"), +("hair4_L", "左髪4"), +("hair5_L", "左髪5"), +("hair6_L", "左髪6"), +("shoulder_L", "左肩"), +("arm_L", "左腕"), +("arm twist_L", "左腕捩", 8), +("elbow_L", "左ひじ"), +("wrist twist_L", "左手捩", 8), +("wrist_L", "左手首"), +("sleeve_L", "左袖", 1), +("thumb1_L", "左親指1"), +("thumb2_L", "左親指2"), +("fore1_L", "左人指1"), +("fore2_L", "左人指2"), +("fore3_L", "左人指3"), +("middle1_L", "左中指1"), +("middle2_L", "左中指2"), +("middle3_L", "左中指3"), +("third1_L", "左薬指1"), +("third2_L", "左薬指2"), +("third3_L", "左薬指3"), +("little1_L", "左小指1"), +("little2_L", "左小指2"), +("little3_L", "左小指3"), +("front skirt_L", "左スカート前"), +("back skirt_L", "左スカート後"), +("leg_L", "左足"), +("knee_L", "左ひざ"), +("ankle_L", "左足首"), +("hair1_R", "右髪1"), +("hair2_R", "右髪2"), +("hair3_R", "右髪3"), +("hair4_R", "右髪4"), +("hair5_R", "右髪5"), +("hair6_R", "右髪6"), +("shoulder_R", "右肩"), +("arm_R", "右腕"), +("arm twist_R", "右腕捩", 8), +("elbow_R", "右ひじ"), +("wrist twist_R", "右手捩", 8), +("wrist_R", "右手首"), +("sleeve_R", "右袖", 1), +("thumb1_R", "右親指1"), +("thumb2_R", "右親指2"), +("fore1_R", "右人指1"), +("fore2_R", "右人指2"), +("fore3_R", "右人指3"), +("middle1_R", "右中指1"), +("middle2_R", "右中指2"), +("middle3_R", "右中指3"), +("third1_R", "右薬指1"), +("third2_R", "右薬指2"), +("third3_R", "右薬指3"), +("little1_R", "右小指1"), +("little2_R", "右小指2"), +("little3_R", "右小指3"), +("front skirt_R", "右スカート前"), +("back skirt_R", "右スカート後"), +("leg_R", "右足"), +("knee_R", "右ひざ"), +("ankle_R", "右足首"), +("eyes", "両目"), +("front hair1", "前髪1"), +("front hair2", "前髪2"), +("front hair3", "前髪3"), +("eyelight_L", "左目光"), +("eyelight_R", "右目光"), +("necktie3_t", "ネクタイ4"), +("hair6_L_t", "左髪7"), +("hair6_R_t", "右髪7"), +("ankle_L_t", "左つま先"), +("ankle_R_t", "右つま先"), +("necktie IK", "ネクタイIK"), +("hair IK_L", "左髪IK"), +("hair IK_R", "右髪IK"), +("leg IK_L", "左足IK"), +("leg IK_R", "右足IK"), +("toe IK_L", "左つま先IK"), +("toe IK_R", "右つま先IK"), + +("lower body_t", "下半身先"), +("head_t", "頭先"), +("eye_L_t", "左目先"), +("eye_R_t", "右目先"), +("waist accessory_t", "腰飾り先"), + +("sleeve_L_t", "左袖先"), +("wrist_L_t", "左手先"), +("thumb2_L_t", "左親指先"), +("fore3_L_t", "左人差指先"), +("middle3_L_t", "左中指先"), +("third3_L_t", "左薬指先"), +("little3_L_t", "左小指先"), +("front skirt_L_t", "左スカート前先"), +("back skirt_L_t", "左スカート後先"), + +("sleeve_R_t", "右袖先"), +("wrist_R_t", "右手先"), +("thumb2_R_t", "右親指先"), +("fore3_R_t", "右人差指先"), +("middle3_R_t", "右中指先"), +("third3_R_t", "右薬指先"), +("little3_R_t", "右小指先"), +("front skirt_R_t", "右スカート前先"), +("back skirt_R_t", "右スカート後先"), + +("center_t", "センター先"), +("eyes_t", "両目先"), +("necktie IK_t", "ネクタイIK先"), +("hair IK_L_t", "左髪IK先"), +("hair IK_R_t", "右髪IK先"), +("leg IK_L_t", "左足IK先"), +("leg IK_R_t", "右足IK先"), +("toe IK_L_t", "左つま先IK先"), +("toe IK_R_t", "右つま先IK先"), +("front hair1_t", "前髪1先"), +("front hair2_t", "前髪2先"), +("front hair3_t", "前髪3先"), +("eyelight_L_t", "左目光先"), +("eyelight_R_t", "右目光先"), +("arm twist_L_t", "左腕捩先"), +("wrist twist_L_t", "左手捩先"), +("arm twist_R_t", "右腕捩先"), +("wrist twist_R_t", "右手捩先"), +("arm twist1_L", "左腕捩1", 9), +("arm twist2_L", "左腕捩2", 9), +("arm twist3_L", "左腕捩3", 9), +("arm twist1_R", "右腕捩1", 9), +("arm twist2_R", "右腕捩2", 9), +("arm twist3_R", "右腕捩3", 9), +# +("arm twist1_L_t", "左腕捩1先"), +("arm twist2_L_t", "左腕捩2先"), +("arm twist3_L_t", "左腕捩3先"), +("arm twist1_R_t", "右腕捩1先"), +("arm twist2_R_t", "右腕捩2先"), +("arm twist3_R_t", "右腕捩3先"), +] def getEnglishBoneName(name): - for k, v in boneMap.items(): - if v==name: - return k + for v in boneMap: + if v[1]==name: + return v[0] + +def getIndexByEnglish(name): + for i, v in enumerate(boneMap): + if v[0]==name: + return i def getUnicodeBoneName(name): - if name.endswith('_t'): - name=name[:-2] - if name in boneMap: - return boneMap[name]+(u'先' if sys.version_info[0]<3 else '先') - else: - if name in boneMap: - return boneMap[name] + for v in boneMap: + if v[0]==name: + return v -skinMap={ -"skin000":"base", -"serious":"真面目", -"sadness":"困る", -"cheerful":"にこり", -"anger":"怒り", -"go up":"上", -"go down":"下", -"blink":"まばたき", -"smile":"笑い", -"wink":"ウィンク", -"wink2":"ウィンク2", -"wink_R":"ウィンク右", -"wink2_R":"ウィンク2右", -"close><":"はぅ", -"calm":"なごみ", -"surprise":"びっくり", -"doubt":"じと目", -"confuse":"なぬ!", -"pupil":"瞳小", -"a":"あ", -"i":"い", -"u":"う", -"o":"お", -"triangle":"▲", -"regret":"∧", -"omega":"ω", -"omegabox":"ω□", -"fool":"はんっ!", -"tongue":"ぺろっ", -"e-":"えー", -"grin":"にやり", -} +skinMap=[ +("base", "base", 0), +("serious", "真面目", 1), +("sadness", "困る", 1), +("cheerful", "にこり", 1), +("anger", "怒り", 1), +("go up", "上", 1), +("go down", "下", 1), +("blink", "まばたき", 2), +("smile", "笑い", 2), +("wink", "ウィンク", 2), +("wink2", "ウィンク2", 2), +("wink_R", "ウィンク右", 2), +("wink2_R", "ウィンク2右", 2), +("close><", "はぅ", 2), +("calm", "なごみ", 2), +("surprise", "びっくり", 2), +("doubt", "じと目", 2), +("confuse", "なぬ!", 2), +("pupil", "瞳小", 4), +("a", "あ", 3), +("i", "い", 3), +("u", "う", 3), +("o", "お", 3), +("triangle", "▲", 3), +("regret", "∧", 3), +("omega", "ω", 3), +("omegabox", "ω□", 3), +("fool", "はんっ!", 3), +("tongue", "ぺろっ", 4), +("e-", "えー", 3), +("grin", "にやり", 3), +] def getEnglishSkinName(name): - for k, v in skinMap.items(): - if v==name: - return k + for v in skinMap: + if v[1]==name: + return v[0] def getUnicodeSkinName(name): - if name in skinMap: - return skinMap[name] + for v in skinMap: + if v[0]==name: + return v if sys.version_info[0]<3: print 'convert boneMap and skinMap to unicode...', # python2.x # unicodeに変換 - for k in boneMap.keys(): - boneMap[k]=boneMap[k].decode('utf-8') - for k in skinMap.keys(): - skinMap[k]=skinMap[k].decode('utf-8') + for i, l in enumerate(boneMap): + replace=[] + for j, m in enumerate(l): + if j==1: + replace.append(m.decode('utf-8')) + else: + replace.append(m) + boneMap[i]=replace + + for i, l in enumerate(skinMap): + replace=[] + for j, m in enumerate(l): + if j==1: + replace.append(m.decode('utf-8')) + else: + replace.append(m) + skinMap[i]=replace print('done')