maya

Object match error when running a Python script from command line Maya

无人久伴 提交于 2019-12-11 08:53:01
问题 I have this script in Python which I'm running into a maya file from a command line: import maya.standalone maya.standalone.initialize("Python") import maya.cmds as cmds from maya import cmds import maya.mel as mel import glob def importFile(i): cmds.file(i, i=True, groupReference=True, groupName="myobj") def materialFile(): if cmds.objExists('Panel*'): cmds.select("Panel*", replace=True) myMaterial = "BlueGlass" cmds.sets( e=True, forceElement= myMaterial + 'SG' ) if cmds.objExists('Body*'):

Issues importing animated models from Maya to Blender and then to three.js?

≡放荡痞女 提交于 2019-12-11 08:11:07
问题 I have a simply question and hopefully someone can answer this. I need to get an animated model into three.js from Maya. I know currently the only exporter/ converter to the three.js JSON format that supports animations is the blender plugin. Unfortunately, my company works with Maya and Blender doesn't take FBXs. I already figured out that in order to do what I need to do, I need to export out of maya a Collada, import the Collada into Blender, then export out to three.js using the plugin.

extracting only texture filenames being used in maya file from the list of filename paths

半世苍凉 提交于 2019-12-11 07:32:18
问题 I have got the following code for listing the texture files being used in my Maya file. When I run the code I get a list of texture files with their paths. But I just need a list of filenames and I'm trying to extract them but not getting the list as I expect. import maya.cmds as cmds # Gets all 'file' nodes in maya fileList = cmds.ls(type='file') texture_filename_list = [] # For each file node.. for f in fileList: # Get the name of the image attached to it texture_filename = cmds.getAttr(f +

How do I execute Maya script without lauching Maya?

家住魔仙堡 提交于 2019-12-11 05:59:28
问题 For example, I want to launch a script that creates a poly cube, export it to .stl or .fbx from the command line. I can do it in Python by using the Maya standalone but it cannot handle exporting to other formats than .ma apparently 回答1: Why of course you can. Here's how you'd do exactly that (for FBX): from os.path import join from maya.standalone import initialize import maya.cmds as cmds import maya.mel as mel initialize("python") cmds.loadPlugin("fbxmaya") my_cube = cmds.polyCube() cmds

pyqt : resize qdockwidget in maya

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 05:58:31
问题 I've made a tool for Maya. And I used QDockWidget within QMainWindow for entire UI composition. As you and I know, I can "saveState" and "restoreState" to retain QToolBar, QDockWidget, and so on. I don't know the reason, but in Maya I can't "restoreState" the actual state. It can restore all of the state for QToolBar, QDockWidget except the size of QDockWidget. So I want to try to resize QDockWidget programmatically. Is there any way to do that? 回答1: Try reimplementing the sizeHint for the

“Module use of python34.dll conflicts with this version of Python”

做~自己de王妃 提交于 2019-12-11 02:05:10
问题 My knowledge of Python is still pretty basic, and I am only now trying to wrap my head around how to use / call libraries from within Maya. (Because I need to create a basic UI from QT Designer and have it be opened in Maya after converting it to a .py file) After I learned to properly convert a .ui to a .py, I now get this error in Maya "Module use of python34.dll conflicts with this version of Python" I tried following what was said here and here, but even then - after setting these

Proper PySide QThread use in Maya to avoid hard crash

不羁的心 提交于 2019-12-10 18:45:21
问题 I'm attempting to use QThreads to update my custom tool's Qt-based UI inside of Maya. I have a thread that executes arbitrary methods and returns the result via an emitted signal, which I then use to update my UI. Here's my custom QThread class: from PySide import QtCore class Thread(QtCore.QThread): result = QtCore.Signal(object) def __init__(self, parent, method, **kwargs): super(Thread, self).__init__(parent) self.parent = parent self.method = method self.kwargs = kwargs def run(self):

Maya Python - Embed zip file into maya file?

和自甴很熟 提交于 2019-12-10 11:57:55
问题 This was a suggestion from another stack thread that I'm finally getting back to. It was part of a discussion about how to embed tools into a maya file. You can write the whole thing as a python package, zip it, then stuff the binary contents of the zip file into a fileInfo. When you need to code, look for it in the user's $MAYA_APP_DIR; if there's no zip, write the contents of the fileInfo to disk as a zip and then insert the zip into sys.path Source discussions were: python copy scripts

Replace text in textField with object name - Pymel

霸气de小男生 提交于 2019-12-10 11:48:52
问题 I've realized that there were similar questions located here: textfield query and prefix replacing and here: Python - Change the textField after browsing - MAYA However, these do not address the issue if you have two definitions and need the text in the textField to be queried (actually CHANGE the text in the textField). I know from experience that doing what I have below in MelScript actually works, but for the sake of Python, and learning how to do it in Python, it seems to not work. Am I

importing multiple cache files in Maya using Python

我们两清 提交于 2019-12-10 11:46:38
问题 I am trying to write a script for importing multiple cache files for a model in Maya using Python. So far I have got the following: import maya.cmds as cmds cache_files_path = 'D:/Project/sfin/work/data/ram/geo' latest_look_file = 'D:/Project/chars/ram/look/maya/ram_clean_look_v002_t005.mb' # open the latest look file cmds.file(latest_look_file, f = True, op = "v=0;", typ = 'mayaBinary', o = True) cmds.select(all = True) Now I need to start importing existing geometry cache from the 'cache