本文整理汇总了Python中ngSkinTools.ui.layerDataModel.LayerDataModel类的典型用法代码示例。如果您正苦于以下问题:Python LayerDataModel类的具体用法?Python LayerDataModel怎么用?Python LayerDataModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LayerDataModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: refreshSettingsFromSelection
def refreshSettingsFromSelection(self):
layersAvailable = LayerDataModel.getInstance().getLayersAvailable()
currentLimit = 0 if not layersAvailable else LayerDataModel.getInstance().mll.getInfluenceLimitPerVertex()
self.controls.numMaxInfluences.setValue(max(1,currentLimit))
self.controls.useInfluenceLimit.setValue(currentLimit!=0)
self.updateUIEnabled()
示例2: applyCurrentSkinSettings
def applyCurrentSkinSettings(self):
limit = 0 if not self.controls.useInfluenceLimit.isChecked() else self.controls.numMaxInfluences.getModelValue()
LayerDataModel.getInstance().mll.setInfluenceLimitPerVertex(limit)
pruneFilter = 0.00 if not self.controls.usePruneFilter.isChecked() else self.controls.pruneFilterValue.getModelValue()
LayerDataModel.getInstance().mll.setPruneWeightsFilter(threshold=pruneFilter)
self.updateUIEnabled()
示例3: execute
def execute(self):
influencesMapping = MllInterface.influencesMapToList(self.mapper.mapping)
mirrorAxis = TransferWeightsTab.axisValues[self.mapper.distanceMatchRule.mirrorAxis]
cmds.ngSkinLayer(initMirrorData=True, influencesMapping=influencesMapping, mirrorAxis=mirrorAxis)
LayerDataModel.getInstance().mll.setManualMirrorInfluences(self.mapper.manualOverrides)
LayerDataModel.getInstance().updateMirrorCacheStatus()
示例4: updatePreferedValues
def updatePreferedValues(self):
if self.mirrorMode:
preferedMirrorAxis = LayerDataModel.getInstance().mirrorCache.mirrorAxis
if preferedMirrorAxis is None:
preferedMirrorAxis = 'X'
self.controls.mirrorAxis.setValue(TransferWeightsTab.axisValues.index(preferedMirrorAxis.upper()))
if self.mirrorMode and LayerDataModel.getInstance().layerDataAvailable:
self.manualOverrides = LayerDataModel.getInstance().mll.getManualMirrorInfluences()
else:
self.manualOverrides = {}
示例5: initialize
def initialize(self):
log.debug("creating headless data host")
LayerDataModel.reset()
restartEvents()
Utils.loadPlugin()
MayaEvents.registerScriptJobs()
LayerDataModel.getInstance()
示例6: internalEditLabelCommand
def internalEditLabelCommand(self, item, newName):
'''
implements layer in-place rename
'''
# do not allow empty layer names
if newName.strip()=='':
return ''
LayerDataModel.getInstance().setLayerName(int(item),newName)
cmds.treeView(self.control,e=True,displayLabel=(item,newName))
return item
示例7: refreshSettingsFromSelection
def refreshSettingsFromSelection(self):
layersAvailable = LayerDataModel.getInstance().getLayersAvailable()
currentLimit = 0 if not layersAvailable else LayerDataModel.getInstance().mll.getInfluenceLimitPerVertex()
self.controls.numMaxInfluences.setValue(max(3,currentLimit))
self.controls.useInfluenceLimit.setValue(currentLimit!=0)
pruneFilterValue = 0 if not layersAvailable else LayerDataModel.getInstance().mll.getPruneWeightsFilter()
self.controls.pruneFilterValue.setValue(max(0.01,min(1,pruneFilterValue)))
self.controls.usePruneFilter.setValue(pruneFilterValue!=0)
self.updateUIEnabled()
示例8: buildInfluenceMappingEngine
def buildInfluenceMappingEngine(self,controls):
'''
builds influence transfer mapping, using parameters from UI
'''
mapping = TransferDataModel.buildInfluenceMappingEngine(self,controls)
mapping.sourceInfluences = LayerDataModel.getInstance().mll.listInfluenceInfo();
mapping.mirrorMode = True
mapping.manualOverrides = LayerDataModel.getInstance().mll.getManualMirrorInfluences()
return mapping
示例9: execute
def execute(self):
defaultLayerName = "New Layer"
dlg = LayerPropertiesDialog(newLayerMode=True)
dlg.layerNameValue.set("")
if dlg.execute()!=dlg.BUTTON_OK:
return
newLayerName = dlg.layerNameValue.get()
if newLayerName.strip()=="":
newLayerName = defaultLayerName
LayerDataModel.getInstance().addLayer(newLayerName)
self.onExecuted.emit()
示例10: execCleanNodes
def execCleanNodes(self,*args):
if not LayerUtils.hasCustomNodes():
Utils.confirmDialog(icon='information', title='Info', message='Scene does not contain any custom ngSkinTools nodes.', button=['Ok']);
return
message = 'This command deletes all custom nodes from ngSkinTools plugin. Skin weights will be preserved, but all layer data will be lost. Do you want to continue?'
if Utils.confirmDialog(
icon='warning',
title='Warning',
message=message,
button=['Yes','No'], defaultButton='No')!='Yes':
return
LayerDataModel.getInstance().cleanCustomNodes()
示例11: execInfluenceSelected
def execInfluenceSelected(self,*args):
'''
selection change handler for .influenceDisplay
'''
targetId = self.controls.influenceDisplay.getSelectedID();
if targetId is None:
return
LayerDataModel.getInstance().mll.setCurrentPaintTarget(targetId)
LayerEvents.currentInfluenceChanged.emit()
log.info("selected logical influence {0}".format(targetId))
示例12: initialize
def initialize(self):
log.debug("creating headless data host")
self.scriptJobs = []
LayerDataModel.reset()
restartEvents()
Utils.loadPlugin()
self.registerScriptJob("SelectionChanged", MayaEvents.nodeSelectionChanged.emit)
self.registerScriptJob("Undo", MayaEvents.undoRedoExecuted.emit)
self.registerScriptJob("Redo", MayaEvents.undoRedoExecuted.emit)
self.registerScriptJob("ToolChanged", MayaEvents.toolChanged.emit)
LayerDataModel.getInstance()
示例13: updateLayoutEnabled
def updateLayoutEnabled(self):
'''
updates UI enabled/disabled flag based on layer data availability
'''
enabled = LayerDataModel.getInstance().layerDataAvailable==True
cmds.layout(self.cmdLayout.innerLayout,e=True,enable=enabled)
cmds.layout(self.cmdLayout.buttonForm,e=True,enable=enabled)
示例14: onOpacitySliderChange
def onOpacitySliderChange(self):
'''
emits when opacity slider in the dialog changes value
'''
currLayer = LayerDataModel.getInstance().getCurrentLayer()
if currLayer is not None:
cmds.ngSkinLayer(e=True,id=currLayer,opacity=self.dlg.layerOpacityValue.get())
示例15: execPruneWeights
def execPruneWeights(self):
ldm = LayerDataModel.getInstance()
for layerId in ldm.layerListsUI.getSelectedLayers():
if self.controls.pruneWeights.getValue():
ldm.mll.pruneWeights(layerId=layerId,threshold=self.controls.pruneWeightsThreshold.getValue())
if self.controls.pruneMask.getValue():
ldm.mll.pruneMask(layerId=layerId,threshold=self.controls.pruneMaskThreshold.getValue())