• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python layerDataModel.LayerDataModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了LayerDataModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:7,代码来源:tabSettings.py


示例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()
开发者ID:leandropim,项目名称:Tapp,代码行数:8,代码来源:tabSettings.py


示例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()
开发者ID:leandropim,项目名称:Tapp,代码行数:9,代码来源:initTransferWindow.py


示例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 = {}
开发者ID:leandropim,项目名称:Tapp,代码行数:11,代码来源:initTransferWindow.py


示例5: initialize

    def initialize(self):
        log.debug("creating headless data host")
        
        LayerDataModel.reset()
        restartEvents()

        Utils.loadPlugin()

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


示例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
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:11,代码来源:layerListsUI.py


示例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()
开发者ID:leandropim,项目名称:Tapp,代码行数:12,代码来源:tabSettings.py


示例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
开发者ID:leandropim,项目名称:Tapp,代码行数:12,代码来源:initTransferWindow.py


示例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()
开发者ID:leandropim,项目名称:Tapp,代码行数:12,代码来源:actions.py


示例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()
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:14,代码来源:mainwindow.py


示例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))
开发者ID:leandropim,项目名称:Tapp,代码行数:14,代码来源:layerListsUI.py


示例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()
开发者ID:jonntd,项目名称:ngSkinTools,代码行数:15,代码来源:headlessDataHost.py


示例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)
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:7,代码来源:initTransferWindow.py


示例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())
开发者ID:leandropim,项目名称:Tapp,代码行数:7,代码来源:actions.py


示例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())
开发者ID:leandropim,项目名称:Tapp,代码行数:7,代码来源:tabAssignWeights.py


示例16: layerDropped

 def layerDropped(self,layers,newParent,itemBefore,itemAfter):
     '''
     final handler of drag-drop action in layers list
     '''
     
     mll = LayerDataModel.getInstance().mll
     
     with mll.batchUpdateContext():
         # first, order layers by index, and start the "drop" with lowest index
         layers = sorted(layers,key=lambda layer:mll.getLayerIndex(layer),reverse=True)
         
         if newParent:
             itemAfter = None
             itemBefore = newParent
 
         for layer in layers:
             # as layers are shifted, indexes change for target layers
             currentIndex = mll.getLayerIndex(layer)
             
             targetIndex = 0
             if itemAfter:
                 targetIndex = mll.getLayerIndex(itemAfter)+1
             elif itemBefore:
                 targetIndex = mll.getLayerIndex(itemBefore)
 
             # fix index when moving up            
             if targetIndex>currentIndex:
                 targetIndex -= 1
                 
             mll.setLayerIndex(layer,targetIndex)
             
             # for subsequent layers, drop after this layer
             itemBefore = layer
             itemAfter = None
开发者ID:leandropim,项目名称:Tapp,代码行数:34,代码来源:layerListsUI.py


示例17: isEnabled

 def isEnabled(self):
     model = LayerDataModel.getInstance()
     if model is None:
         return False
     if not model.mirrorCache.isValid:
         return False
     return BaseLayerAction.isEnabled(self)
开发者ID:leandropim,项目名称:Tapp,代码行数:7,代码来源:actions.py


示例18: updateCacheInfo

 def updateCacheInfo(self):
     '''
     updates UI according to new mirror cache status
     '''
     
     self.controls.labelCacheInfo.setLabel(LayerDataModel.getInstance().mirrorCache.message)
     self.updateInfluenceList()
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:7,代码来源:initTransferWindow.py


示例19: execInitMirrorData

    def execInitMirrorData(self):
        kargs = {};
        kargs["initMirrorData"] = True;
        kargs["influenceAssociationDistance"] = self.controls.influenceDistanceError.getValue()
        kargs["mirrorAxis"] = self.controls.mirrorAxis.getSelectedText()


        # create a comma-delimited prefix string, stripping away any spaces 
        # that might be specified in the user input        
        prefixes = self.controls.influencePrefixes.getValue()
        kargs["influenceAssociationPrefix"] = ",".join([prefix.strip() for prefix in prefixes.split(",")])
        
        cmds.ngSkinLayer(**kargs)
        
        LayerDataModel.getInstance().updateMirrorCacheStatus()

        self.updateInfluenceList()
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:17,代码来源:initTransferWindow.py


示例20: updateUIEnabled

 def updateUIEnabled(self):
     layersAvailable = LayerDataModel.getInstance().getLayersAvailable()
     
     Layout.setEnabled(self.controls.selectedSkinSettingsGroup,layersAvailable)
     if not layersAvailable:
         return
     
     self.controls.influenceLimitRow.setEnabled(self.controls.useInfluenceLimit.getModelValue())
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:8,代码来源:tabSettings.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.Utils类代码示例发布时间:2022-05-27
下一篇:
Python nfvo.check_tenant函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap