Tasks/3dsMaxBipedTemplate.py
19 bipedrootname =
"<CharacterName>"
23 bipedPrefixNamingScheme =
True
27 bipedMap = {
'Reference' :
'Fbx_Root',
29 'LeftUpLeg' :
'L Thigh',
31 'LeftFoot' :
'L Foot',
32 'RightUpLeg' :
'R Thigh',
33 'RightLeg' :
'R Calf',
34 'RightFoot' :
'R Foot',
36 'LeftArm' :
'L UpperArm',
37 'LeftForeArm' :
'L Forearm',
38 'LeftHand' :
'L Hand',
39 'RightArm' :
'R UpperArm',
40 'RightForeArm' :
'R Forearm',
41 'RightHand' :
'R Hand',
43 'LeftShoulder' :
'L Clavicle',
44 'RightShoulder' :
'R Clavicle',
64 'LeftHandThumb1' :
'L Finger0',
65 'LeftHandThumb2' :
'L Finger01',
66 'LeftHandThumb3' :
'L Finger02',
67 'LeftHandIndex1' :
'L Finger1',
68 'LeftHandIndex2' :
'L Finger11',
69 'LeftHandIndex3' :
'L Finger12',
70 'LeftHandMiddle1' :
'L Finger2',
71 'LeftHandMiddle2' :
'L Finger21',
72 'LeftHandMiddle3' :
'L Finger22',
73 'LeftHandRing1' :
'L Finger3',
74 'LeftHandRing2' :
'L Finger31',
75 'LeftHandRing3' :
'L Finger32',
76 'LeftHandPinky1' :
'L Finger4',
77 'LeftHandPinky2' :
'L Finger41',
78 'LeftHandPinky3' :
'L Finger42',
79 'RightHandThumb1' :
'R Finger0',
80 'RightHandThumb2' :
'R Finger01',
81 'RightHandThumb3' :
'R Finger02',
82 'RightHandIndex1' :
'R Finger1',
83 'RightHandIndex2' :
'R Finger11',
84 'RightHandIndex3' :
'R Finger12',
85 'RightHandMiddle1' :
'R Finger2',
86 'RightHandMiddle2' :
'R Finger21',
87 'RightHandMiddle3' :
'R Finger22',
88 'RightHandRing1' :
'R Finger3',
89 'RightHandRing2' :
'R Finger31',
90 'RightHandRing3' :
'R Finger32',
91 'RightHandPinky1' :
'R Finger4',
92 'RightHandPinky2' :
'R Finger41',
93 'RightHandPinky3' :
'R Finger42',
94 'LeftFootThumb1' :
'L Toe4',
95 'LeftFootThumb2' :
'L Toe41',
96 'LeftFootThumb3' :
'L Toe42',
97 'LeftFootIndex1' :
'L Toe3',
98 'LeftFootIndex2' :
'L Toe31',
99 'LeftFootIndex3' :
'L Toe32',
100 'LeftFootMiddle1' :
'L Toe2',
101 'LeftFootMiddle2' :
'L Toe21',
102 'LeftFootMiddle3' :
'L Toe22',
103 'LeftFootRing1' :
'L Toe1',
104 'LeftFootRing2' :
'L Toe11',
105 'LeftFootRing3' :
'L Toe12',
106 'LeftFootPinky1' :
'L Toe0',
107 'LeftFootPinky2' :
'L Toe01',
108 'LeftFootPinky3' :
'L Toe02',
109 'RightFootThumb1' :
'R Toe4',
110 'RightFootThumb2' :
'R Toe41',
111 'RightFootThumb3' :
'R Toe42',
112 'RightFootIndex1' :
'R Toe3',
113 'RightFootIndex2' :
'R Toe31',
114 'RightFootIndex3' :
'R Toe32',
115 'RightFootMiddle1' :
'R Toe2',
116 'RightFootMiddle2' :
'R Toe21',
117 'RightFootMiddle3' :
'R Toe22',
118 'RightFootRing1' :
'R Toe1',
119 'RightFootRing2' :
'R Toe11',
120 'RightFootRing3' :
'R Toe12',
121 'RightFootPinky1' :
'R Toe0',
122 'RightFootPinky2' :
'R Toe01',
123 'RightFootPinky3' :
'R Toe02',
124 'LeftUpLegRoll' :
'LThighTwist',
125 'LeftLegRoll' :
'LCalfTwist',
126 'RightUpLegRoll' :
'RThighTwist',
127 'RightLegRoll' :
'RCalfTwist',
128 'LeftArmRoll' :
'LUpArmTwist',
129 'LeftForeArmRoll' :
'L ForeTwist',
130 'RightArmRoll' :
'RUpArmTwist',
131 'RightForeArmRoll' :
'R ForeTwist' }
133 def addJointToCharacter ( characterObject, slot, jointName ):
136 proplist = characterObject.PropertyList.Find(slot +
"Link")
137 proplist.append (myJoint)
139 def Characterize(rootname, useBipedPrefixNamingScheme, boneMap):
150 if len( models ) == 0:
151 FBMessageBox(
"Message",
"Please select a Biped joint.",
"OK",
None,
None )
152 elif len( models ) > 1:
154 FBMessageBox(
"Message",
"Only one Biped joint must be selected.",
"OK",
None,
None )
157 longname = models[0].LongName
158 namespaceindex = longname.rfind(
":")
159 if namespaceindex != -1:
160 namespace = longname[0:namespaceindex+1]
161 name = longname[namespaceindex + 1:]
168 if useBipedPrefixNamingScheme:
169 splitname = name.split()
170 bipednameprefix = splitname[0] +
" "
172 rootname = splitname[0]
175 myBiped.LongName = namespace + rootname
176 app.CurrentCharacter = myBiped
181 fbp.Text =
" ----------------------------------- Creating Biped character"
183 progresssteps = len(boneMap)
186 for pslot, pjointName
in boneMap.iteritems():
188 addJointToCharacter (myBiped, pslot, namespace + rootname)
190 addJointToCharacter (myBiped, pslot, namespace + bipednameprefix + pjointName)
192 val = progress / len(boneMap) * 100
193 fbp.Percent = int(val)
195 switchOn = myBiped.SetCharacterizeOn(
True )
196 print "Character mapping created for " + (myBiped.LongName)
203 Characterize(bipedrootname, bipedPrefixNamingScheme, bipedMap)