fabriciochamon
March 11, 2020 18:02:37
Hi,
I have this big material node, that was saved with “node.asCode()”.
Now I want to reload it using “execfile()”.
The file has 60k+ lines, but it loads in a matter of seconds when I run inside a python script node. On the other hand it takes about 2 minutes to load when running inside a python processor node.
For this specific task I'd need to run inside a processor, since the file loading is tied to workitem generation.
What could be the cause for such a big difference in the execution times ?
thanks.
EricSheng
March 13, 2020 07:42:03
As far as I understand, the Python Script node is just the onCookTask callback in the Python Processor node. You can set the file path onGenerate(set isInprocess=True inProcess=True to perform an in-process cook) and load it onCookTask.
fabriciochamon
March 15, 2020 00:22:08
Eric, that's exactly what I need. thanks a lot for the reply!
A small correction: the argument name is “inProcess” and not “isInProcess”, for anybody else reading it.
thanks.
EricSheng
March 15, 2020 10:36:20
fabriciochamon
Eric, that's exactly what I need. thanks a lot for the reply!
A small correction: the argument name is “inProcess” and not “isInProcess”, for anybody else reading it.
thanks.
Thank you for the correction, I've edited the answer for convenient.