RE: [script] how to create a scripted op with vbscript?

Date : Thu, 4 Oct 2007 23:37:22 +0200
To : <XSI(at)Softimage.COM>
From : "Sebastian Faber" <sebastian.faber(at)liga01.de>
Subject : RE: [script] how to create a scripted op with vbscript?
there is an other way which is a bit more comfortable if you are writing
complex scops. You can save the scop in an external file and connect it to
the scene:

     myScriptedOpPath="f:\projectZ\SCOP_WhatEver.vbs"
     set sop = XSIFactory.CreateScriptedOpFromFile("MyOperator",
myScriptedOpPath, "VBScript")

     set group1 = sop.AddPortGroup( "MainGroup" )
     sop.AddOutputPort oObj.ActivePrimitive, "OutPolygonMesh", group1.index
     sop.AddInputPort oObj & "." & ... , group1.index
     sop.connect()


The scripted operator file has to look similar like this

    function MyOperator_Update( ctx, out, in1 )
     LogMessage in1
     ..
    end function



Remember the scop file has to be on a network drive.


Sebastian



-----Ursprüngliche Nachricht-----
Von: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] Im Auftrag von
peter boeykens
Gesendet: Donnerstag, 4. Oktober 2007 10:22
An: XSI(at)Softimage.COM
Betreff: Re: [script] how to create a scripted op with vbscript?


thanks Stephen I'll try it out later today - but it looks like just what I 
needed.

something I was having difficulties with was how to use the " character 
within a string.
the Chr(10)'s are enters / end of line, right?

Is it the (only?) correct way to put the code as a sub on the bottom pane of

the scripted operator editor?

Until now I just typed my code in the top pane, and that worked, but  I 
noticed that when applying a scop through scripting it puts the code in the 
bottom pane. So I was a bit confused by that.


----- Original Message ----- 
From: "Stephen Blair" <Stephen_Blair(at)Softimage.COM>
To: <XSI(at)Softimage.COM>
Sent: Wednesday, October 03, 2007 9:41 PM
Subject: RE: [script] how to create a scripted op with vbscript?

str = "sub fred_Update( ctx, out )" & Chr(10) _
& "   LogMessage ""fred::Update()""" & Chr(10) _
& "   out.Value = 2" & Chr(10) _
& "end sub"

'NewScene null, false
GetPrim "null"

Application.LogMessage "posx = " & GetValue( "null.kine.local.posx" )

dim op
set op = AddScriptedOp( "null.kine.local.posx", str ,null,"fred" )

Application.LogMessage "posx = " & GetValue( "null.kine.local.posx" )

________________________________

From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf
Of peter boeykens
Sent: Wed 03 October 2007 2:19 PM
To: XSI(at)Softimage.COM
Subject: [script] how to create a scripted op with vbscript?


it sounds trivial, but I spent all day trying to get it to work,
applying a scripted operator from a script, in vbscript.
contrary to most of the docs that have plenty vbscript examples, I didnt
find an example of how to this.
its the command I'm after, but rather how to feed it the code part.

if someone could point me in the right direction, and where to find
"scripted operators for newbies" info?
you're very welcome to RTFM me :-)

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi 

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.