def do_convert(self): mc.renderThumbnailUpdate(False) all_materials = pm.ls(materials=1) if all_materials: pd = QProgressDialog('Converting...', 'Cancel', 0, len(all_materials)) pd.setWindowModality(Qt.WindowModal) pd.show() value = 0 for material in all_materials: ret = delete_unused_shader(material) if ret: value += 1 continue mat_type = material.type() if mat_type in mat_dict: if material.outColor.outputs(): if material.outColor.outputs()[0].type( ) == 'aiOf_aiLayerMixer': value += 1 continue convert_aistandard_sss(material) elif mat_type in of_mat_dict: convert_ailayermixer(material) elif mat_type == 'aiOf_aiRimFilter': convert_aiRimFilter(material) value += 1 close_addtional_color() self.init_settings() self.label.setText( '<font size=3 color=#00FF00><b>^o^Convert Successful!!!^o^</b></font>' )
def kmSwitchBallPreview(self): renderBall = mc.renderThumbnailUpdate(q=True) if renderBall: mc.renderThumbnailUpdate(False) print ">> Render Thumbnail OFF" else: mc.renderThumbnailUpdate(True) print ">> Render Thumbnail ON"
def thumbnailUpdateButton_clicked(self, *args): if cmds.renderThumbnailUpdate(q=True): cmds.renderThumbnailUpdate(False) cmds.iconTextButton("thumbnailUpdateButton", edit=True, image = os.path.join(self.iconsPath, "ThumbnailUpdateSwitch_OFF.png")) print "#---------> Render Thumbnail Update: Disabled" else: cmds.renderThumbnailUpdate(True) cmds.iconTextButton("thumbnailUpdateButton", edit=True, image = os.path.join(self.iconsPath, "ThumbnailUpdateSwitch_ON.png")) print "#---------> Render Thumbnail Update: Enabled"
def __init__(self, parent, width=24, height=24, iconsPath=os.path.dirname(__file__) ): self.parent = parent self.width = width self.height = height self.iconsPath = iconsPath cmds.iconTextButton("thumbnailUpdateButton",\ parent = self.parent,\ width = self.width,\ ebg = True,\ bgc = (0.0, 0.0, 0.0),\ image = os.path.join(self.iconsPath, "ThumbnailUpdateSwitch_OFF.png"),\ style = "iconOnly",\ height = self.height,\ command = self.thumbnailUpdateButton_clicked) cmds.renderThumbnailUpdate(False)
import maya.cmds as mc renderBall = mc.renderThumbnailUpdate(q=True) if renderBall: mc.renderThumbnailUpdate(False) print ">> Render Thumbnail OFF" else: mc.renderThumbnailUpdate(True) print ">> Render Thumbnail ON"
def update_material(status): mc.renderThumbnailUpdate(status)