Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
<DEFANGED_script >Python and the PPG global variable?

<DEFANGED_script >Python and the PPG global variable?

2005-04-28       - By Aloys Baillet

 Back
Reply:     1     2     3     4     5  

I didn't tried this one, looks good!
Thanks Jerry!

On 4/28/05, Jerry Gamache <jerryg@(protected)> wrote:
>
> inspect.getsource( module.function ) returns the source code for a single
> function, but if all the functions in a module are of interest to your PPG
> you might want to try:
>
> layout.Logic = inspect.getsource( myPPGModule )
>
> To get all the code from myPPGModule.py in one single call.
>
> -- --Original Message-- --
> From: owner-xsi@(protected) [mailto:owner-xsi@(protected)]On Behalf
> Of Patrick Boucher
> Posted At: Wednesday, April 27, 2005 10:32 PM
> Posted To: xsi
> Conversation: <DEFANGED_script>Python and the PPG global variable?
> Subject: Re: <DEFANGED_script>Python and the PPG global variable?
>
> Aloys Baillet wrote:
> > Sorry Patrick, but I don't think it's possible...
> > What you can also do is to put all the code of the scripted operator in
> > a separate file, and call XSIFactory.CreateScriptedOpFromFile. But in
> > this case you have to know where is installed the file (what I usually
> > do is to take the current PluginItem and ask its FileName property to
> > find out where I am in the filesystem, then point at the scripted op
> > file. The advantage of this method is that you can add as many helper
> > function in your code without having to add them in the operator code
> > with the inspect.getsource function...
> > Cheers,
> >
> > Aloys
>
> That's what I'm doing as well....
>
> in my custom command:
> myOpFile = os.path.join(myCmd.OriginPath, 'myOpFile.py')
> op = XSIFactory.CreateScriptedOpFromFile('MyOp', myOpFile, 'Python')
> layout = op.PPGLayout
> layout.Language = "Python"
> layout.Logic = inspect.getsource(foo) + inspect.getsource(bar)
>
> I was just hoping there was a sexier/more practical way to do so.
>
> If there's customOperator.Code and customOperator.FileName might be nice
> to have PPGLayout.Logic and PPGLayout.LogicFileName. One could assign
> the same file or different files to each to have all CustomOp code
> outside the scene. One could also imagine a world where if the
> PPGLayout.Logic is empty the system falls back to looking at
> customOperator.Code for the UI event handlers...
>
> Thanks for the help!
>
> --
> Patrick Boucher
> TD - Coder - Resident geek
> Buzz Image Group
> Tel 514.848.0579
> Fax 514.848.6371
>
> www.buzzimage.com <http://www.buzzimage.com>
> www.xsi-blog.com <http://www.xsi-blog.com>
> ---
> Unsubscribe? Mail Majordomo@(protected) with the following text in body:
> unsubscribe xsi
>
> ---
> Unsubscribe? Mail Majordomo@(protected) with the following text in body:
> unsubscribe xsi
>



--
Aloys Baillet - Character TD @ Animal Logic

I didn't tried this one, looks good!<br>
Thanks Jerry!<br><br><div><span class="gmail_quote">On 4/28/05, <b class="gmail
_sendername">Jerry Gamache</b> &lt;<a href="mailto:jerryg@(protected)">jerryg
@(protected)</a>&gt; wrote:</span><blockquote class="gmail_quote" style=
"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding
-left: 1ex;">
inspect.getsource(
module.function ) returns the source code for a single function, but if
all the functions in a module are of interest to your PPG you might
want to try:<br><br>layout.Logic = inspect.getsource( myPPGModule )<br><br>To
get all the code from myPPGModule.py in one single call.<br><br>-- --Original
Message-- --<br>From: <a href="mailto:owner-xsi@(protected)">owner-xsi
@(protected)
</a> [mailto:<a href="mailto:owner-xsi@(protected)">owner-xsi@(protected)<
/a>]On Behalf<br>Of Patrick Boucher<br>Posted At: Wednesday, April 27, 2005 10
:32 PM<br>Posted To: xsi<br>Conversation: &lt;DEFANGED_script&gt;Python and the
PPG global variable?
<br>Subject: Re: &lt;DEFANGED_script&gt;Python and the PPG global variable?<br>
<br>Aloys Baillet wrote:<br>&gt; Sorry Patrick, but I don't think it's possible.
..<br>&gt; What you can also do is to put all the code of the scripted operator
in
<br>&gt; a separate file, and call XSIFactory.CreateScriptedOpFromFile. But in
<br>&gt; this case you have to know where is installed the file (what I usually
<br>&gt; do is to take the current PluginItem and ask its FileName property to
<br>&gt; find out where I am in the filesystem, then point at the scripted op
<br>&gt; file. The advantage of this method is that you can add as many helper
<br>&gt; function in your code without having to add them in the operator code
<br>&gt; with the inspect.getsource function...<br>&gt; Cheers,<br>&gt;<br>&gt;
Aloys<br><br>That's what I'm doing as well....<br><br>in my custom command:<br
>myOpFile = os.path.join(myCmd.OriginPath, 'myOpFile.py')<br>op =
XSIFactory.CreateScriptedOpFromFile('MyOp', myOpFile, 'Python')<br>layout = op
.PPGLayout<br>layout.Language = &quot;Python&quot;<br>layout.Logic = inspect
.getsource(foo) + inspect.getsource(bar)<br><br>I was just hoping there was a
sexier/more practical way to do so.
<br><br>If there's customOperator.Code and customOperator.FileName might be
nice<br>to have PPGLayout.Logic and PPGLayout.LogicFileName. One could assign
<br>the same file or different files to each to have all CustomOp code
<br>outside the scene. One could also imagine a world where if the<br>PPGLayout
.Logic is empty the system falls back to looking at<br>customOperator.Code for
the UI event handlers...<br><br>Thanks for the help!<br><br>--<br>
Patrick Boucher<br>TD - Coder - Resident geek<br>Buzz Image Group<br>Tel 514
.848.0579<br>Fax 514.848.6371<br><br><a href="http://www.buzzimage.com">www
.buzzimage.com</a><br><a href="http://www.xsi-blog.com">www.xsi-blog.com
</a><br>---<br>Unsubscribe? Mail <a href="mailto:Majordomo@(protected)"
>Majordomo@(protected)</a> with the following text in body:<br>unsubscribe xsi
<br><br>---<br>Unsubscribe? Mail <a href="mailto:Majordomo@(protected)">
Majordomo@(protected)</a> with the following text in body:<br>unsubscribe xsi
<br></blockquote></div><br><br><br>-- <br>Aloys Baillet - Character TD @ Animal
Logic