不知道是不是选择的问题,每次都是一下子全导出去了。

import maya.cmds as cmds

cmds.loadPlugin('AbcExport.mll')

cmds.loadPlugin('AbcImport.mll')

print start,end

from PySide2.QtGui import *

from PySide2.QtCore import *

from PySide2.QtWidgets import *

class ExportABC(QDialog):

def __init__(self):

super(ExportABC, self).__init__()

self.main_layout=QHBoxLayout()

self.path_label=QLabel('Export Path:')

self.path_eidt=QLineEdit()

self.path_btn=QPushButton('...')

self.path_btn.clicked.connect(self._getpath)

self.export_btn=QPushButton('OK')

self.export_btn.clicked.connect(self._export)

self.main_layout.addWidget(self.path_label)

self.main_layout.addWidget(self.path_eidt)

self.main_layout.addWidget(self.path_btn)

self.main_layout.addWidget(self.export_btn)

self.setLayout(self.main_layout)

def _getpath(self):

fileName = QFileDialog.getSaveFileName(None,'输出文件','','Excel files(*.abc , *.abc)')

print(fileName)

self.path_eidt.setText(fileName[0])

def _export(self):

if self.path_eidt.text():

a=cmds.ls(type='surfaceShape')

connect_poly='|'.join(a)

root='root '+connect_poly

print connect_poly

start=str(cmds.playbackOptions(q=True,min=True))

end=str(cmds.playbackOptions(q=True,max=True))

command="-frameRange " + start + " " + end +" -uvWrite -worldSpace -root " + connect_poly + " -file " + self.path_eidt.text()

cmds.AbcExport(j=command)

self.close()

if 'abcWin' in globals():

abcWin.deleteLater()

del abcWin

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐