Re: [Maya-Python] Re: Help w/Var Assignment inside a Class

2011-08-21 Thread Justin Israel
Since you stated you are trying to write the most efficient code using the best coding practices, you absolutely should not use vars() or globals() for this purpose. I really think its poor habit to pass in globals unless they are some kind of constant maybe, or environment setting. Like say,

Re: [Maya-Python] Transfering weights from many to one

2011-09-21 Thread Justin Israel
I cant say I know anything specifically about this process, but from a general api perspective, it seems that specifying multiple source arguments as an array isn't documented in either the MEL or the python api docs. What the docs do say is that it does expect source and destination flags as

Re: [Maya-Python] Face Centroid

2011-09-22 Thread Justin Israel
They didnt include it in the pymel api wrapper, but this would be it I think. import pymel.core as pm import maya.OpenMaya as OpenMaya face = pm.MeshFace(pCube1.f[64]) pt = face.__apimfn__().center(OpenMaya.MSpace.kWorld) centerPoint = pm.datatypes.Point(pt) -- justin On Thu, Sep

Re: [Maya-Python] Re: how to install SIP for python on MAC

2011-10-04 Thread Justin Israel
Most likely what happened is that you sip and qt are not built with the same arch. Can you reply with the results of this? lipo -info /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/sip.so Most likely what you want to do is rebuilt sip, but use these flags: python

Re: [Maya-Python] Re: nub question - passing arguments as functions

2011-10-04 Thread Justin Israel
No Vordok that still would not work. Daves example is the direction he would need to go. In the origin question, the example makes no real association with the item and the item list. Also, if you pass a function as the default arg like that, it will evaluate only once when the func is defined.

Re: [Maya-Python] Re: Which editor do you use?

2011-10-05 Thread Justin Israel
I've never felt a need to have the telnet commands to maya functionality working. I tried it once with low commitment and the script didnt work anymore and I didnt care enough to look onto it. Whether I use eclipse+pydev, or coda, or whatever, I usually just have a small snippet in the maya script

Re: [Maya-Python] Re: how to install SIP for python on MAC

2011-10-06 Thread Justin Israel
Oct 5, 2011,1:57 AM, Justin Israel 写道: Most likely what happened is that you sip and qt are not built with the same arch. Can you reply with the results of this? lipo -info /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/sip.so Most likely what you want to do

Re: [Maya-Python] Re: how to install SIP for python on MAC

2011-10-06 Thread Justin Israel
. For 2012 there are some updated version numbers for qt, sip, pyqt. I should update my blog with that info. On Oct 6, 2011 3:34 PM, Vordok vordok.bolsill...@gmail.com wrote: Why dont you try using the mac ports version? On Oct 6, 11:45 am, Justin Israel justinisr...@gmail.com wrote: Since

[Maya-Python] Announcing: Intro to Python for Maya

2011-10-08 Thread Justin Israel
Hi all, I just wanted to make an announcement that my first online video tutorial was released today through cmiVFX.com Its an Introduction to Python for Maya course, aimed at artists that are new to python. If any of you are just starting out learning the language, check it out! Or maybe you

Re: [Maya-Python] Announcing: Intro to Python for Maya

2011-10-10 Thread Justin Israel
, Panupat Chongstitwattana panup...@gmail.com wrote: Very very interesting. Is there any short preview available? On Sun, Oct 9, 2011 at 3:03 PM, Farsheed Ashouri farsheed.asho...@gmail.com wrote: That's nice, Thanks. On Sunday, October 9, 2011, Justin Israel wrote: Hi all, I just

Re: [Maya-Python] Announcing: Intro to Python for Maya

2011-10-10 Thread Justin Israel
, 2011 at 10:59 AM, Justin Israel justinisr...@gmail.com wrote: It would be nice if cmivfx included small sample clips on each video release, but it seems they do not. I was going to try and throw together a promo video to put on youtube, but it might take a few days. Got any questions

Re: [Maya-Python] Re: Announcing: Intro to Python for Maya

2011-10-12 Thread Justin Israel
!!! On 10月11日, 上午5时13分, Justin Israel justinisr...@gmail.com wrote: There is a pretty good explanation of the parts of the course on the product page: http://cmivfx.com/tutorials/view/320/Python+Introduction+Vol+01+-+Maya But here is the chapter list: - Introduction - Objects

Re: [Maya-Python] What's faster, API(2) or native Python?

2011-10-17 Thread Justin Israel
I dont think its an across the board one way or the other answer. The maya api classes are all wrappers around C++ code, so they should be pretty fast, whereas not every python standard library module is a C extension. You can do case-by-case time tests if you want, but if the maya api provides

Re: [Maya-Python] Re: Announcing: Intro to Python for Maya

2011-10-19 Thread Justin Israel
api first. My feeling is that you should learn the real api first, and then optionally choose to use an abstraction layer later under the right circumstances. Those are my two cents. Thanks again! Martin On Wed, Oct 12, 2011 at 9:18 AM, Justin Israel justinisr...@gmail.comwrote: I

Re: [Maya-Python] Re: Announcing: Intro to Python for Maya

2011-10-19 Thread Justin Israel
! On Wed, Oct 19, 2011 at 12:14 PM, ArrantSquid arrantsq...@gmail.com wrote: Posted on Twitter with Promo code and passed around the office again. :) The promo video definitely could have used another 30 seconds to really get what would come out of it. ;) On Oct 19, 12:17 pm, Justin Israel

Re: [Maya-Python] where to start pymel for a beginner?

2011-10-19 Thread Justin Israel
Are you asking where you can actually USE pymel inside Maya? Or are you asking where you can begin to LEARN pymel? If you are Maya 2011+, you can open script editor and do: import pymel.core as pm Sub maya 2011 you have to install pymel manually. On Wed, Oct 19, 2011 at 3:13 PM, Reza

Re: [Maya-Python] Re: Which editor do you use?

2011-10-26 Thread Justin Israel
Sublime is 'ok'. This same discussion just happened on the golang mailing list. Everyone thinks every editor is the best. Some people are hardcore vim. Some use fancier IDEs like eclipse. I personally felt sublime was lacking. But everyone has an opinion. This thread will go on forever. On

Re: [Maya-Python] Re: Which editor do you use?

2011-10-26 Thread Justin Israel
Emacs is your favorite OS? On Oct 26, 2011, at 6:11 PM, T. D. Smith tagoresm...@gmail.com wrote: Emacs, since it's my favorite OS. Too bad it doesn't have a decent text editor ;). One of these days I am going to have to learn to use the vi emulation for emacs, but... old habits die hard,

Re: [Maya-Python] Re: Which editor do you use?

2011-10-27 Thread Justin Israel
and had to single finger poke at each key. It also makes a beep with each keypress that he finally disabled. Yet its still exceptionally loud with it off. :-) On Oct 27, 2011, at 4:23 PM, T. D. Smith tagoresm...@gmail.com wrote: On Oct 26, 11:01 pm, Justin Israel justinisr...@gmail.com wrote

Re: [Maya-Python] PyQt4 for Maya2012 OSX installer

2011-11-10 Thread Justin Israel
Not a windows user so I can't manage that part, but check out this link: http://blarg.robertkist.com/?p=51 If you want to build one, the script could get committed to the MyQt4 project. I did this since Im a mac user and I had the environment all set up and available to me. If I had a windows set

Re: [Maya-Python] PyQt4 for Maya2012 OSX installer

2011-11-11 Thread Justin Israel
Oh sweet. When I was searching, I didn't find any linux builds. Im going to link to your page and the windows one I found so they are all in one place. Guess someone still needs to build an x64 for windows7. I wonder what the licensing issue would have been for autodesk to have just included

Re: [Maya-Python] Make Selected Curves Dynamic via python or pymel

2011-11-15 Thread Justin Israel
How about this? sel = pm.selected() for eachIteration in sel: pm.select(eachIteration, r=True) pm.mel.eval('MakeCurvesDynamic') pm.select(sel, r=True) Haven't tested because I'm on my phone. On Nov 15, 2011, at 8:07 PM, charles le guen charlesleg...@gmail.com wrote: for eachIteration

Re: [Maya-Python] MPxCommand undoIt()

2011-11-18 Thread Justin Israel
Hey Andre, This quick test seems to work fine for me: http://pastebin.com/t0YM4rmq It successfully prints as it enters each method as expected. Maybe you could compare it to how your code is arranged? -- justin On Nov 18, 2011, at 2:02 AM, André Adam wrote: Hi! I have written some

Re: [Maya-Python] How to embed a modelPanel into a Qt Layout

2011-11-20 Thread Justin Israel
is unclear. Maybe there is a better way to do this, but this way works fine. -- justin On Nov 20, 2011, at 6:18 PM, 张宇 wrote: Thanks for your reply Justin, I am using pyqt not just the qtDesigner, how to do that with pyqt? Http://zhangyu.me 在 2011-11-21,4:38,Justin Israel justinisr

Re: [Maya-Python] How to embed a modelPanel into a Qt Layout

2011-11-20 Thread Justin Israel
at 10:07 AM, Justin Israel justinisr...@gmail.com wrote: Hah, ya I had a feeling. Now that I am home, I was able to write out an example: https://gist.github.com/1381489 Its more complicated because you have to use sip and the MQtUtil function to translate between maya node paths

Re: [Maya-Python] Can't import modules - Maya on Linux

2011-11-20 Thread Justin Israel
That error wouldnt be coming from the importing of standard python modules like os or sys or math. Its complaining about that 'String:Joint_Grp' being an invalid argument to someother command. Is that the complete traceback error you got? And stupid question... But... That object does exist

Re: [Maya-Python] How to embed a modelPanel into a Qt Layout

2011-11-21 Thread Justin Israel
Ok great. Thats good to know. Pyqt 4.6 is slightly older than the maya 2011 docs even suggest (they recommend 4.7.3) so as Jo pointed out in his link its probably a keyword arg compatibility issue. On Nov 20, 2011, at 11:56 PM, Kurian O.S kuria...@gmail.com wrote: Yeah Justin thats what

Re: [Maya-Python] Testing a QInputDialog with QTest

2011-11-22 Thread Justin Israel
How are you calling you QInputDialog? My guess is that you are using the static convenience methods (or exec_) which cause your dialog to become modal, and thus block the main application. What you probably want to do is: self.d = QInputDialog(self) self.d.setModal(False) self.d.show() At this

Re: [Maya-Python] Re: Problem Executing Backburner from Python

2011-11-22 Thread Justin Israel
\is50anim24.mb' from 'C: \Users\Me\AppData\Local\backburner\ServerJob'Job exit successful I'm in a crunch, working by myself, so any help will be deeply appreciated. Thanks. On Nov 22, 10:19 am, Justin Israel justinisr...@gmail.com wrote: I havent had a chance to test anything yet but have

Re: [Maya-Python] Re: Problem Executing Backburner from Python

2011-11-22 Thread Justin Israel
Try taking a look at this method of formatting your command. Its a lot easier to handle all the quoting without escaping, and see exactly what command you are defining: http://pastebin.com/2U2NCVkJ Maybe this method might actually address your issue? On Nov 22, 2011, at 11:11 AM,

Re: [Maya-Python] component selection using python

2011-11-26 Thread Justin Israel
Hi Reza, The range() function accepts a 3rd parameter that defines the step amount. Here is an example using the commands module selectBy = 2 total = len(cmds.getAttr(pSphere1.vtx[:])) for i in xrange(0, total, selectBy): cmds.select('pSphere1.vtx[%d]' % i, add=True) Hope that helps!

Re: [Maya-Python] component selection using python

2011-11-27 Thread Justin Israel
Thanks. I am quite lovely aren't I? LOL Here is a rough example that I thought of, using python commands and assuming a start and end selection https://gist.github.com/1398060 I don't really check the original selection to see if its only two vertices or faces, but this should give you an

Re: [Maya-Python] line error display and command completion

2011-12-02 Thread Justin Israel
In the script editor, make sure you have History-Line NUmbers in Errors and History-Show Stack Trace enabled You should be able to see the line number in the code where the error occurred. Command completion is activated by typing something and hitting ctrl+spacebar -- justin On Dec 2,

Re: [Maya-Python] pyqt button menus with designer

2011-12-02 Thread Justin Israel
Though this approach would make it a Menu button, activated from a normal left click. On Fri, Dec 2, 2011 at 1:53 PM, David Moulder da...@thirstydevil.co.ukwrote: Alternatively you could try 1. QMenu http://doc.qt.nokia.com/latest/qmenu.html *menu = new

Re: [Maya-Python] Best place for workspace.mel

2011-12-04 Thread Justin Israel
I would say that if you need per shot scene locations then you would want one in each shot level. Because then you would be using the workspace.mel to define the environment per shot. You might even consider having Project_name be a root workspace that define the asset location and other

Re: [Maya-Python] Re: pyqt button menus with designer

2011-12-07 Thread Justin Israel
executing or generating the menu, but the extra _(self.mapToGlobal(pos)) I'm not sure how to use elsewhere... On Dec 6, 9:55 pm, Justin Israel justinisr...@gmail.com wrote: You are making a simple dialog that only contains a pushbutton that is added to a vertical layout. You set the context

Re: [Maya-Python] Animated Rigid Bodies Starting at Intervals - Will Pay for Sample Script

2011-12-08 Thread Justin Israel
Hey, What actions specifically should the script perform and what parameters does it need to expose to you? Im not a maya artist specifically im a pipeline developer so i dont always know every aspect of maya such as doing rbd very thoroughly but the artists always show me what they need to

Re: [Maya-Python] mel.eval troubles

2011-12-22 Thread Justin Israel
Are you able to post the specific error? Did it give you any more information that what you provided? Also, is there any reason you cant do it from python? On Dec 22, 2011, at 2:17 PM, Sebastian Schoellhammer wrote: Hello, I have a weird problem with mel.eval import maya.mel as mel

Re: [Maya-Python] mel.eval troubles

2011-12-24 Thread Justin Israel
/index.php/t-898721.html 2011/12/23 Sebastian Schoellhammer sschoellhammer.li...@gmail.com No, sadly the only thing I get is syntax error and yes in this case mel.eval would be by far the most convenient way. On Fri, Dec 23, 2011 at 1:52 PM, Justin Israel justinisr...@gmail.com wrote

Re: [Maya-Python] mel.eval troubles

2011-12-25 Thread Justin Israel
out and then re-apply it later. But if *some* mel commands don't work apart from file openening time, this all crumbles apart a bit. :/ and I might have to do things properly after all. seb On Sun, Dec 25, 2011 at 3:33 PM, Justin Israel justinisr...@gmail.com wrote: Just for my own

Re: [Maya-Python] find geometry with vertex count as condition?

2011-12-26 Thread Justin Israel
As far as I know, maya's database doesn't index all geometry vertex counts in a way that you can filter select on it. The API selection mechanism only lets you select on name patterns and then filter on type. And the python commands wrap around that to add more type filtering. I believe your

Re: [Maya-Python] user login session with PyQt

2011-12-29 Thread Justin Israel
This is all overkill. I dont see why you need fancy 3rd party frameworks for a non http/web app. You wouldnt store the users login info locally. You would perform the auth against postgres or ldap or any type of server that has the users. If the user passes the auth you can use a QSettings

Re: [Maya-Python] pymel ui from shell

2011-12-30 Thread Justin Israel
Running gui commands requires that maya actually be running in gui mode, otherwise it has nothing to generate the dialogs under. That is.. gui commands dont work from mayapy If you need a completely standalone app that uses maya, then you would in fact need to design a PyQt app that uses

Re: [Maya-Python] pymel ui from shell

2011-12-30 Thread Justin Israel
Actually let me clarify.. My app doesn't actually directly start using mayapy as the interp. It uses a normal python interpreter but it calls out to a command line only tool which DOES use mayapy to do standalone maya commands

Re: [Maya-Python] PyQt - how to check if UI is already running?

2012-01-09 Thread Justin Israel
Kurian, he is using maya 2010 before they rewrote it in qt. so I don't believe MQtUtil even exists. The pumpThread utility is what he needs. It creates a fakey event loop that keeps processing events from qt as they stack up and also takes care of the global qapp that will be shared. There is

Re: [Maya-Python] PyQt - how to check if UI is already running?

2012-01-09 Thread Justin Israel
It should be in the sdk directory and not in your path just yet. But if you cant find it: http://code.google.com/p/svnformaya/source/browse/trunk/pumpThread.py?r=3 On Jan 9, 2012, at 8:14 AM, Justin Israel justinisr...@gmail.com wrote: Kurian, he is using maya 2010 before they rewrote

Re: [Maya-Python] Lead Java Developer/Developer

2012-01-18 Thread Justin Israel
Hey Mark, go easy on Surendra. After all, this person does represent A CMMi Level 5 Company, with Level 1 intelligence. On Wed, Jan 18, 2012 at 8:27 AM, Mark Tigges mtig...@gmail.com wrote: Why the fuck do you spam a python list for a job listing at all. And a completely unrelated job

Re: [Maya-Python]is there a way to get Current Camera view name(trasnform node)?

2012-01-19 Thread Justin Israel
Kamil, you say that there are only advantages to using pymel? Are you implying that pymel has no disadvantages? Wouldn't want to mislead a newcomer to Maya python ;-) On Thu, Jan 19, 2012 at 10:05 AM, stephenkmann stephenkm...@gmail.comwrote: I can see what you mean.. I still have tons to

Re: [Maya-Python]is there a way to get Current Camera view name(trasnform node)?

2012-01-19 Thread Justin Israel
, Kamil Hepner hektor1...@gmail.comwrote: Okey I'll be honest... :-) the pymel have disadventages. The biggest one is that pymel is slower than cmds. But I love it for his OOP structure. So yes, my previous post is misleading, sorry for that :-) 2012/1/19, Justin Israel justinisr...@gmail.com

Re: [Maya-Python] python __main__ class

2012-01-25 Thread Justin Israel
I think that __main__ would be a very strange and unpredictable place to store shared data in your environment. If what you are after is a globals module to share settings, you could try something like this ## testConstants.py ## BAR=foo ## testScriptA.py ## import testConstants print BAR=,

Re: [Maya-Python] python __main__ class

2012-01-25 Thread Justin Israel
by the system in general, you can put them in parentPackage, or an equivalent. -Judah On Wed, Jan 25, 2012 at 1:38 PM, Justin Israel justinisr...@gmail.comwrote: I think that __main__ would be a very strange and unpredictable place to store shared data in your environment. If what you are after

Re: [Maya-Python] array of pointers?

2012-01-26 Thread Justin Israel
Hey, I think the problem you are having is in your use of MScriptUtil. As per the docs, the pointer you generate from data stored in an instance of a script util is somewhat bound to that instance. When you create more pointers from more data, you invalidate the previous pointers. Here is an

Re: [Maya-Python] Fastest way to build a QTreeWidget from Scene

2012-02-04 Thread Justin Israel
Short of testing, I'm pretty confident that using an API MIt* would increase the speed just for the fact that its probably doing more in the C++ side. On Feb 4, 2012, at 2:58 PM, Chad Vernon wrote: You could try using the API and MItDag. I'm not sure if it will be faster or not, but worth

Re: [Maya-Python] Fastest way to build a QTreeWidget from Scene

2012-02-04 Thread Justin Israel
with Judah about subclassing a QStandardItem as some kind of NodeItem that holds your paths and important metadata. On Feb 4, 2012, at 9:00 PM, Justin Israel justinisr...@gmail.com wrote: Short of testing, I'm pretty confident that using an API MIt* would increase the speed just

Re: [Maya-Python] Re: Fever Dorian's Sphere Packing code optimized

2012-02-10 Thread Justin Israel
Hey, While I actually am not really familiar with the original problem that this trick solves, after seeing your code I got somewhat hooked today trying to optimize it further. I thought I would post what I've to be able to have some discussion about it. There were a couple things I was confused

Re: [Maya-Python] File Access Callbacks Grrr

2012-02-28 Thread Justin Israel
The actual issue I see with that callback is that you are not defining the args signature correctly and its actually failing. When you use that specific callback, it wants to also pass a second parameter for the optionally provided userdata when the callback was registered. This example works for

Re: [Maya-Python] keyboard callback

2012-03-01 Thread Justin Israel
I threw together a simple pyqt example of how to show a dialog at the current mouse position, and then respond to the ESC key being pressed to then hide that dialog: https://gist.github.com/1951709 You can adapt this to your maya version I'm sure. But this is a standalone PyQt working example. I

Re: [Maya-Python] Re: keyboard callback

2012-03-01 Thread Justin Israel
No. Maya does not come with pyqt. It is built on Qt only, and you have to install it yourself. Were you talking about a window using the native commands api? Sorry if I misunderstood that. On Thu, Mar 1, 2012 at 1:55 PM, wilsimar wilsima...@gmail.com wrote: thanks Justin and Chad, but I dont

Re: [Maya-Python] Re: keyboard callback

2012-03-03 Thread Justin Israel
I may be wrong, but I dont think there is a direct python equivalent of that example. But if you have that snippet, why not just compile it and use it as a command in your script? The python solutions I have seen are to use an MPxContext type approach and get the position from an event. All

Re: [Maya-Python] Extracting data from Output Window

2012-03-05 Thread Justin Israel
The code I suggested earlier will work for software renders, and, for anything that maya batch reports back to maya's script editor. Maya batch does write to a log file which you could tail, and get your output from there. I'm not sure where it lives on windows, but on OSX it lives in the user

Re: [Maya-Python] Extracting data from Output Window

2012-03-05 Thread Justin Israel
:50:09 AM UTC+11, Justin Israel wrote: The code I suggested earlier will work for software renders, and, for anything that maya batch reports back to maya's script editor. Maya batch does write to a log file which you could tail, and get your output from there. I'm not sure where it lives

Re: [Maya-Python] Maya 2011 PyQt4 Kubuntu

2012-03-08 Thread Justin Israel
Just to make sure this info also shows up in this thread... I have this information collected into one place on my blog: http://www.justinfx.com/2011/11/09/installing-pyqt4-for-maya-2012-osx/ On Thu, Mar 8, 2012 at 9:37 AM, notanymike notanym...@gmail.com wrote: Never mind, I found this:

Re: [Maya-Python] Problem with add maya widget to Qt layout

2012-03-08 Thread Justin Israel
Hey there, This issue, as far as I know, relates to something I addressed in one of my maya python training videos (vol 2). When you create a ui in Qt Designer and then have maya generate the actual GUI from it, its doing translations to represent widgets. With that in mind, the exact hierarchy

Re: [Maya-Python] Problem with add maya widget to Qt layout

2012-03-09 Thread Justin Israel
in maya. 2012/3/9 Justin Israel justinisr...@gmail.com Hey there, This issue, as far as I know, relates to something I addressed in one of my maya python training videos (vol 2). When you create a ui in Qt Designer and then have maya generate the actual GUI from it, its doing translations

Re: [Maya-Python] copySkinWeights not accepting multiple influenceAssociations

2012-03-13 Thread Justin Israel
In python, it is not valid to pass multiple keywords of the same name as parameters. This is obviously a typo in both the python commands docs, and the pymel docs that copied them 1-to1. For commands that state you can pass the flag multiple time, you should try and combine them into a tuple. See

Re: [Maya-Python] copySkinWeights not accepting multiple influenceAssociations

2012-03-13 Thread Justin Israel
at 4:59 PM, Justin Israel justinisr...@gmail.comwrote: In python, it is not valid to pass multiple keywords of the same name as parameters. This is obviously a typo in both the python commands docs, and the pymel docs that copied them 1-to1. For commands that state you can pass the flag multiple

Re: [Maya-Python] Re: Extracting data from Output Window

2012-03-15 Thread Justin Israel
If the only way on to redirect the output on windows is to a file using the log flag, then you can have your qt window just tail that file. On Mar 15, 2012, at 9:03 AM, ChrisV chr...@austin.rr.com wrote: Is there a way to redirect the Output Window info or stdout to a Qt interface. We have

Re: [Maya-Python] PySide for Maya[2011|2012] under Linux?

2012-03-20 Thread Justin Israel
Probably very similar to the PyQt procedure, linking against the correct version of Qt. Haven't tried it yet though. On Tue, Mar 20, 2012 at 7:32 PM, Drake drake.g...@gmail.com wrote: I'm really curious to know how to compile/make a workable PySide packages for Maya[2011|2012] under Linux?

Re: [Maya-Python] PySide for Maya[2011|2012] under Linux?

2012-03-21 Thread Justin Israel
It will have to be built against the proper Qt API version. Using yum or apt-get might end up building against 4.8. Dunno if that is useable. It also has to be built for python2.6 (maya2012) On Wed, Mar 21, 2012 at 3:05 AM, Ricardo Viana cgolhei...@gmail.com wrote: If you're on Fedora or Red

Re: [Maya-Python] How to embed PyQt windows to Maya main window on Mac Os

2012-03-27 Thread Justin Israel
Simple fix. Just pass a WindowFlag to your window that tells it to always stay on top class MayaSubWindow(QtGui.QMainWindow): def __init__(self, parent=getMayaWindow()): super(MayaSubWindow, self).__init__(parent, QtCore.Qt.WindowStaysOnTopHint) QtGui.QPushButton(self) If you

Re: [Maya-Python] Re:- Generating texture list by python

2012-03-27 Thread Justin Israel
Here is a tightened up version of Mike's cmds approach. It uses sets which are more efficient and unique by design, and gets rid of the inner for loop... texture_types = set(['tif', 'tga', 'png']) used_files = set() for file_node in cmds.ls(type='file') : file_path =

Re: [Maya-Python] Anyone tried making Maya (Windows, 64bits) work with virtualenv through userSetup.py?

2012-04-02 Thread Justin Israel
Though I am not sure exactly why, it is this line in the activation script that is hanging up maya: site.addsitedir(site_packages) I have not tried using a virtualenv with maya before. Its a lot easier to just update the PYTHONPATH from the Maya.env, or, update the sys.path from the userSetup.py

Re: [Maya-Python] Re:- Generating texture list by python

2012-04-02 Thread Justin Israel
On Tuesday, March 27, 2012 9:26:52 PM UTC+4:30, Justin Israel wrote: Here is a tightened up version of Mike's cmds approach. It uses sets which are more efficient and unique by design, and gets rid of the inner for loop... texture_types = set(['tif', 'tga', 'png']) used_files = set

Re: [Maya-Python] Anyone tried making Maya (Windows, 64bits) work with virtualenv through userSetup.py?

2012-04-03 Thread Justin Israel
that script that generates used texture in UI(if make) or in script editor. I am looking for any of ref... by which i start using it, On Tue, Apr 3, 2012 at 2:27 AM, Justin Israel justinisr...@gmail.com wrote: Though I am not sure exactly why, it is this line in the activation script

Re: [Maya-Python] keyboard and mouse events

2012-04-10 Thread Justin Israel
This is just a guess, since I haven't put too much time into checking, but I think you might need to do this in C++. The pointers that you wrap from sip - PyQt QWidget don't seem to register any effect to having their event methods overloaded. Maybe someone else has more insight on this than me?

Re: [Maya-Python] keyboard and mouse events

2012-04-10 Thread Justin Israel
. I did that to intercept key presses to do something else before sending it on to Maya. On Tue, Apr 10, 2012 at 4:47 PM, Justin Israel justinisr...@gmail.comwrote: This is just a guess, since I haven't put too much time into checking, but I think you might need to do this in C

Re: [Maya-Python] Re: keyboard and mouse events

2012-04-12 Thread Justin Israel
In your eventFilter for the mainWindow, you can check for the ChildAdded event. Nice thing is that you dont have to go looking it up and converting it :-) class Filter(QtCore.QObject): def eventFilter(self, obj, event): typ = event.type() if typ == event.ChildAdded:

Re: [Maya-Python] Re: keyboard and mouse events

2012-04-12 Thread Justin Israel
it a pointer to the widget (or if there is a better way to either get the Maya UI name, or figure out if the child is a panel of type x). Thanks, Jesse On Apr 12, 12:55 pm, Justin Israel justinisr...@gmail.com wrote: In your eventFilter for the mainWindow, you can check for the ChildAdded

Re: [Maya-Python] Re: keyboard and mouse events

2012-04-13 Thread Justin Israel
= mui.MQtUtil.mainWindow() mainWin = sip.wrapinstance(long(ptr), QtGui.QMainWindow) f = Filter() mainWin.installEventFilter(f) Thanks, Jesse On Apr 12, 3:12 pm, Justin Israel justinisr...@gmail.com wrote: Sorry, I kinda neglected to address checking the child widget in that example. Unwrap

Re: [Maya-Python] PyQt and Maya's scriptedPanels

2012-04-17 Thread Justin Israel
Seems like pymel's eval functionality isn't converting your bool True - 1 Maybe try this: p.mel.generateChannelMenu(self.popup, 1) Or just use the standard mel module: import cmds.mel as mm mm.eval('generateChannelMenu(%s, 1)' % self.popup) On Tue, Apr 17, 2012 at 2:27 PM, Richard Kazuo

Re: [Maya-Python] PyQt and Maya's scriptedPanels

2012-04-17 Thread Justin Israel
Sorry, typo: import *maya.mel* as mm mm.eval('generateChannelMenu(%s, 1)' % self.popup) On Tue, Apr 17, 2012 at 3:03 PM, Justin Israel justinisr...@gmail.comwrote: Seems like pymel's eval functionality isn't converting your bool True - 1 Maybe try this: p.mel.generateChannelMenu

Re: [Maya-Python] PyQt MainWindow as ScriptJob Parent

2012-04-20 Thread Justin Israel
On Fri, Apr 20, 2012 at 4:25 PM, Christopher Evans chris.ev...@gmail.comwrote: First lemme start with: Is it possible to use closeEvent() in Maya? I cannot get that to work. Can you be more specific about what is giving you trouble? This works just fine: class Window(QtGui.QMainWindow):

Re: [Maya-Python] PyQt MainWindow as ScriptJob Parent

2012-04-20 Thread Justin Israel
I hit send to fast. Ignore that silly line at the end of my last message :-) On Fri, Apr 20, 2012 at 5:05 PM, Justin Israel justinisr...@gmail.comwrote: On Fri, Apr 20, 2012 at 4:25 PM, Christopher Evans chris.ev...@gmail.comwrote: First lemme start with: Is it possible to use closeEvent

Re: [Maya-Python] maya 2013 and pyqt on osx lion (10.7.3)

2012-04-21 Thread Justin Israel
I just tested my MyQt build script on Lion + maya2013. Works great. Maya2013 seems to still use Qt 4.7.1, so not much changed other than the paths for the installer. Updated project: https://github.com/justinfx/MyQt4 Updated blog post with links:

Re: [Maya-Python] PyQt MainWindow as ScriptJob Parent

2012-04-21 Thread Justin Israel
, CE On Sat, Apr 21, 2012 at 2:06 AM, Justin Israel justinisr...@gmail.com wrote: I hit send to fast. Ignore that silly line at the end of my last message :-) On Fri, Apr 20, 2012 at 5:05 PM, Justin Israel justinisr...@gmail.com wrote: On Fri, Apr 20, 2012 at 4:25 PM, Christopher

Re: [Maya-Python] PyQt MainWindow as ScriptJob Parent

2012-04-21 Thread Justin Israel
of the window is to set it explicitly. On Sat, Apr 21, 2012 at 3:03 PM, Justin Israel justinisr...@gmail.com wrote: You actually don't need to name the window for it to work. Maya will use a default name. from PyQt4 import QtCore, QtGui import maya.OpenMayaUI as mui import sip def

Re: [Maya-Python] Error: TypeError: file maya console line 1: Invalid arguments for flag 'time'. Expected (time, [time]), got float

2012-04-22 Thread Justin Israel
Hey Besjan, It might be a good idea to follow up on your questions if you ask the community something and then someone answers. I keep seeing a pattern in this discussion group where people will ask a question, someone takes the time to provide information, and then that original person says

Re: [Maya-Python] PyQt MainWindow as ScriptJob Parent

2012-04-22 Thread Justin Israel
am creating the window differently than you guys. I was going to give this skinning tool away free anyways, here's that few surrounding chunks of code: http://pastebin.com/5tJfvSB7 Thanks, CE On Sat, Apr 21, 2012 at 2:06 AM, Justin Israel justinisr...@gmail.com wrote: I hit

Re: [Maya-Python] PyQt MainWindow as ScriptJob Parent

2012-04-22 Thread Justin Israel
the closeEvent for that previous widget. On Sun, Apr 22, 2012 at 5:21 PM, Christopher Evans chris.ev...@gmail.comwrote: http://pastebin.com/PKEyg0FJ On Mon, Apr 23, 2012 at 1:11 AM, Justin Israel justinisr...@gmail.com wrote: Post your latest code? Maybe you have a strange indent. No idea why

Re: [Maya-Python] PyQt MainWindow as ScriptJob Parent

2012-04-23 Thread Justin Israel
): QtGui.QDialog.__init__(self) Now it works fine! (the onClose) CE On Mon, Apr 23, 2012 at 3:57 AM, Justin Israel justinisr...@gmail.com wrote: You have some issues with the way you are loading and using your UI. Notice that you are loading the UI into self.ui, but then implementing events

Re: [Maya-Python] Selectively export child members?

2012-04-25 Thread Justin Israel
I wrote an export selected script at our studio that does basically that same thing. Reparenting various objects to the world temporarily. On Wed, Apr 25, 2012 at 6:57 AM, yury nedelin ynede...@gmail.com wrote: You can unparent body, export control with head, then reparent body and unparent

Re: [Maya-Python] wingide 4.1 and maya 2011 - 2013 commandport on win7?

2012-04-25 Thread Justin Israel
I added a sys.platform == darwin case to both scripts, and on osx 10.6.8 with maya 2012 this seems to work fine and repeatedly when I just use the wingHotKeys module from a terminal (I dont use wing). I'm curious why the scripts go through so much trouble to set up raw low level sockets on a

Re: [Maya-Python] Re: Syntax Coloring in Eclipse

2012-05-02 Thread Justin Israel
Is this a 1 year old thread or am I reading this wrong? Ha On May 2, 2012, at 1:16 AM, Felix Ulber f.ul...@web.de wrote: There is a MEL syntax Highlighter based on colorer: http://www.creativecrash.com/downloads/applications/syntax-scripting/c/eclipse-maya-mel Am 24.01.2011 05:31, schrieb

Re: [Maya-Python] Maya 2012 - PyQt uic won't show up when wrapped in function

2012-05-02 Thread Justin Israel
Also, I just wanted to point out that the way you are using your UI file is less than desirable. There are a couple recommended approaches you can use here: http://doc.qt.nokia.com/4.7-snapshot/designer-using-a-ui-file.html But if you just load it into self.ui and then start doing

Re: [Maya-Python] Maya 2012 - PyQt uic won't show up when wrapped in function

2012-05-02 Thread Justin Israel
post about super classing the ui to gain access to the ui.setup method. I'll experiment with it :) Thanks On Wed, May 2, 2012 at 9:54 PM, Justin Israel justinisr...@gmail.com wrote: Also, I just wanted to point out that the way you are using your UI file is less than desirable

Re: [Maya-Python] Re: pyMel UI crashes 2013

2012-05-05 Thread Justin Israel
The usage of the context managers for the two menus are causing the crash. If you remove the with statement and just run them normally, the UI works: http://pastebin.com/02SVxcn2 May be a pymel bug with context managers. On May 5, 2012, at 4:14 PM, dgovil wrote: Specifically I think I've

Re: [Maya-Python] QLineEdit setFocus problem

2012-05-07 Thread Justin Israel
Hey Manuel, Have you tried using a QCompleter? You realize its provided to do this exact functionality? http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcompleter.html There are a couple different modes it can be set to, one of which being a popup that narrows down the list as you

Re: [Maya-Python] QLineEdit setFocus problem

2012-05-07 Thread Justin Israel
to just use a normal QWidget that is set up how you want, and show() it. I have a tool exactly like this which mimics OSX's Spotlight. The list is just a custom widget that I show underneath. On May 7, 2012, at 7:25 AM, Justin Israel justinisr...@gmail.com wrote: Hey Manuel, Have you tried using

Re: [Maya-Python] Where do Maya Python API 2.0 feedbacks? Bug reports? etc...

2012-05-07 Thread Justin Israel
Report the bug? http://usa.autodesk.com/adsk/servlet/item?id=12331406siteID=123112SelProduct=Maya Also, the results == 2 sounds correct, but what is the actual content of the selection list for api.OpenMaya? What are those 328 items? On May 7, 2012, at 3:38 AM, Narann wrote: Hi all! I was

Re: [Maya-Python] Where do Maya Python API 2.0 feedbacks? Bug reports? etc...

2012-05-07 Thread Justin Israel
Just tested in 2013: import maya.api.OpenMaya as om import maya.OpenMaya as OpenMaya # *Create a cube* mSelList = om.MSelectionList() omSelList = OpenMaya.MSelectionList() mSelList.add(pCu*) print mSelList.length() omSelList.add(pCu*) print omSelList.length() 2 2 On May 7, 2012, at

  1   2   3   4   5   6   7   8   9   10   >