PDA

View Full Version : 2 Qt instances in Maya Impossible ?


Ourouk
05-04-2009, 12:12 PM
Hi !

New user of Qt and Python (advanced user in Mel), I begin to develop App in Qt (PyQT) inside Maya...

My first script works well. everything is OK...but when I try to launch another Qt script, the first one hang on and I cannot use it again...

At my job, one give me an answer : "MAYA cannot handle multiples instances of Qt inside the same Maya session..."

So what ? I can't execute 2 differents Qt scripts in the same session ?
anyone as an idee ? or an explanation ?

I am scared :/

iaiotom
05-05-2009, 04:39 PM
you need to execute the second script in a separate thread ;)

bye
alan

Ourouk
05-05-2009, 05:49 PM
In fact I solved the problem yesterday night...

I was importing the pumpthread.py like this :

import tools.pumpthread as pt

cause my pumpthread.py was in a tools directory with a __init__.py
I thought i could do that...

Finally I appended the tools directory to the sys.path and import pumpthread.py normally (
import pumpthread as pt )

It works...but I don't understand why I can't import pumpthread like a module for tools...
Do you have any answer to this ?

thanks
bye.

iaiotom
05-05-2009, 07:32 PM
In fact I solved the problem yesterday night...

I was importing the pumpthread.py like this :

import tools.pumpthread as pt

cause my pumpthread.py was in a tools directory with a __init__.py
I thought i could do that...

Finally I appended the tools directory to the sys.path and import pumpthread.py normally (
import pumpthread as pt )

It works...but I don't understand why I can't import pumpthread like a module for tools...
Do you have any answer to this ?

thanks
bye.
Did you set the PYTHONPATH enviroment variable with the path where is located the pumpthread module?

Ourouk
05-05-2009, 09:14 PM
No I didn't set the PYTHON PATH at this time but :

- firstly i didn't use pumpthread.py : My script worked but no "back focus" in maya when the script was executed

- secondly : I added "import tools.pumpthread", My script worked and also maya. The "tools" directory was not in the PYTHON PATH at this time ( i just used __init__.py )

I thought it was ok then...but after executing another PyQt script, the first script stoped working...

- Yesterday I changed the pumpthread import like i said in my last post...
Everything works fine...

Perhaps I didn't understand how the __init__.py work...

CGTalk Moderation
05-05-2009, 09:14 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.