The Area http://area.autodesk.com/forum/ The Area en Copyright 2013 2013-05-26T11:21:05+02:00 Python Bug in Maya 2013, "scriptTable" Command http://area.autodesk.com/forum/autodesk-maya/python/python-bug-in-maya-2013-scripttable-command/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/python-bug-in-maya-2013-scripttable-command/page-last/#When:14:56:47Z Hi there, I would like to report a bug. Our artists would like to migrate to Maya 2013 (from 2010) and we've run into a bug with our engine's Python exporter script. Have not tested on 2014, just on 2013 with Service Pack 2 installed. The short of it is the Python version of command "scriptTable" seems to have picked up a syntax error somewhere between Maya 2010 and 2013, when using the "getCellCmd" and "cellChangedCmd" script parameters. Both take a reference to a function to query for the contents of a cell. When "scriptTable" calls these functions, it is no longer using proper syntax. I wouldn't be surprised if other script parameters in scriptTable have this issue too, but these are the only two we are using and have tested. This line from our exporter script... [color=green]cmds.scriptTable( "animationSets", rows=1, columns=3, label=[(1, "Name"), (2, "Start Frame"), (3, "End Frame")], enable=False, width=400, height=500, columnWidth=[(1,180),(2,70),(3,70)], getCellCmd="getCellMel", cellChangedCmd="cellChangedMel" )[/color] generates this error in 2013 with Echo all Commands on... [color=red]getCellMel 1 1 # Error: SyntaxError: invalid syntax # getCellMel 1 2 # Error: SyntaxError: invalid syntax # getCellMel 1 3 # Error: SyntaxError: invalid syntax # [/color] Basically "scriptTable" is omitting the required brackets and comma. It should be calling getCellMel like... [color=green]getCellMel(1,2)[/color] Our exporter script has functioned perfectly since at least Maya 8.5 and every version in between till 2010. Couldn't tell you if this error developed in 2011,2012 or 2013, but we will have to stick to 2010 till its resolved (unless its fixed in 2014). I've made a short script for testing. Copy the following into the python script editor and execute and you'll see that it pops up a window without error in 2010 or earlier and generates the above errors in red in 2013 (but also creates a window, just without text in the fields). [color=green]import maya.cmds as cmds import maya.mel as mel mel.eval( 'global proc string getCellMel( int $row, int $column ) { return python( "cmds.workspace( query=True, rootDirectory=True )"); }' ) window = cmds.window( "UITest1", title="cvxporter", widthHeight=(417, 470) ) cmds.columnLayout( adjustableColumn=True, columnOffset=("both", 4) ) cmds.scriptTable( "animationSets", rows=1, columns=3, label=[(1, "Name"), (2, "Start Frame"), (3, "End Frame")], enable=False, width=400, height=500, columnWidth=[(1,180),(2,70),(3,70)], getCellCmd="getCellMel", cellChangedCmd="cellChangedMel" ) cmds.showWindow( "UITest1" )[/color] Thank you for your time. 2013-05-24T14:56:47+02:00 Perforce build for Maya's 2.7.3? http://area.autodesk.com/forum/autodesk-maya/python/perforce-build-for-mayas-273/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/perforce-build-for-mayas-273/page-last/#When:15:12:26Z Anybody have a build of P4.py, P4API.pyd that imports into Maya 2014? 2013-05-17T15:12:26+02:00 ImportError in Maya 2012 with PyQt http://area.autodesk.com/forum/autodesk-maya/python/importerror-in-maya-2012-with-pyqt/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/importerror-in-maya-2012-with-pyqt/page-last/#When:08:04:46Z Hi, well I'm trying to use PyQt4 with maya 2012, some days ago i was working fine with it, but then i had to re-install maya2012, and then i reinstall PyQt and i started to have this error when i'm trying to import QtGui: "ImportError: DLL load failed: The specified module could not be found" and "ImportError: DLL load failed: 1% is not valid win32 application". I'm working with Maya2012 x64, PyQt 4.9.1 x64 in Windows7 64bits. Also i checked the DLLs they are runing in CPU x86. 2013-05-16T08:04:46+02:00 Rendering MR with Python? http://area.autodesk.com/forum/autodesk-maya/python/rendering-mr-with-python/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/rendering-mr-with-python/page-last/#When:17:16:23Z Hi Folks, I'm trying to setup a tool that renders out thumbnails of meshes with different cameras. Things are going along nicely but I can't figure out a very important python command. How can I render a single frame with Mental Ray through a Python command? I need to be able to specify the name of the image to be outputted as well as the camera that will do the rendering. cmds.render seems to only do software cmds.Mayatomr I can't figure out how to start the render with this one So is there a command like cmds.RenderWithMentalRay(camera = 'MyCam', file = 'C:/Stuff/Myfile.png, format = '.png') That's what I desire. Thank you very much!! -B 2013-05-14T17:16:23+02:00 Assembled strings in maya.mel.eval() http://area.autodesk.com/forum/autodesk-maya/python/assembled-strings-in-mayameleval4041/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/assembled-strings-in-mayameleval4041/page-last/#When:23:16:54Z Sorry if this is a nooby question, I'm sure I've just mislaid some quotation-mark or somethng [code] import maya.mel mayaProj ="M:/Geneva2013/3D" quotation ='"' prjAss1 = "'setProject(" prjAss2 = ")'" prjAss0 = prjAss1 +quotation+ mayaProj + quotation + prjAss2 print("Setting project to:") print(prjAss0) maya.mel.eval(prjAss0) [/code] The varaible prjAss0 prints like it should, but the maya.mel.eval(prjAss0) command returns both syntax and runtime error :( any idea whats the matter? 2013-05-13T23:16:54+02:00 How to lock a single animation Key http://area.autodesk.com/forum/autodesk-maya/python/how-to-lock-a-single-animation-key/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/how-to-lock-a-single-animation-key/page-last/#When:01:23:35Z Hello. I know that I can lock an animation layer, or a tangent weight of a specific key. But is there a way to lock a key ? I really need to have a "readonly" behaviour into a specific range of my animations. I have several shots into one maya scene, and often a shot is validated but not all of them, so I need to freeze a slice of the animation curves. Thanks for your help 2013-05-13T01:23:35+02:00 Maya hangs after script fails to execute during playback http://area.autodesk.com/forum/autodesk-maya/python/maya-hangs-after-script-fails-to-execute-during-playback/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/maya-hangs-after-script-fails-to-execute-during-playback/page-last/#When:07:25:10Z Project on GitHub: [url=https://github.com/germantownstudios/AirSketch-Maya]https://github.com/germantownstudios/AirSketch-Maya[/url] Some tests on Vimeo: [url=https://vimeo.com/album/2300835]https://vimeo.com/album/2300835[/url] Continuing work on my project to use a mobile device's motion to draw 3D strokes within Maya. It's basically working, but I have a little glitch that is causing Maya to crash. The iPhone app basically calls (over the network after a socket has been opened) functions I've defined in a host-side python script. First, it creates a locator and attaches the device motion output to it, essentially moving it around the screen. Next, pressing the record button causes playback to start with recording enabled. The user moves the device and this records the motion as keyframes. I've capped it at 100 frames. Finally, when the user releases the button, it stops playback, converts the keyframes into a motion trail, converts that into a curve, then finally attaches a paint effects stroke to it. Now, this last step is where the crash sometimes occurs. If the script to stop playback and initiate the curve fails to execute, the timeline plays to the end. Anything I do after that point causes Maya to crash, even opening a new scene. What am I missing here? Is that script causing a resource conflict under the surface? How do I begin to troubleshoot something like this? Is there a way to just wait until playback ends to call the script each time, rather than trying to interrupt it (which is not reliably working)? Thanks in advance for your help. 2013-05-01T07:25:10+02:00 PyQt for Maya 2012 also works with Maya 2013? (Windows 7 x64) http://area.autodesk.com/forum/autodesk-maya/python/pyqt-for-maya-2012-also-works-with-maya-2013-windows-7-x64/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/pyqt-for-maya-2012-also-works-with-maya-2013-windows-7-x64/page-last/#When:12:41:33Z I would like to use PyQt with my Maya Python scripts. I have an install that's built for Maya 2012 Windows 7 x64. It still works with Maya 2013. However I've only tested with simply UI scripts. Does anyone know what Qt features are likely to crash using this older version of PyQt? I prefer Maya 2012 PyQt package because its more standard and I can locate it under main: C:Python26Libsite-packages Thanks Suzanne (peanuts77) 2013-04-30T12:41:33+02:00 Maya -batch -file someMayaFile.mb -command "file -save" - but for python 2.7? http://area.autodesk.com/forum/autodesk-maya/python/maya--batch--file-somemayafilemb--command-file--save---but-for-python-27/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/maya--batch--file-somemayafilemb--command-file--save---but-for-python-27/page-last/#When:00:54:57Z Hi, Im tinkering around with the idea of making a StartMaya.py script, so that i can start maya from the command prompt, i was thinking of something like [code] import subprocess subprocess.call(['C:\programfiles\Autodesk\maya2013\bin\Maya.exe', 'C:\someMayaFile.mb']) [/code] But i would also´like to pass out a mel or python (preferably python)command at startup, based on sys.argv. can this be done? I know I can do this with batchscript like : [code]maya -batch -file someMayaFile.mb -command "superscript.mel;file -save"[/code] But is there a clean python-only way of doing that? 2013-04-24T00:54:57+02:00 Pymel error http://area.autodesk.com/forum/autodesk-maya/python/pymel-error/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/pymel-error/page-last/#When:20:22:13Z Hi there, We were trying to import pymel, but it failed. I installed python2.6 and pointed my PYTHONPATH to python2.6 then it works. However we are trying avoiding to use python2.6 for now, and in the pymel description, it says it does support python2.5. So can you give us some help for how to set up our environment variables? Thanks ############################# Our installsion ################## OS: Centos5.4_64bit Maya Version: 2012 64bit, installed @ /usr/autodesk/maya2012-x64 Python: 2.5 installed @ /usr/lib64/python2.5 pymel: 1.0.3 (which is compatiable /w python2.5 / maya2008 and later ) #######################Errors for loading pymel #################### import pymel.core as pm # Error: _install_loggers() got an unexpected keyword argument 'disable_existing_loggers' # Traceback (most recent call last): # File "<maya console>", line 1, in <module> # File "/usr/autodesk/maya2012-x64/lib/python2.6/site-packages/pymel/core/__init__.py", line 7, in <module> # import pymel.internal.startup as _startup # File "/usr/autodesk/maya2012-x64/lib/python2.6/site-packages/pymel/internal/__init__.py", line 4, in <module> # from plogging import getLogger # File "/usr/autodesk/maya2012-x64/lib/python2.6/site-packages/pymel/internal/plogging.py", line 171, in <module> # pymelLogFileConfig(getLogConfigFile()) # File "/usr/autodesk/maya2012-x64/lib/python2.6/site-packages/pymel/internal/plogging.py", line 131, in pymelLogFileConfig # disable_existing_loggers=0) # TypeError: _install_loggers() got an unexpected keyword argument 'disable_existing_loggers' # ########################## path of logging module ############## import logging print logging.__file__ /usr/lib64/python2.5/logging/__init__.pyc ######################### Env Variables In Maya ############################### PYTHONPATH = /usr/lib64/python2.5:/usr/lib64/python2.5/site-packages:/usr/lib64/python2.5/lib-dynload:/job/BFX/gene/lib/python/pexpect-2.3:/usr/lib64/python2.5/site-packages/wx-2.8-gtk2-unicode:/job/BFX/gene/lib64/python2.5/PyGreSQL-4.0 sys.path = ['/usr/autodesk/maya2012-x64/bin', '/usr/lib64/python2.5', '/usr/lib64/python2.5/site-packages', '/usr/lib64/python2.5/lib-dynload', '/job/BFX/gene/lib/python/pexpect-2.3', '/usr/lib64/python2.5/site-packages/wx-2.8-gtk2-unicode', '/job/BFX/gene/lib64/python2.5/PyGreSQL-4.0', '/usr/autodesk/maya2012-x64/lib/python26.zip', '/usr/autodesk/maya2012-x64/lib/python2.6', '/usr/autodesk/maya2012-x64/lib/python2.6/plat-linux2', '/usr/autodesk/maya2012-x64/lib/python2.6/lib-tk', '/usr/autodesk/maya2012-x64/lib/python2.6/lib-old', '/usr/autodesk/maya2012-x64/lib/python2.6/lib-dynload', '/usr/autodesk/maya2012-x64/lib/python2.6/site-packages', '/usr/autodesk/maya2012-x64/lib/python26.zip/lib-tk'] 2013-04-22T20:22:13+02:00