  | | | PPG logic | PPG logic 2005-06-07 - By Patrick Boucher
Back Bernard Lebel wrote: > pointing to the line > > oLayout.Logic = OnInit()
As Brad mentioned you have to supply the logic as a stirng to oLayout.Logic and JScript, with it's string representation of a function, is really handy with this. In python you'll want to use the inspect module.
import inspect import foo.bar.myLogicFunctions as tootsieRoll # or wherever your logic functions are
layout.Logic = inspect.getsource(tootsieRoll)
I use this trick in PB_Jitter that you can get off XSI Blog if you want to check out some actual working source
You can't really put your logic code in the main file because Python parses/compiles it and dumps the source but with modules, it keeps links back to the source on disk thus enabling this trick. If you do figure out how to do it in the main file, I'd like to know.
Big thanks to Jerry Gamache for originaly helping me out on this one!
-- Patrick Boucher TD - Coder - Resident geek Buzz Image Group Tel 514.848.0579 Fax 514.848.6371
www.buzzimage.com www.xsi-blog.com --- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|
 |