def createCacheContentsGroup(self): group = self.createUIGroup(self.cmdLayout.innerLayout, 'Cache Contents') self.createTitledRow(group, 'Current status') self.controls.labelCacheInfo = TextLabel(align='left') self.controls.labelCacheInfo.setBold() influencesLayout = cmds.columnLayout( parent=group, adjustableColumn=1, rowSpacing=Constants.MARGIN_SPACING_VERTICAL) self.createTitledRow(influencesLayout, "Influence Associations") self.controls.influencesList = cmds.textScrollList( parent=influencesLayout, height=100, numberOfRows=5, allowMultiSelection=True, selectCommand=self.onInfluenceSelected, deleteKeyCommand=self.removePairAction.execute) self.controls.influencesMenu = cmds.popupMenu( parent=self.controls.influencesList) self.addPairAction.newMenuItem("Add manual association...") self.removePairAction.newMenuItem("Remove manual association...") cmds.setParent(group)
def createUI(self, tab, parent): LayerEvents.currentLayerChanged.addHandler(self.update, parent) LayerEvents.layerListUpdated.addHandler(self.update, parent) MayaEvents.undoRedoExecuted.addHandler(self.update, parent) group = tab.createUIGroup(parent, "Layer Properties") cmds.setParent(group) cmds.rowLayout(parent=group, nc=2, adjustableColumn=2, columnWidth2=[Constants.MARGIN_COLUMN2, 50], columnAttach2=["both", "left"], columnAlign2=["right", "left"]) TextLabel('Layer name:') self.controls.layerName = TextEdit() self.controls.layerName.changeCommand.addHandler(self.layerNameChanged) cmds.rowLayout(parent=group, adjustableColumn=3, nc=3, columnWidth3=[Constants.MARGIN_COLUMN2, 50, 100], columnAttach3=["both", "left", "both"], columnAlign3=["right", "left", "center"]) TextLabel('Opacity:') self.controls.layerOpacity = FloatField( None, minValue=0.0, maxValue=1.0, step=0.1, defaultValue=1.0, annotation="overall intensity of this layer") self.controls.layerOpacity.changeCommand.addHandler( self.layerOpacityChanged) self.controls.sliderIntensity = cmds.floatSlider( min=0, max=1, step=0.05, value=1.0, cc=self.layerOpacitySliderChanged, dc=self.layerOpacitySliderChanged, annotation='Drag slider to change layer opacity')
def createUI(self, parent): self.baseLayout = form = FormLayout(parent=parent) t1 = self.controls.label1 = TextLabel('', align=TextLabel.ALIGN_LEFT) t2 = self.controls.label2 = TextLabel('', align=TextLabel.ALIGN_LEFT) t2.setBold() b = self.controls.addLayerDataButton = cmds.button( "Initialize Skinning Layers", command=self.execAttachLayerData) for i in (t1, t2, b): form.attachForm(i, None, Constants.MARGIN_SPACING_HORIZONTAL, None, Constants.MARGIN_SPACING_HORIZONTAL) form.attachForm(t1, Constants.MARGIN_SPACING_VERTICAL, None, None, None) form.attachControl(t2, t1, 0, None, None, None) form.attachControl(b, t2, Constants.MARGIN_SPACING_VERTICAL, None, None, None) LayerEvents.layerAvailabilityChanged.addHandler(self.update, parent) MayaEvents.nodeSelectionChanged.addHandler(self.update, parent) MayaEvents.undoRedoExecuted.addHandler(self.update, parent)
def createUI(self,parent): self.data = LayerDataModel.getInstance() self.baseLayout = form = FormLayout(parent=parent) t1 = self.controls.label1 = TextLabel('',align=TextLabel.ALIGN_LEFT) t2 = self.controls.label2 = TextLabel('',align=TextLabel.ALIGN_LEFT) t2.setBold() b = self.controls.addLayerDataButton = cmds.button("Initialize Skinning Layers",command=self.execAttachLayerData) for i in (t1,t2,b): form.attachForm(i,None,Constants.MARGIN_SPACING_HORIZONTAL,None,Constants.MARGIN_SPACING_HORIZONTAL) form.attachForm(t1,Constants.MARGIN_SPACING_VERTICAL,None,None,None) form.attachControl(t2,t1,0,None,None,None) form.attachControl(b,t2,Constants.MARGIN_SPACING_VERTICAL,None,None,None) self.controls.nonCommercialBanner = t = cmds.text(label="non-commercial use license",backgroundColor=(1.0, 204/255.0, 0),height=20,font='smallObliqueLabelFont') form.attachForm(t,None,Constants.MARGIN_SPACING_HORIZONTAL,None,Constants.MARGIN_SPACING_HORIZONTAL) form.attachControl(t,b,10,None,None,None) license.status.changed.addHandler(self.update, parent) LayerEvents.layerAvailabilityChanged.addHandler(self.update,parent) MayaEvents.nodeSelectionChanged.addHandler(self.update,parent) MayaEvents.undoRedoExecuted.addHandler(self.update,parent)