当前位置: 首页>>代码示例>>Python>>正文


Python LayerDataModel.getInstance方法代码示例

本文整理汇总了Python中ngSkinTools.ui.layerDataModel.LayerDataModel.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Python LayerDataModel.getInstance方法的具体用法?Python LayerDataModel.getInstance怎么用?Python LayerDataModel.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ngSkinTools.ui.layerDataModel.LayerDataModel的用法示例。


在下文中一共展示了LayerDataModel.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: refreshSettingsFromSelection

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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()
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:9,代码来源:tabSettings.py

示例2: applyCurrentSkinSettings

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
    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()
开发者ID:leandropim,项目名称:Tapp,代码行数:10,代码来源:tabSettings.py

示例3: execute

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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()
开发者ID:leandropim,项目名称:Tapp,代码行数:11,代码来源:initTransferWindow.py

示例4: updatePreferedValues

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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 = {}
开发者ID:leandropim,项目名称:Tapp,代码行数:13,代码来源:initTransferWindow.py

示例5: initialize

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
    def initialize(self):
        log.debug("creating headless data host")
        
        LayerDataModel.reset()
        restartEvents()

        Utils.loadPlugin()

        MayaEvents.registerScriptJobs()
        
        LayerDataModel.getInstance()
开发者ID:leandropim,项目名称:Tapp,代码行数:13,代码来源:headlessDataHost.py

示例6: internalEditLabelCommand

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:13,代码来源:layerListsUI.py

示例7: refreshSettingsFromSelection

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
    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()
开发者ID:leandropim,项目名称:Tapp,代码行数:14,代码来源:tabSettings.py

示例8: buildInfluenceMappingEngine

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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
开发者ID:leandropim,项目名称:Tapp,代码行数:14,代码来源:initTransferWindow.py

示例9: execute

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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()
开发者ID:leandropim,项目名称:Tapp,代码行数:14,代码来源:actions.py

示例10: execCleanNodes

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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()
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:16,代码来源:mainwindow.py

示例11: execInfluenceSelected

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
    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))
开发者ID:leandropim,项目名称:Tapp,代码行数:16,代码来源:layerListsUI.py

示例12: initialize

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
    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()
开发者ID:jonntd,项目名称:ngSkinTools,代码行数:17,代码来源:headlessDataHost.py

示例13: updateLayoutEnabled

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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)
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:9,代码来源:initTransferWindow.py

示例14: onOpacitySliderChange

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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())
开发者ID:leandropim,项目名称:Tapp,代码行数:9,代码来源:actions.py

示例15: execPruneWeights

# 需要导入模块: from ngSkinTools.ui.layerDataModel import LayerDataModel [as 别名]
# 或者: from ngSkinTools.ui.layerDataModel.LayerDataModel import getInstance [as 别名]
 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())
开发者ID:leandropim,项目名称:Tapp,代码行数:9,代码来源:tabAssignWeights.py


注:本文中的ngSkinTools.ui.layerDataModel.LayerDataModel.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。