The Area http://area.autodesk.com/forum/ The Area en Copyright 2012 2012-05-21T11:55:13+02:00 Maya 2013 and QT Signals with String-Parameters? http://area.autodesk.com/forum/autodesk-maya/python/maya-2013-and-qt-signals-with-string-parameters/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/maya-2013-and-qt-signals-with-string-parameters/page-last/#When:12:00:11Z Hi, everytime I try to connect a Signal to a QT-Element that delivers a string parameter when called, Maya 2013 crashes! Example [code] from PyQt4.QtGui import QLineEdit from PyQt4.QtGui import QWidget from PyQt4.QtGui import QHBoxLayout from PyQt4.QtCore import SIGNAL def testMethod(myText): print myText gui = QWidget() myLayout = QHBoxLayout() test = QLineEdit() myLayout.addWidget(test) gui.setLayout(myLayout) gui.connect(test, SIGNAL('textChanged (const QString&)'), testMethod) gui.show() [/code] i also tried "textEdited (const QString&)" and also with a combobox and "currentIndexChanged(const QString&)"...Maya 2013 crashes instantly as soon as the Signal is sent! "currentIndexChanged(int)" for example on a combobox still works. All those methods work perfectly in Maya 2012. I wasn't able to find anything about Maya 2013 using a different Qt-Version than in 2012. All Signals without parameters still work fine! Am I doing something wrong or is it just a bug? 2012-05-17T12:00:11+02:00 PyMel Import error : Pop from empty list? http://area.autodesk.com/forum/autodesk-maya/python/pymel-import-error--pop-from-empty-list/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/pymel-import-error--pop-from-empty-list/page-last/#When:00:59:35Z Whenever I try to import pymel as pm, or "from pymel.core import *", I get this: [code]import pymel.core as pm # pymel.core : Updating pymel with pre-loaded plugins: OpenEXRLoader, DirectConnect, mayaHIK, ikSpringSolver, Mayatomr, decomposeMatrix, tiffFloatReader, VectorRender, studioImport, mayaCharacterization, rotateHelper, Substance, MayaMuscle, OneClick, fbxmaya, ik2Bsolver, 3DxMaya # # IndexError: file C:Program FilesAutodeskMaya2012Pythonlibsite-packagespymel-1.0.0-py2.6.eggpymelinternalcmdcache.py line 212: pop from empty list # [/code] No Idea what the problem is :/ It's a fresh installation of Maya2012, I've unpacked the latest version of PyMel (1.0.3) to a custom dir, I've tried both maya.env setup and systemVar setups, neither of them work. I know for a fact the the installation should work (it does work on my home computer), but for some reason it's acting up on my work computer. I posted this question on StackOverflow (http://stackoverflow.com/questions/10516849/fixing-pymel-import-error-pop-from-empty-list#comment13607009_10516849) and one of the coders there was able to trace it to [code]pymel.internal.cmdcache.py, line 205: lines = cmds.help( command ).split('n')[/code] But didnt have any clue on how to fix this error. Can you peeps help me out with this? Im at a complete loss here :< 2012-05-16T00:59:35+02:00 How do I assign to a secondary UV map? http://area.autodesk.com/forum/autodesk-maya/python/how-do-i-assign-to-a-secondary-uv-map/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/how-do-i-assign-to-a-secondary-uv-map/page-last/#When:20:19:22Z I have a script that is able to calculate UV data that I want to store in a model on a secondary UV map. As far as I can tell, the Maya API currently has a bug in it so that any attempt to set UV data on anything except the primary UV map fails silently (using MFnMesh.assignUV(), MFnMesh.assignUVs()). I'm using Maya 2012. Is there a way to set data on a secondary UV map? 2012-05-15T20:19:22+02:00 addPolyComponentIdChangedCallback in Maya 2012 http://area.autodesk.com/forum/autodesk-maya/python/addpolycomponentidchangedcallback-in-maya-2012/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/addpolycomponentidchangedcallback-in-maya-2012/page-last/#When:09:45:43Z Heyoo! We're familiarizing ourselves with the maya api and stumbled upon registering custom callbacks. We are using the addPolyComponentIdChangedCallback to catch polygon updates (guessing it is what the callback is for..) like this: [code] def cbFunction(a,b,c): ... # node : MObject MPolyMessage.addPolyComponentIdChangedCallback(node,[True,False,False],3,cbFunction) [/code] This yields this error: [code]// Error: in method 'MPolyMessage_addPolyComponentIdChangedCallback', argument 2 of type 'bool []' # Traceback (most recent call last): # File "<maya console>", line 33, in newNodeCB # TypeError: in method 'MPolyMessage_addPolyComponentIdChangedCallback', argument 2 of type 'bool []' // // Warning: Failed to call script callback //[/code] We've tried using ctypes instead of a standard array, but we still get the same error. Also, according to the python docs, the function only needs three arguments: node, wantIdModifications and callback function. Using it this way generates the following error: [code]// Error: MPolyMessage_addPolyComponentIdChangedCallback() takes at least 4 arguments (3 given) # Traceback (most recent call last): # File "<maya console>", line 33, in newNodeCB # TypeError: MPolyMessage_addPolyComponentIdChangedCallback() takes at least 4 arguments (3 given) // // Warning: Failed to call script callback // [/code] We're using Autodesk Maya 2012, any help would be much appreciated! 2012-05-15T09:45:43+02:00 Create cluster out of soft selection? http://area.autodesk.com/forum/autodesk-maya/python/create-cluster-out-of-soft-selection/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/create-cluster-out-of-soft-selection/page-last/#When:02:54:18Z Hi, Can anyone tell me how I can create cluster out of soft selection?. Maybe this is more API question but if any one can tell me what I need to do( or what command or method I need to use)it will be greatly appreciated. Thank you, Arthur. 2012-05-02T02:54:18+02:00 Batch Transform limitation python problem http://area.autodesk.com/forum/autodesk-maya/python/batch-transform-limitation-python-problem/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/batch-transform-limitation-python-problem/page-last/#When:06:08:53Z I have no idea what i have done wrong, I think it may just be global variable problems, however when was working on this today, i brought it home to my pc at home, and it doesn't work what so ever, I'm working on 2012 at work, and 2011 at home, however that shouldn't make a difference right? I'm not the best at python so excuse my lame coding!!! If someone could help me out that would be amazing! I'm utilizing qtDesigner that comes with 2011+, as the UI, it's pretty awesome actually, but if someone could take a look at my code that would be amazing!!! Just copy both files to your script directory and load the limitTranslation.py into the script editor :) Kind regards, EDIT: https://www.dropbox.com/s/j5vfpee1sjfs7up/limitTranslation.py https://www.dropbox.com/s/s48a0hxc2rlagry/LimitTranslation.ui Shannon 2012-05-01T06:08:53+02:00 Removing an influence from a skinCluster? http://area.autodesk.com/forum/autodesk-maya/python/removing-an-influence-from-a-skincluster/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/removing-an-influence-from-a-skincluster/page-last/#When:07:29:13Z Hi, I’m struggling with removing an influence from a skinCluster using Python. In .mel I can use this: [b]skinCluster -e -ri LeftToe skinCluster1;[/b] When I try this in python: [b]cmds.skinCluster ( 'skinCluster1' , 'LeftToe' , ri = 'True' )[/b] I get the following error: [b]# Error: RuntimeError: Cannot use the add/remove influence flags when creating a skinCluster. # [/b] Any suggestions on what I’m doing wrong? Much Thanks! PS. in the .mel : [b] skinCluster -e -ri LeftToe skinCluster1;[/b] were is [b]–e[/b] documented? I’m assuming it’s a command class type thing, but how do I find what it means? 2012-04-28T07:29:13+02:00 Export animation clip? http://area.autodesk.com/forum/autodesk-maya/python/export-animation-clip/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/export-animation-clip/page-last/#When:13:21:18Z how to export a animation clip file from visor into MAYA ASCII with the python code Thank you, wigi 2012-04-12T13:21:18+02:00 Lighting asset versioning (shading groups and render layers)? http://area.autodesk.com/forum/autodesk-maya/python/lighting-asset-versioning-shading-groups-and-render-layers/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/lighting-asset-versioning-shading-groups-and-render-layers/page-last/#When:13:13:08Z I have some questions regarding the shading department versionning process. When the scene comes out of the animation department, i have a cached version of every animated asset in the scene. It's an alembic cache. A lighting/shading artist gets a scene with all the model versions of all the assets of the scene. I can connect my alembic file to the corresponding asset and the animation is updated. So for animation, things seem to work smoothly. Now for the shading: if the artist would have a "lighting asset", i.e. a maya scene with all the shading groups and render layers for this particular asset, all i would have to do is create references for all these lighting assets in my lighting scene, connect the animation to them, and if i have to update animation or the lighting asset, everything would work fine (with some workarounds of course, but it would work) Now the problem gets tougher if I want to preserve how people work in my studio. The shading/lighting artist generally shades directly in the post-animation scene, and switches references to apply the same shading in different scenes. So I would like to be able to publish a lighting asset directly from a lighting scene. Seems easy, but for a particular asset I have to find all render layers and shading groups connected to that asset and export them along. For the moment, I manage getting the render layers and the shading groups from the main render layer, but not the shading groups for all render layers, so I can't manage to export everything. Any ideas, suggestions are welcome 2012-04-10T13:13:08+02:00 Python exporter messed UVS http://area.autodesk.com/forum/autodesk-maya/python/python-exporter-messed-uvs/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/python-exporter-messed-uvs/page-last/#When:05:18:29Z hi everyone, im out of any idea, it seems the polyedituv is quite buggy or the entire python module is. i wrote an exporter for my LSD webgl ([color=blue]http://ditus00.blogspot.com/[/color] you can find here related information about the progess) engine in python. but maybe im doing something wrong, or the pyhton maya modul. for any reason, the uvs gets wrong exported?! thanx for any tips. here is the python exporter class i wrote: [code]class export(): def __init__(self,classes): self.classes = classes self.selection = cmds.ls( selection=True ) print "export Modul loaded..." def getTRIS(self,*args): #OPEN WEB DIRECT format (dirk hochegger 2012) #includes # - vert pos # - uvs # - soon normalen # - soon vert animation # - soon bone kinematic # - soon sound fc = cmds.polyEvaluate( f=True ) path = "C:/homepage/LSD/source/models/" # path = "C:/" ext = ".owd" file = path+"modell"+ext entirePATH = file face = {} uv = {} normale = {} for i in range(fc): pnt = str(self.selection[0]+".f["+str(i)+"]") cmds.select(pnt) vertsID = cmds.polyInfo( fv=True )[0] vert0 = int(vertsID[16:21]) vert1 = int(vertsID[22:26]) vert2 = int(vertsID[27:40]) pos = cmds.xform(q = True, a = True, ws = True, t = True) pos0 = str(pos[0])[0:6],str(pos[1])[0:6],str(pos[2])[0:6] pos1 = str(pos[3])[0:6],str(pos[4])[0:6],str(pos[5])[0:6] pos2 = str(pos[6])[0:6],str(pos[7])[0:6],str(pos[8])[0:6] uvPNT0 = str(self.selection[0]+".map["+str(vert0)+"]") cmds.select(uvPNT0) tmpU0 = cmds.polyEditUV(r = False,u = True, query=True ) tmpV0 = cmds.polyEditUV(r = False,v = True, query=True ) uvPOS0 = tmpU0,tmpV0 uvPNT1 = str(self.selection[0]+".map["+str(vert1)+"]") cmds.select(uvPNT1) tmpU1 = cmds.polyEditUV(r = False,u = True, query=True ) tmpV1 = cmds.polyEditUV(r = False,v = True, query=True ) uvPOS1 = tmpU1,tmpV1 uvPNT2 = str(self.selection[0]+".map["+str(vert2)+"]") cmds.select(uvPNT2) tmpU2 = cmds.polyEditUV(r = False,u = True, query=True ) tmpV2 = cmds.polyEditUV(r = False,v = True, query=True ) uvPOS2 = tmpU2,tmpV2 face[i] = pos0,pos1,pos2 uv[i] = uvPOS0,uvPOS1,uvPOS2 f = open(entirePATH,'w') for i in range(len(face)): vert0 = face[i][0] vert0_x = vert0[0] vert0_y = vert0[1] vert0_z = vert0[2] vert1 = face[i][1] vert1_x = vert1[0] vert1_y = vert1[1] vert1_z = vert1[2] vert2 = face[i][2] vert2_x = vert2[0] vert2_y = vert2[1] vert2_z = vert2[2] uv0 = uv[i][0][0] uv1 = uv[i][1][0] uv2 = uv[i][2][0] vertSTR = str("<<VERTS>>"+str(vert0_x)+"|"+str(vert0_y)+"|"+str(vert0_z)+"||"+ str(vert1_x)+"|"+str(vert1_y)+"|"+str(vert1_z)+"||"+ str(vert2_x)+"|"+str(vert2_y)+"|"+str(vert2_z)) uvSTR = str("<<UVS>>"+str(uv0[0])+"|"+str(uv0[1])+"||"+ str(uv1[0])+"|"+str(uv1[1])+"||"+ str(uv2[0])+"|"+str(uv2[1])) f.write(str(vertSTR)) f.write(str(uvSTR)) f.close() def export(self): pass[/code] here is the entire toolset: http://www.aries-lenov.com/projekte/webgl/dev/LSD/toolsets/tentacleTOOLS.py greetz ditus 2012-04-09T05:18:29+02:00