Re: [Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread Justin Israel
That would depend on your company, and whether your code is purely internal or if you ship code. For my company, in particular, it shouldn't matter since we handle it all internally with dependency management. I have some products that are only PySide but it would be trivial to adjust their imports

Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-11 Thread Justin Israel
You should just test both approaches and find out if the performance difference is acceptable. In a recent thread on this group, there was an example of creating many pynodes vs using cmds. At lower numbers you may not perceive a difference. At higher numbers it could be seconds vs subseconds On T

Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-11 Thread Panupat Chongstitwattana
Thank you every one. The current script I trying this is about retrieving hundreds or even thousands of names from Json/SQL and adjust maybe 1 or 2 attributes of each. Looping through strings creating PyNode over and over only to perform 1 operation... would this bother you or do you think it s

Re: [Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-11 Thread Gerard v
Hey there Chris. Thanks for the code I'll take a gander. Fuel catchup was great. Haven't seen any of the old team in quite some time. Cheers. G. On Thu, Mar 12, 2015 at 12:45 PM, Chris Gardner wrote: > hey gerard, > > nice to see you at the pub the other day :) > > here's some API code for looki

Re: [Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread Panupat Chongstitwattana
How important it is to still support PyQt in your opinion? Would dropping it entirely and focusing on PySide have any draw back in the long run? On Thursday, March 12, 2015 at 1:29:59 AM UTC+7, Justin Israel wrote: > > That is pretty much all the information that I am aware of, as well. > PySid

Re: [Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-11 Thread Chris Gardner
hey gerard, nice to see you at the pub the other day :) here's some API code for looking for custom attrs called "tags" and then looking for a string inside that. it's a bunch faster than maya cmds. adapt as necessary. it's filtering on transform nodes currently, but you could change that for you

[Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-11 Thread Gerard v
Hi all. I am trying to determine the most efficient way to search for nodes (transforms) of specified types (eg transform of a curve) under a hierarchy (lets call it 'top_node') that have a specific custom (string) attribute. When potentially dealing with a large number of nodes speed becomes a fa

Re: [Maya-Python] Re: Model/View Progamming and Drag/Drop

2015-03-11 Thread Joe Weidenbach
I've actually done the manual approaches before with raw widgets, this is partially because I think that the model/view approach is actually the best way to handle this particular scenario, and partially because I want to know more of the ins and outs of Qt's systems. Mostly the former, but I do l

Re: [Maya-Python] Re: Model/View Progamming and Drag/Drop

2015-03-11 Thread Justin Israel
Ya actually there are a number of ways to work with drag and drop, depending on what classes you are using. Like you have said, there is dropMimeData on the model if you want to handle it there, and startDrag on the view if you want to handle it there, and then more manual approaches with starting

Re: [Maya-Python] Re: Model/View Progamming and Drag/Drop

2015-03-11 Thread Joe Weidenbach
Just an update; from my research, it looks like I need to subclass QTreeView to do this. The default implementation of startDrag from QAbstractItemView apparently is what will delete the original item after everything's said and done, which checks out with reading the source code of qabstractitemv

Re: [Maya-Python] Re: Model/View Progamming and Drag/Drop

2015-03-11 Thread Joe Weidenbach
I'm glad we're all on the same page. Looking into Justin's mention of "taking" the item, I do see that functionality in the Convenience Widgets (QTreeWidget, etc), but not in QAbstractItemModel. Same with Marcus' suggestion of moveRow(). I might be looking at the wrong documentation...( http://sr

Re: [Maya-Python] Re: Model/View Progamming and Drag/Drop

2015-03-11 Thread Marcus Ottosson
Rather than serialising and de-serialising your item each time, you could instead keep track of origin and destination *indexes* of the operation; and then re-order the items accordingly. For example, if you’ve got these items in your model. item0 item1 item2 item3 And in your drag and drop oper

[Maya-Python] Re: Model/View Progamming and Drag/Drop

2015-03-11 Thread Joe Weidenbach
I can check into the take aspect. I haven't used it specifically, so it's worth a try. On Wed, Mar 11, 2015 at 2:24 PM, Joe Weidenbach wrote: > I should note that more specifically, for getting this to work currently, > I create a clone of my original element in the dropMimeData function of my

[Maya-Python] Re: Model/View Progamming and Drag/Drop

2015-03-11 Thread Joe Weidenbach
I should note that more specifically, for getting this to work currently, I create a clone of my original element in the dropMimeData function of my model, and put that clone in place. Qt Deletes my original automatically after the fact. I know this is happening because if I do a debug inspection

Re: [Maya-Python] Model/View Progamming and Drag/Drop

2015-03-11 Thread Justin Israel
You should just be able to "take" an item from the model and then add it to the new location. Does that approach not work for you? I don't recall needing to clone the item and delete the old one. On Thu, Mar 12, 2015 at 10:00 AM Joe Weidenbach wrote: > Hey folks, > > More of a conceptual questi

[Maya-Python] Model/View Progamming and Drag/Drop

2015-03-11 Thread Joe Weidenbach
Hey folks, More of a conceptual question here, as I've got this working at this point, but it feels like I had to do some ugly workarounds, which I can design around in the future, but would rather not have to. As I'm understanding it, Qt's Drag and Drop functionality in Models and Views is based

Re: [Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread Tony Barbieri
I personally avoid the UI files, but I know a lot of people like them. On Wed, Mar 11, 2015 at 3:24 PM, Justin Israel wrote: > Or even better, avoid UI files altogether, if you can manage. > > On Thu, 12 Mar 2015 7:47 AM Fredrik Averpil > wrote: > >> We've invested (so to speak) heavily in PySi

Re: [Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread Justin Israel
Or even better, avoid UI files altogether, if you can manage. On Thu, 12 Mar 2015 7:47 AM Fredrik Averpil wrote: > We've invested (so to speak) heavily in PySide. But like Justin mentions > the differences aren't that big between PySide/PyQt. > > However I'd like to point one thing out: > > If y

Re: [Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread Fredrik Averpil
We've invested (so to speak) heavily in PySide. But like Justin mentions the differences aren't that big between PySide/PyQt. However I'd like to point one thing out: If you are reading in external ui files, I would recommend defining a routine/policy on how you do that throughout your company's

Re: [Maya-Python] Unresolved reference etree in Pycharm

2015-03-11 Thread Justin Israel
Like other IDEs, it comes down to the PYTHONPATH configuration for your project. I assume that while it is properly found when you launch your app, your actual IDE isnt aware of the correct location in order to introspect the package. I'm not sure if windows needs extra PATH settings or not, but on

Re: [Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread Justin Israel
That is pretty much all the information that I am aware of, as well. PySide was an easier choice for a while because of the distribution. It also had more bugs and less development. In terms of writing an app, it isn't actually too hard to write it to dynamically handle supporting both PySide and P

Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-11 Thread Geordie Martinez
If you'd like to learn more about pymel this is a great book. check out Practical Maya Programming with Python: http://www.amazon.com/Practical-Programming-Python-Robert-Galanakis/dp/1849694729/ref=sr_1_1?ie=UTF8&qid=1426095687&sr=8-1&keywords=practical+maya+programming+with+python and I hear thes

Re: [Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread Lidia Martinez
To add some information on these topics I mentioned, I find this thread really interesting. Confusing, though... http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=103100 -- Lidia 2015-03-11 16:27 GMT+01:00 darkgaze : > Hello fellow programmers, > > once again, i dig up an old topi

[Maya-Python] Unresolved reference etree in Pycharm

2015-03-11 Thread Benjam901
Hello all, PyCharm has thrown me another curve ball. I cannot seem to correctly import lxml.etree and am given an unresolved reference. from lxml import etree as ET the annoying thing is that the application runs totally fine and I can see that etree.pyd is there but I cannot access the method

[Maya-Python] PySide and PyQt current and future status

2015-03-11 Thread darkgaze
Hello fellow programmers, once again, i dig up an old topic. I created this so i can renew it, i didn't find the exact post from the last two years, about this. I'm doing a huge research on the current status of both, Qt system in 3dsMax, Maya, and everything said everywhere about those, person

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Fredrik Averpil
Thanks everyone, I've reached a satisfactory result by pickling down the Maya QPalette and using that together with some of Tony's code (or Thorsten Kaufmann's code). Cheers! On Wed, Mar 11, 2015 at 1:40 PM Tony Barbieri wrote: > They most likely did customize further than just the QPalette.

Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-11 Thread Paul Molodowitch
>From a functional standpoint, there isn't a difference. There may be a performance difference, but unless you're making thousands, I wouldn't worry about it. Generally speaking, if I usually expect it to exist, and want to use it as a PyNode if it does, I'll do the try/except thing. One note tho

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Tony Barbieri
They most likely did customize further than just the QPalette. The QPalette should give you a good base to start from. Best, On Wed, Mar 11, 2015 at 4:53 AM, Fredrik Averpil wrote: > Hey guys, > > I see you've been busy with this while I've been asleep ;) > > So, it seems you are totally right

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Panupat Chongstitwattana
I based my own style on QDarkStyle. I think it's a very decent and nice looking one with color very similar to VFX software like Clarisse. Buttons are a bit too round and some tree widget and tree view elements still have none-matching colors but over all still great. https://github.com/ColinDu

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Fredrik Averpil
Hey guys, I see you've been busy with this while I've been asleep ;) So, it seems you are totally right I cannot fetch the stylesheet, as the UI needs to have been created using the qApp.setStylesheet(), which Autodesk seems not to have done (?). Thanks to Tony's post about QPalette, I started se

Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-11 Thread Panupat Chongstitwattana
Ah thank you. Such a silly mistake :( Is there any draw back if I don't check objExists but instead go for this? try: PyNode(string) except: print "something" On Wednesday, March 11, 2015 at 2:02:06 PM UTC+7, Justin Israel wrote: > > You have a typo between the two ways you format the

Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-11 Thread Justin Israel
You have a typo between the two ways you format the string : tmpname = "%smaster_crtl" % sel.namespace() tmp = "%smaster_ctrl" % selects[0].namespace() crtl vs ctrl On Wed, 11 Mar 2015 7:02 PM Panupat Chongstitwattana wrote: > Hi. > > I ran into another problem. objExists is returning differen