def create_ramp(self): my_ramp = pm.shadingNode('ramp', asTexture= True) self.customWin = 'customramps' if (pm.window(self.customWin, exists=True)): pm.deleteUI(self.customWin) if (pm.windowPref(self.customWin, exists=True)): pm.windowPref(self.customWin, remove = True) myWin = pm.window(self.customWin, title = 'CUSTOM RAMPS', width = 200, height = 150, backgroundColor=[.5,.5,.5]) pm.columnLayout(adjustableColumn=True) colors = pm.attrColorSliderGrp(columnWidth4= [100, 75, 175, 50]) my_port = pm.rampColorPort(node= my_ramp, sc= colors) self.ramp_field = pm.textFieldButtonGrp(label= 'ramp name', buttonLabel= 'rename', buttonCommand= pm.Callback(self.rename, my_ramp), columnWidth3= [150,100,150]) myWin.show()
def edit_ramp(self): selected = self.list_field.getSelectItem()[0] # pm.rampColorPort( node=selected ) self.customWin = 'editramps' if (pm.window(self.customWin, exists=True)): pm.deleteUI(self.customWin) if (pm.windowPref(self.customWin, exists=True)): pm.windowPref(self.customWin, remove = True) myWin = pm.window(self.customWin, title = 'EDIT RAMPS', width = 400, height = 150, backgroundColor=[.5,.5,.5]) pm.columnLayout(adjustableColumn=True) colors = pm.attrColorSliderGrp(columnWidth4= [100, 75, 175, 50]) my_port = pm.rampColorPort(node= selected, sc= colors) myWin.show()