def setPartUV(obj): if mc.objectType(obj, isType = 'mesh'): uuid = mc.getAttr('%s.assetUuid' % obj) if uv_data.has_key(uuid): uv.setMeshUV(obj, uv_data[uuid]) children = mc.listRelatives(obj, children = True, fullPath = True) if children: for c in children: setPartUV(c)
def loadUV(self, uv_file): uv_data = None with open(uv_file, 'r') as f: uv_data = json.loads(f.read()) for obj in uv_data.keys(): if mc.objExists(obj): uv.setMeshUV(obj, uv_data[obj]) mc.select(clear = True) return True