Use a command ? From: softimage-boun...@listproc.autodesk.com [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Sergio Mucino Sent: Thursday, October 17, 2013 2:50 PM To: softimage@listproc.autodesk.com Subject: Re: Global Python interpreter?
Thanks Stephen. That would work for stuff I want to keep around and re-use, but sometimes, I'm just doing quick-n-dirty work where I would like to define a function, and then be able to call it whenever I want. Use-n-dispose, I guess. I can do that just fine in other apps, but in Softimage, it forces me to keep the function around and copy/paste it to the tab where I will need it, calling it at the end. I don't save it to disk, because I keep changing stuff and redefining it as I go, so my options are limited. Anyway, thanks for confirming my suspicions. Cheers! [cid:image001.gif@01CECB48.9781C0B0] On 17/10/2013 11:47 AM, Stephen Blair wrote: That's right, Softimage is always creating new and separate instances of the scripting engine to run code. There isn't a way to add global code that Softimage will insert into every new instance of the scripting engine. So, maybe put that code in a module, or in a special custom command that you keep around for that purpose? On Thu, Oct 17, 2013 at 11:33 AM, Sergio Mucino <sergio.muc...@modusfx.com<mailto:sergio.muc...@modusfx.com>> wrote: I can't be sure about this, but it seems like each tab in the Script Editor spawns its own (local) instance of the Python interpreter. If I create a function in a script on one tab, I cannot call it from within a different tab. Does anyone know of a way of evaluating "global" functions? I would like to create a function, evaluate it, and have it remain in memory for it to be called from any other tab/script running in the current session. Thanks for any help! -- [cid:image001.gif@01CECB48.9781C0B0]
<<attachment: winmail.dat>>