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] 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

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