Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Maya gets closed with giving an error

Maya gets closed with giving an error

Anonymous
Not applicable
735 Views
3 Replies
Message 1 of 4

Maya gets closed with giving an error

Anonymous
Not applicable

I am creating a gui using maya python maya.cmds  . When i try to update progress bar from another thread then i get errors and maya application gets closed .

 

 

Error

 

QPixmap: It is not safe to use pixmaps outside the GUI thread

 

maya.bin: Fatal IO error: client killed

 

Segmentation fault (core dumped)

 

 

Can anyone  tell me why i am getting this error and how to solve this ?

 

0 Likes
736 Views
3 Replies
Replies (3)
Message 2 of 4

kollig
Advocate
Advocate

To my knowledge and experience all GUI updates have to be done in the main Maya thread. Meaning it is not safe to use progressBar from another thread.

 

In C++ I am using MGlobal::executeCommandOnIdle to get the command executed from the main thread.

May be you can use evalDeferred?!

0 Likes
Message 3 of 4

Anonymous
Not applicable

On click  submit button the command runs a function which updates progress bar but that function is too big and I can't do anything after click on submit button till the execution gets finished therefore I am running that function in the background using thread.
can you suggest me any other idea ?

0 Likes
Message 4 of 4

kollig
Advocate
Advocate

On submit do all startup GUI stuff needed to be done. Then start the thread with your function. Whenever your function wants to update the progress bar, which should be a single (mel) command, use evalDeferred for this command.

 

This means that the progress bar is updated using Maya's main thread/event loop. At least I think that evalDeferred works like this, I haven't tested it. MGlobal::executeCommandOnIdle works like this.