maya

run maya from python shell

走远了吗. 提交于 2019-12-18 17:21:52
问题 So I have hundreds of maya files that have to be run with one script. So I was thinking why do I even have to bother opening maya, I should be able to do it from python shell (not the python shell in maya, python shell in windows) So the idea is: fileList = ["....my huge list of files...."] for f in fileList: openMaya runMyAwesomeScript I found this: C:\Program Files\Autodesk\Maya201x\bin\mayapy.exe maya.standalone.initialize() And it looks like it loads sth, because I can see my scripts

Sending multiline commands to Maya Through Python Socket

☆樱花仙子☆ 提交于 2019-12-18 12:42:11
问题 I want to know is there a way to send a multiline command to maya through python socket and the Maya's own "commandPort" command? I'm using below code for sending the code to maya("message" value is the command): import socket #HOST = '192.168.1.122' # The remote host HOST = '127.0.0.1' # the local host PORT = 54321 # The same port as used by the server ADDR=(HOST,PORT) def SendCommand(): client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(ADDR) command = 'import maya

Maya Python: cmds.button( ) with UI passing variables and calling a function?

丶灬走出姿态 提交于 2019-12-18 11:19:34
问题 First of all, this seems to be a great place to learn more about programming. I've written a maya python script, where both functions work, I'm having trouble getting the UI button to call the superExtrude() function, though. The first function does the geometric mesh manipulations and the second one should produce the UI for the user inputs: import maya.cmds as cmds def superExtrude(extrScale, extrDist): """Loops through a list of selected meshes and extrudes all of the mesh faces to produce

Maya Python: cmds.button( ) with UI passing variables and calling a function?

坚强是说给别人听的谎言 提交于 2019-12-18 11:19:07
问题 First of all, this seems to be a great place to learn more about programming. I've written a maya python script, where both functions work, I'm having trouble getting the UI button to call the superExtrude() function, though. The first function does the geometric mesh manipulations and the second one should produce the UI for the user inputs: import maya.cmds as cmds def superExtrude(extrScale, extrDist): """Loops through a list of selected meshes and extrudes all of the mesh faces to produce

Rendering Maya animation on Android?

你离开我真会死。 提交于 2019-12-18 04:23:21
问题 I've been able to import 3D models from Maya into OBJ files, which in turn, are read by my Android app. This model can now be displayed and I can apply transformations on them as well, even on high-polygon count objects, which is nice. The next step is to figure out if there's any reasonable way to display animation defined within Maya. I really have no clue how to approach this and my initial research on this essentially came up empty. Has anyone attempted this before? If so, how would this

Convert pyQt UI to python

回眸只為那壹抹淺笑 提交于 2019-12-17 08:16:26
问题 Is there a way to convert a ui formed with qtDesigner to a python version to use without having an extra file? I'm using Maya for this UI, and converting this UI file to a readable python version to implement would be really great! 回答1: You can use pyuic4 command on shell: pyuic4 input.ui -o output.py 回答2: If you are using windows, the PyQt4 folder is not in the path by default, you have to go to it before trying to run it: c:\Python27\Lib\site-packages\PyQt4\something> pyuic4.exe full/path

Maya Python API 2.0 has no MItDag, so how traverse DAG graph?

做~自己de王妃 提交于 2019-12-13 14:42:59
问题 This question is specific to Autodesk Maya. Using Maya 2014, SP 2. (Downloading SP 3 now...) When using Version 1 of Maya Python API, to traverse DAG graph this works: import maya.OpenMaya as OM dagIterator = OM.MItDag( OM.MItDag.kDepthFirst, OM.MFn.kInvalid ) dagNodeFn = OM.MFnDagNode() # Traverse the scene. while( not dagIterator.isDone() ): ... do stuff with current node on iterator ... dagIterator.next() But now I try Version 2 import maya.api.OpenMaya as OM dagIterator = OM.MItDag( OM

Need Help Making Buttons to perform for loops when you input a number

家住魔仙堡 提交于 2019-12-13 08:30:58
问题 I am trying to make a button in Maya using Python that when you type in a number the for loop would loop for that many times. For example, I would put 5 in the box so the for loop would loop 5 times resulting in 50 cubes since it is for i in range (1,10). This is my code: import maya.cmds as cmds import random handle = "cubeUI" if cmds.window(handle, exists=True): print ("deleting old window...\n") cmds.deleteUI(handle) cmds.window(handle, title = "make random cubes") cmds.columnLayout() cmds

Multiple Paths Traversed and Displayed Filed type in Maya Menu with Python

时光总嘲笑我的痴心妄想 提交于 2019-12-13 07:42:16
问题 I'm new here so bare in mind that and I hope my questions are clearly asked for you lot to help me out. I am trying to alter Brent Tylers Dropbox script so that I will be able to list Python under Python, Mel under Mel and so on(eventually plugins and other files too but not for now) Ok so my directory is like so: 1. sf=C:/users/scripts/ a.py + b.mel pf=C:/users/scripts/Python/c.py mf=C:/users/scripts/Mel/d.mel (These are the folders my scripts will be placed in) Code : absoluteFiles = []

Running list of cmd.exe commands from maya in Python

本秂侑毒 提交于 2019-12-13 07:06:42
问题 I am writing a maya python script to batch render a scene into jpgs then use ffmpeg to turn them into a mov. Currently the script saves a string of commands as a bat file which works fine but I'd prefer to just run cmd.exe from maya and execute the list of commands without creating that bat first. I've been reading about "subprocess.popen()" but I can't figure out how to get it to iterate through each line, run that command, then move onto the next one when done ie: 1) Run maya render.exe &