Just starting with PyQt and trying to figure out what my workflow is going to look like so I figured I’d ask what everbody else does. I downloaded Wing IDE for mayapy and potentially PyMEL. Wing doesn’t have a GUI builder for PyQt which pretty much means that I can’t execute it in Wing but auto-complete works so I was thinking that I would write and save it in Wing and copy + paste it into script editor in maya to test.
Does anyone have a better idea? I’m not really sure how debugging will go in Wing with this workflow which could be problematic.
Share or suggest a better workflow please. Thanks!
Wings can send the command directly to Maya’s python interpreter to execute, as can most IDE’s now.
“You have to point Wing IDE to Maya’s own Python interpreter (it will complain that it can’t find Python installed since Maya maintains it’s own Python interpreter). Just go Project > Properties and set ‘Python Executable path to point to : C:\Program Files\Autodesk\Mayaxxxx\bin\mayapy.exe”
What I’ve been doing, depending on the version of Maya you have, the 2012+ version comes with designer for your Qt. It’s just an xml writer though. Still, it can help get a quick design punched out. Then I use wing to code in, place my scripts within the given location for my project, and -
import yourProject
reload(yourProject)
yourProject.CallyourMainFunction() - Saved to the shelf. When I make a change within either the design file or the code file within Wing, I simply double click the shelf to test changes. Let me know if that helps, should be better than doing a copy/paste for each change though. The designer I think you can download for free btw.
Designer is indeed free to download as part of the Qt downloads from Qt’s site, but a copy of designer also comes with Maya on Windows/Linux. Mac for some reason doesn’t have it bundled.
[QUOTE=dgovil;18169]Wings can send the command directly to Maya’s python interpreter to execute, as can most IDE’s now.
“You have to point Wing IDE to Maya’s own Python interpreter (it will complain that it can’t find Python installed since Maya maintains it’s own Python interpreter). Just go Project > Properties and set ‘Python Executable path to point to : C:\Program Files\Autodesk\Mayaxxxx\bin\mayapy.exe”
I have my executable path set to C:\Program Files\Autodesk\Maya2012\bin\mayapy.exe - maybe I don’t understand how to send code to maya.
[QUOTE=TreyAnesi;18170]What I’ve been doing, depending on the version of Maya you have, the 2012+ version comes with designer for your Qt. It’s just an xml writer though. Still, it can help get a quick design punched out. Then I use wing to code in, place my scripts within the given location for my project, and -
import yourProject
reload(yourProject)
yourProject.CallyourMainFunction() - Saved to the shelf. When I make a change within either the design file or the code file within Wing, I simply double click the shelf to test changes. Let me know if that helps, should be better than doing a copy/paste for each change though. The designer I think you can download for free btw.[/QUOTE]
I really like the designer - looks like it’ll be really quick to punch out a layout and then add in functionality. I’m not sure I fully understand your workflow. Are you saving that code to Maya’s shelf? You’re just referencing a file location that you save to from wing/designer as opposed to copy and pasting each time?
Also, I downloaded the Qt Creator w/Qt Designer in it from Qt’s download site but how do you access the Qt that came with Maya? Just so I know how to access it.
Actually, I should have prefaced by saying I’m an Eclipse/SublimeText2 user so wings specific issues might be better addressed by someone more knowledgeable than me.
That error on the other hand sounds about right. Basically you haven’t constructed the Qt app before you call the buttons draw event, so it errors out. It may work in Maya because QtGui.file points to the right directory for Maya’s environment, but that sounds overly tempermental to rely on.
Also TreyAnesi’s method is nice, since it’s just pointing to the right py file and telling it to recreate the pyc each time.
The bundled Maya designer is located at:
C:\Program Files\Autodesk\Maya<version>\bin\designer.exe
But for example, in Eclipse, I use Ron Bublitz’s system of sending all the commands over a serverPort to maya. He has a full tutorial on the setup on creativeCrash somewhere.
and I haven’t set it up yet, but SublimeText has an implementation of the same thing on the python-for-maya google group
I like writing my pyQt Ui’s from scratch. Designer is kinda cool for poking around and getting familiar with the widgets and their options, but I prefer writing the UI from scratch… heresy, I know…
[QUOTE=dgovil;18176]Actually, I should have prefaced by saying I’m an Eclipse/SublimeText2 user so wings specific issues might be better addressed by someone more knowledgeable than me.
That error on the other hand sounds about right. Basically you haven’t constructed the Qt app before you call the buttons draw event, so it errors out. It may work in Maya because QtGui.file points to the right directory for Maya’s environment, but that sounds overly tempermental to rely on.
Also TreyAnesi’s method is nice, since it’s just pointing to the right py file and telling it to recreate the pyc each time.
The bundled Maya designer is located at:
C:\Program Files\Autodesk\Maya<version>\bin\designer.exe
But for example, in Eclipse, I use Ron Bublitz’s system of sending all the commands over a serverPort to maya. He has a full tutorial on the setup on creativeCrash somewhere.
and I haven’t set it up yet, but SublimeText has an implementation of the same thing on the python-for-maya google group[/QUOTE]
Yeah I actually got started using Nathan’s blog, didn’t scroll down to see the plug about Qt Designer until now
Thanks for the filepath, I found the designer.
I’ll checkout those tutorials and see if it applies to Wing. Thanks.
[QUOTE=rgkovach123;18177]I like writing my pyQt Ui’s from scratch. Designer is kinda cool for poking around and getting familiar with the widgets and their options, but I prefer writing the UI from scratch… heresy, I know…[/QUOTE]
this process gets really hairy when you have a lot of dependencies invloved. You’ll need to reload each one in the correct order. After a certain point, i usually just restart maya.
[QUOTE=TheMaxx;18185]this process gets really hairy when you have a lot of dependencies invloved. You’ll need to reload each one in the correct order. After a certain point, i usually just restart maya.[/QUOTE]
[QUOTE=Erkmuss;18181]Do you just write in the script editor then?[/QUOTE]
I do write them out in Maya’s script editor in the beginning. once i reach critical mass, i’ll switch to wing and use try/reload for fast iteration. But I also liked to write UIs using the old ELF widgets in MEL…
[QUOTE=rgkovach123;18191]I do write them out in Maya’s script editor in the beginning. once i reach critical mass, i’ll switch to wing and use try/reload for fast iteration. But I also liked to write UIs using the old ELF widgets in MEL… :)[/QUOTE]
Why not just write your UI’s in pure python, with regular PyQt/PySide, then just hook them up in Maya when they work as expected? Also much easier to maintain and test.