Re: [Maya-Python] Re: Question on QlistWidgetItem leave event

2014-09-05 Thread Bay
Hi Justin, here's the code I've used. I attempted to try your suggestion but haven't got any luck getting it to work. Really appreciate your help. Thanks again for the time spent ! class PoseListView(QtGui.QListWidget): def __init__(self, parent=None): super(Pos

Re: [Maya-Python] Re: Question on QlistWidgetItem leave event

2014-09-05 Thread Bay Gann Boon
Hi Justin, here's the code I've used. I attempted to try your suggestion but haven't got any luck getting it to work. Thanks again for the time spent ! class PoseListView(QtGui.QListWidget): def __init__(self, parent=None): super(PoseListView, self).__init__(parent)

Re: [Maya-Python] Re: Question on QlistWidgetItem leave event

2014-09-05 Thread Justin Israel
Can you show a small example of how you are setting up your list and items and their background? I'm not sure what you mean when you say the stylesheet doesn't do anything to your system. If I set a background on the items in the list, and then use a stylesheet to control the hover, it seems to wor

Re: [Maya-Python] Re: Question on QlistWidgetItem leave event

2014-09-05 Thread Bay
Hi Justin, thanks once again for your assistance. The issue now is that I'm using an image on the background of the qlistwidgetitem(sort of like a thumbnail in an image viewer), the goal is to achieve a highlight when the mouse is hovering over it. As you say, setSt

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Justin Israel
That does explain what you are trying to do, thanks. It wasn't what I thought you were explaining. Why do you need a Process for this? You create one process, and join on it. Why not just initialize maya standalone right before you are going to start the work and do it all in the original process?

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Kurian O.S
I think I am confusing you all Here is a snippet http://pastebin.com/J526ftrM I tried my max to explain :) On Fri, Sep 5, 2014 at 4:30 PM, Justin Israel wrote: > Well if you want to stick with the multiprocessing module and just endure > the possible seg faults and some files not getting pro

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Justin Israel
Well if you want to stick with the multiprocessing module and just endure the possible seg faults and some files not getting processed, you could print a warning and then do a os._exit(1) to just terminate the process. Using subprocess, you could have your script take arguments, such as a -file fl

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Kurian O.S
Hey Guys, First its a command line tool using optparse to get arguments and options from user and using maya standalone to do some process ( running through mayapy ). So Some files its just fail to do the process. Subprocess I am not sure how I can call a function with arguments. On Fri, Sep 5,

Re: [Maya-Python] Re: Question on QlistWidgetItem leave event

2014-09-05 Thread Justin Israel
Hey, You might find the easiest approach is just using a stylesheet: http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qlistview It lets you use the "hover" state for items. I'm guessing with your current solution, the color will stay the same if you move your mouse out of th

[Maya-Python] Re: Question on QlistWidgetItem leave event

2014-09-05 Thread Bay
Solved. My logic failed me, all I had to do to was to set all the background to the original background every time the mouse entered a new item. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Justin Israel
Hey Kurian, I'm not clear on this from your code example, but are you using the multiprocessing module from within Maya? Your example indicates that it is a standalone script. First, I don't think it is safe to use the multiprocessing module within Maya, since forking is not a very safe thing to d

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Kurian O.S
I was wrong its not working :( def sig_handler(signum, frame): pass def dosome(args, options): #here is my seg fault coming signal.signal(signal.SIGSEGV, sig_handler) #maya functions goes here if __name__ == "__main__": from multiprocessing import Process, Queue p = Proce

[Maya-Python] Question on QlistWidgetItem leave event

2014-09-05 Thread Bay
HI guys, currently I'm running into a problem where the intent is for the user to move his mouse onto a qlistwidgetitem and have it highlighted. While I am able to capture the itemEntered event, I am unable to locate the leave event. Would anyone have an idea on where I could locate

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Kurian O.S
I got a hint that I was using signal.signal(signal.SIGSEGV, sig_handler) in wrong place. On Fri, Sep 5, 2014 at 11:20 AM, Marcus Ottosson wrote: > Hi Kurian, > > Do you mean you are running separate processes that open up Maya in the > background to do some processing? > > Have a look at subpro

Re: [Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Marcus Ottosson
Hi Kurian, Do you mean you are running separate processes that open up Maya in the background to do some processing? Have a look at subprocess.Popen , it runs a process completely separate from where you ran it from and shouldn't

[Maya-Python] Segmentation Fault Catch

2014-09-05 Thread Kurian O.S
Hey Guys, I have a python script and it will loop through bunch of maya files and do some stuff. But some time maya get seg fault and my script will stop there. I tried with signal and multiprocess. But both failed def sig_handler(signum, frame): pass signal.signal(signal.SIGSEGV, sig_handle

Re: [Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread Justin Israel
Might help to check the docs http://download.autodesk.com/global/docs/maya2012/en_us/CommandsPython/fileDialog2.html Return value: string array Copy and paste is only going to get you so far. One operation/paste may lead into the next problem if you don't fully understand what the code does and r

Re: [Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread Marcus Ottosson
Though I am able to select and see the .chan files in the UI, as soon as I hit Enter, I was prompted with the following errors: May I ask what else you were expecting? ​ On 5 September 2014 12:31, likage wrote: > Cool, that will be great! Looking forward to your reply. > > By the way, I tried

Re: [Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread likage
Cool, that will be great! Looking forward to your reply. By the way, I tried out the fileDialog2 method that you have put up, multipleFilters = "Maya (*.ma *.mb);;chan (*.chan)" filename = cmds.fileDialog2(fileMode=1, fileFilter=multipleFilters, dialogStyle=2) cmds.file( filename, i=True, renam

Re: [Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread Marcus Ottosson
Is it possible to write a code, in this case I am trying to ask Maya to import in a new file format that it was initially not compatible with, simply with python or mel coding without the use of API? Yes, you can pop up your own File Dialog, like this: multipleFilters = "Maya (*.ma *.mb);;Custom

Re: [Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread likage
Sorry, another question to my previous reply. Is it possible to write a code, in this case I am trying to ask Maya to import in a new file format that it was initially not compatible with, simply with python or mel coding without the use of API? On Friday, September 5, 2014 4:50:17 PM UTC+8, M

Re: [Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread likage
Hi Marcus, Thank you for getting back to me. Hmm, I think I will try out the button method as I hardly have any ideas to do the other methods you have suggested (mute the Maya etc.) Right now I am in the midst of trying to figure how this code

Re: [Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread Marcus Ottosson
Hi likage, One way you might be able to achieve this is by replacing the Import menu item with your own, and do your checking from there. If it isn't a chan file, simply revert to Maya's defaults. Another way might be to have users use another button, such as "Import Chan". This button would then

[Maya-Python] Prompt a UI when a certain format is imported

2014-09-05 Thread likage
I am pretty new to Maya Api and I am in the midst of editing or changing a code for this custom plugin. I was wondering if it is possible for the following scenario: - User import in a particular file format - .chan (Using File >> Import), assumingly the plugin is working? - Upon impo