@@ -70,7 +70,7 @@ def init_human(self):
70
70
)
71
71
# Add eyes
72
72
self .add_proxy (data_path ("eyes/high-poly/high-poly.mhpxy" ), "eyes" )
73
- base_skel = skeleton .load (
73
+ self . base_skel = skeleton .load (
74
74
mh .getSysDataPath ("rigs/default.mhskel" ),
75
75
self .human .meshData ,
76
76
)
@@ -79,9 +79,9 @@ def init_human(self):
79
79
)
80
80
# Build joint weights on our chosen skeleton, derived from the base
81
81
# skeleton
82
- cmu_skel .autoBuildWeightReferences (base_skel )
82
+ cmu_skel .autoBuildWeightReferences (self . base_skel )
83
83
84
- self .human .setBaseSkeleton (base_skel )
84
+ self .human .setBaseSkeleton (self . base_skel )
85
85
# Actually add the skeleton
86
86
self .human .setSkeleton (cmu_skel )
87
87
self .human .applyAllTargets ()
@@ -186,6 +186,18 @@ def add_proxy(self, proxypath, proxy_type=None):
186
186
# vertsMask[verts] = False
187
187
# self.human.changeVertexMask(vertsMask)
188
188
189
+ def add_item (self , path ):
190
+ if "mhpxy" in path :
191
+ self .add_proxy (path )
192
+ elif "mhskel" in path :
193
+ self .set_skel (path )
194
+
195
+ def set_skel (self , path ):
196
+ skel = skeleton .load (path , self .human .meshData )
197
+ skel .autoBuildWeightReferences (self .base_skel )
198
+ self .human .setSkeleton (skel )
199
+ self .human .applyAllTargets ()
200
+
189
201
def guess_proxy_type (self , path ):
190
202
proxy_types = ("eyes" , "clothes" , "eyebrows" , "eyelashes" , "hair" )
191
203
for type in proxy_types :
0 commit comments