def getAllUDIMs(self): udim = [] for i in self.assignation: if '.' not in i: faceList = cmds.ls(i + '.f[*]', flatten=True) else: faceList = cmds.ls(i, flatten=True) for face in faceList: udim.append(tdLib.getUDIM(face)) udim.sort() udim = list(k for k, _ in itertools.groupby(udim)) return udim
def getAllUDIMs(self): udim = [] for i in self.assignation: if '.' not in i: faceList = cmds.ls(i + '.f[*]', flatten=True) else: faceList = cmds.ls(i, flatten=True) for face in faceList: udim.append(tdLib.getUDIM(face)) udim.sort() udim = list(k for k,_ in itertools.groupby(udim)) return udim
def bake(self): for shader, attr in self.shaders.items(): t = initstats.emit('bake', True) assignation = attr[0] path = attr[1] texture = attr[2] Umin, Vmin = tdLib.getUDIM(assignation) with tdLib.UndoContext(): assignation = self.extract_combine(assignation) dummyFile = cmds.convertSolidTx(texture + '.outColor', assignation, fileImageName=path, antiAlias=1, backgroundMode=2, resolutionX=512, resolutionY=512, fileFormat='tga', uvRange=[Umin, Umin+1, Vmin, Vmin+1]) cmds.undo() self.reinitialise_texture() logger.info(self.create_high(path)) logger.info(path) t.stop()
def bake(self): for shader, attr in self.shaders.items(): t = initstats.emit('bake', True) assignation = attr[0] path = attr[1] texture = attr[2] Umin, Vmin = tdLib.getUDIM(assignation) with tdLib.UndoContext(): assignation = self.extract_combine(assignation) dummyFile = cmds.convertSolidTx( texture + '.outColor', assignation, fileImageName=path, antiAlias=1, backgroundMode=2, resolutionX=512, resolutionY=512, fileFormat='tga', uvRange=[Umin, Umin + 1, Vmin, Vmin + 1]) cmds.undo() self.reinitialise_texture() logger.info(self.create_high(path)) logger.info(path) t.stop()