@@ -70,7 +70,7 @@ def init_human(self):
7070 )
7171 # Add eyes
7272 self .add_proxy (data_path ("eyes/high-poly/high-poly.mhpxy" ), "eyes" )
73- base_skel = skeleton .load (
73+ self . base_skel = skeleton .load (
7474 mh .getSysDataPath ("rigs/default.mhskel" ),
7575 self .human .meshData ,
7676 )
@@ -79,9 +79,9 @@ def init_human(self):
7979 )
8080 # Build joint weights on our chosen skeleton, derived from the base
8181 # skeleton
82- cmu_skel .autoBuildWeightReferences (base_skel )
82+ cmu_skel .autoBuildWeightReferences (self . base_skel )
8383
84- self .human .setBaseSkeleton (base_skel )
84+ self .human .setBaseSkeleton (self . base_skel )
8585 # Actually add the skeleton
8686 self .human .setSkeleton (cmu_skel )
8787 self .human .applyAllTargets ()
@@ -186,6 +186,18 @@ def add_proxy(self, proxypath, proxy_type=None):
186186 # vertsMask[verts] = False
187187 # self.human.changeVertexMask(vertsMask)
188188
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+
189201 def guess_proxy_type (self , path ):
190202 proxy_types = ("eyes" , "clothes" , "eyebrows" , "eyelashes" , "hair" )
191203 for type in proxy_types :
0 commit comments