----- Original Message -----
Sent: Thursday, December 01, 2005 12:47
PM
Subject: RE: arguments for a self
Installed Plugin function
I
think this may be a safe array / JScript array problem.
When you use siArgumentInput, you'll get a safe array in the Execute
callback.
Maybe you want to add your arg like this
oArgs.Add( "in_array", siArgumentInput, 0, siDispatch ); // JScript array
-----Original Message-----
From: owner-xsi(at)Softimage.COM
[mailto:owner-xsi(at)Softimage.COM]
On Behalf Of Greg
Smith
Sent: Thu 01 December 2005 3:38 PM
To:
XSI(at)Softimage.COM
Subject: arguments for a self Installed Plugin
function
I was curious if anyone can help me with this
problem. I am having trouble trying to pass in an array of objects
into a self installed plugin function. To be more specific, I have
a function that uses the file system object to return an array of folder
objects. This function works fine, however when I try to use that array as
an imput argument for another function, everything gets fubarred. As a
test I run a test using typeof() function to see what is stored in the first
index of the array before and after the array is passed into the problematic
function. Prior to being passed into the function the typeof() returns
"object" after being passed in the function the typeof() returns
"undefined". So I have narrowed down that the problem is when the array is
passed in as an argument. Interestingly enough if thes are not run as
a self installed plugin but rather part of the script I am using the
function in, it works perfectly fine. I just want the modularity of having
several script files rather than one monolithic script.
So here is a cut down version of the
problematic function(s) in my self installed plugin script
file.
//INIT
function myFunction_Init( in_ctxt
)
{
var cmd =
in_ctxt.Source
var noValue
cmd.ReturnValue =
true;
cmd.Arguments.Add( "in_array" ,
siArgumentInput );
}
//EXECUTE
function
myFunction_Execute(in_array)
{
LogMessage(typeof(in_array[0]));
}
Thanks,
Greg Smith
Stan Winston
Studio