def __init__(self, allowMultiSelection=True): self.items = [] selectCommand = self.selectionChanged editCommand = self.editLabelCommand if Utils.getMayaVersion() < Utils.MAYA2012: selectCommand = Utils.createMelProcedure(self.selectionChanged, [('int', 'item'), ('int', 'state')], returnType="int") editCommand = Utils.createMelProcedure(self.editLabelCommand, [('string', 'item'), ('string', 'newName')]) self.control = cmds.treeView( numberOfButtons=0, height=100, selectCommand=selectCommand, editLabelCommand=editCommand, dragAndDropCommand=self.handleDragDropCommand) cmds.treeView(self.control, e=True, enableKeys=True) # list of selected IDs self.selectedItems = [] self.onSelectionChanged = Signal() self.__selectionChanging = False self.__itemNameChanging = False
def exit(self, *args): """ exits tool and resets it to the ngSkinTools settings """ init_mel = Utils.createMelProcedure(ngLayerPaintCtxInitialize, [('string', 'mesh')], returnType='string') cmds.artUserPaintCtx("ngSkinToolsLayerPaintCtx", e=True, setValueCommand="ngLayerPaintCtxSetValue", initializeCmd=init_mel, finalizeCmd="ngLayerPaintCtxFinalize", value=self.defaultVal) cmds.rowColumnLayout(self.ng_radio_layout[0], e=True, enable=True) cmds.checkBox(self.ng_checkboxes[0], e=True, enable=True) cmds.checkBox(self.ng_checkboxes[1], e=True, enable=True) cmds.rowLayout(self.ng_slider_rows[0], e=True, enable=True) cmds.formLayout(self.radio_form, e=True, enable=False) cmds.button(self.floodButton, e=True, enable=False) cmds.rowLayout(self.intensity_row, e=True, enable=False) cmds.rowLayout(self.volume_row, e=True, enable=False) ng_paint_mode = [(self.ng_radio_buttons.index(i) + 1) for i in self.ng_radio_buttons if cmds.radioButton(i, q=True, select=True) is True] ng_intensity_value = cmds.floatSlider(self.ng_intensity[0], q=True, value=True) cmds.ngSkinLayer(paintOperation=ng_paint_mode[0], paintIntensity=ng_intensity_value)
def doStartPaint(self): if not cmds.artUserPaintCtx(self.TOOL_PAINT,exists=True): cmds.artUserPaintCtx(self.TOOL_PAINT); cmds.artUserPaintCtx(self.TOOL_PAINT,e=True, tsc=Utils.createMelProcedure(self.paintCtxSetupProcedure, [('string','toolContext')]), toolCleanupCmd=Utils.createMelProcedure(self.paintCtxCleanupProcedure, [('string','toolContext')]), initializeCmd="ngLayerPaintCtxInitialize", finalizeCmd="ngLayerPaintCtxFinalize", setValueCommand="ngLayerPaintCtxSetValue", getValueCommand="ngLayerPaintCtxGetValue", whichTool="userPaint", fullpaths = True ) self.configurePaintValues() cmds.setToolTo(self.TOOL_PAINT);
def doStartPaint(self): if not cmds.artUserPaintCtx(self.TOOL_PAINT,exists=True): cmds.artUserPaintCtx(self.TOOL_PAINT); cmds.artUserPaintCtx(self.TOOL_PAINT,e=True, tsc=Utils.createMelProcedure(self.paintCtxSetupProcedure, [('string','toolContext')]), toolCleanupCmd=Utils.createMelProcedure(self.paintCtxCleanupProcedure, [('string','toolContext')]), initializeCmd="ngLayerPaintCtxInitialize", finalizeCmd="ngLayerPaintCtxFinalize", setValueCommand="ngLayerPaintCtxSetValue", getValueCommand="ngLayerPaintCtxGetValue", whichTool="userPaint", fullpaths = True ) self.configurePaintValues() cmds.setToolTo(self.TOOL_PAINT);
def __init__(self,allowMultiSelection=True): self.items = [] selectCommand = self.selectionChanged editCommand = self.editLabelCommand if Utils.getMayaVersion()<Utils.MAYA2012: selectCommand = Utils.createMelProcedure(self.selectionChanged, [('int','item'),('int','state')],returnType="int") editCommand = Utils.createMelProcedure(self.editLabelCommand, [('string','item'),('string','newName')]) self.control = cmds.treeView(numberOfButtons=0, height=100, selectCommand=selectCommand, editLabelCommand=editCommand,dragAndDropCommand=self.handleDragDropCommand) cmds.treeView(self.control,e=True,enableKeys=True) # list of selected IDs self.selectedItems = [] self.onSelectionChanged = Signal() self.__selectionChanging = False self.__itemNameChanging = False