The Area http://area.autodesk.com/forum/ The Area en Copyright 2012 2012-02-10T12:01:48+01:00 PYQT in Maya 2012? http://area.autodesk.com/forum/autodesk-maya/python/pyqt-in-maya-2012/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/pyqt-in-maya-2012/page-last/#When:15:45:35Z I'm trying to create a pyqt ui with buttons in Maya that I can drag and drop onto Maya's shelf. I was hoping to use the drag and drop function of Maya's shelfButton but I get stumped on the fact that I don't know what type of object a shelfButton is to Qt as this isn't something listed in the Qt class/modules. Is it possible to use the shelfButton, if so how? 2012-02-08T15:45:35+01:00 How can we edit .pyc files? http://area.autodesk.com/forum/autodesk-maya/python/how-can-we-edit-pyc-files/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/how-can-we-edit-pyc-files/page-last/#When:11:26:22Z Hi! This is Krishna from India. How can we edit or modify .pyc files..? its not opening in wordpad or not pad.. I installed python apps but i dint get good result.... is there any GUI for these files plz give me one suggetion for open these files... Thq... Krish...... 2012-02-06T11:26:22+01:00 atexit.register() functions not being called from Maya on exit? http://area.autodesk.com/forum/autodesk-maya/python/atexitregister-functions-not-being-called-from-maya-on-exit/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/atexitregister-functions-not-being-called-from-maya-on-exit/page-last/#When:10:26:38Z Does the atexit package work from within Maya? I've tried the straightforward approach: [code]import sendit import atexit atexit.register(sendit.sendit) [/code] where the sendit.sendit() function just sends me an e-mail. I don't get an e-mail from either Maya2011 or 2012. There's a finalize() function registered with atexit in AutodeskMaya20nnPythonlibsite-packagesmayaappstartupbasic.py, so you'd think it would work. However the finalize() method doesn't actually do anything, so no one probably noticed it not working. I've also tried putting my sendit() call in the Maya finalize() method and still no results. Is this just broken or is there some trick to getting it to work? Thanks! --- David 2012-02-06T10:26:38+01:00 Python string callbacks within Maya UI commands? http://area.autodesk.com/forum/autodesk-maya/python/python-string-callbacks-within-maya-ui-commands/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/python-string-callbacks-within-maya-ui-commands/page-last/#When:08:41:33Z I have trouble with assigning a callback function in python to the selectCommand and selectionChangedCommand flags for the treeView UI command. Can someone post a working example of how to achieve this? 2012-02-02T08:41:33+01:00 [solved] Python UI control callbacks? http://area.autodesk.com/forum/autodesk-maya/python/solved-python-ui-control-callbacks/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/solved-python-ui-control-callbacks/page-last/#When:16:04:35Z problem: [code] import maya.cmds as cmds def exampleWindow(): lWindow = cmds.window() cmds.columnLayout() lTextCtrl = cmds.text( label = "click-me" ) cmds.button( command = "exampleFunction( %s )" % lTextCtrl ) cmds.setParent( ".." ) cmds.showWindow( lWindow ) def exampleFunction( lTextCtrl ): cmds.text( lTextCtrl, edit = True, label = "works" ) exampleWindow() [/code] [code]# Error: NameError: file <maya console> line 1: name 'window1' is not defined #[/code] workaround: [code] import maya.cmds as cmds def exampleWindow(): lWindow = cmds.window() cmds.columnLayout() lTextCtrl = cmds.text( label = "click-me" ) mel.eval( "$tmpTextCtrl = "%s"" % lTextCtrl ) cmds.button( command = "exampleFunction( "$tmpTextCtrl" )" ) cmds.setParent( ".." ) cmds.showWindow( lWindow ) def exampleFunction( lVarName ): lTextCtrl = mel.eval( "$tmp = %s" % lVarName ) cmds.text( lTextCtrl, edit = True, label = "full" ) exampleWindow() [/code] basically i am using a mel global variable for editing a control via a python callback. 2012-02-01T16:04:35+01:00 Selecting outer or inner faces of mesh with PyMEL? http://area.autodesk.com/forum/autodesk-maya/python/selecting-outer-or-inner-faces-of-mesh-with-pymel/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/selecting-outer-or-inner-faces-of-mesh-with-pymel/page-last/#When:07:43:30Z Hi all, I'm writing a PyMEL script that generates the Menger Sponge with geometry. The script generates a whole bunch of cubes, combines them, merges the verticies then deletes the lamina faces. After i'm left with inner faces that were at the same positions at the lamina faces. The only way I can think off to get rid of these faces is to either select all the external faces of a mesh and duplicate them to a new mesh or delete all the internal faces. Anyone know how to do either? Thanks, David. 2012-01-23T07:43:30+01:00 Creating custom shaders? http://area.autodesk.com/forum/autodesk-maya/python/creating-custom-shaders/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/creating-custom-shaders/page-last/#When:18:09:25Z Hi, l am very interested in learning more and more about creating shaders , l want to be able to get all sort of data that l need to creat my own custom shader. does python allows me to do so ? 2012-01-17T18:09:25+01:00 Is it possible to hide and restore windows in Maya? http://area.autodesk.com/forum/autodesk-maya/python/is-it-possible-to-hide-and-restore-windows-in-maya/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/is-it-possible-to-hide-and-restore-windows-in-maya/page-last/#When:09:55:13Z Does Maya offer any support for restoring open windows after they have been closed? What I am trying to do is create a "clean" save that does have any open windows, but I do not want to disturb the artist workflow by saving off an entirely different scene and then reverting back to the original (and taking a lot of loading time), or by destroying all their open windows when they click save. I was hoping that setting the windows visible attribute to False and then switching it back to True would give me this result, but Maya destroys the window once it's visibility is set to False. For example, the code below would hopefully just quickly toggle the visibility of the window, but once it is set visible=False it is gone for good. Is there another way to store the current windows that are open in Maya and retrieve that state again? [code] def get_user_windows(): ''' Get the non-builtin windows as a list. ''' all_windows = cmds.lsUI(windows=True) builtin_windows = ["ColorEditor", "CommandWindow", "MayaWindow", "scriptEditorPanel1Window"] return [w for w in all_windows if w not in builtin_windows] user_windows = get_user_windows() for user_window in user_windows: cmds.window(user_window, edit=True, visible=False) # Running this immediately and the window does not turn visible # Running this after an idle cycle and you get runtime error "Object not found" for user_window in user_windows: cmds.window(user_window, edit=True, visible=True)[/code] 2012-01-13T09:55:13+01:00 Get image size? http://area.autodesk.com/forum/autodesk-maya/python/get-image-size/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/get-image-size/page-last/#When:07:53:03Z hi I have a project in python for my school. My question is : How to get a image size in maya For exemple I create a lambert material, I put a externe file (texture). And I want to get the size of my texture for create a plan with a good ratio. 2012-01-13T07:53:03+01:00 Open Socket in Maya using Python? http://area.autodesk.com/forum/autodesk-maya/python/open-socket-in-maya-using-python/page-last/ http://area.autodesk.com/forum/autodesk-maya/python/open-socket-in-maya-using-python/page-last/#When:11:32:38Z Hey, I am trying to open a socket in Maya for sending information out of Maya. I am trying the following code... [code]import socket, sys maya = socket.socket(socket.AF_INET, socket.SOCK_STREAM) maya.connect(("localhost", 5055))[/code] However, I keep getting the following error... [code]error: file <string> line 1: 61 # [/code] I'm not sure what the problem is. I only get the error if I execute the maya.connect line. Can someone please point me in the right direction? Thanks, Wes 2012-01-07T11:32:38+01:00