Let's assume that I have a maxscript witch returns a constant array with sub arrays as below.
myArray = #( #(1,2,3), #(4,5,6), #(7,8,9), #(10,11,12) )
I'm calling a maxscript that returns above array in C++.
FPValue fpv; ExecuteMAXScriptScript( cmdStr, false, &fpv );
How can I read array from a FPValue? I need to get elements in sub arrays of the returned array.
why do you want to make your life more complicated?
is it not easier to read (get) an Array than a FPValue?
whatever... if you do everything right the FPValue will get an Array value in .v property
Thank you for the answer.
Could you please elaborate "is it not easier to read (get) an Array than a FPValue?".
Is there an easier way to return multiple values from maxscript and get it to C++ end?
how do you pass "cmdStr" variable (argument) to SDK? Depending on it you can find a way to pass an Array value
Value of the cmdStr is,
fileIn "path/to/maxscript/script.ms"
Content of maxscript,
( abcd = 0 fn MyFunc = ( myArray = #( #(1,2,3), #(4,5,6), #(7,8,9), #(10,11,12) ) return myArray ) on execute do ( abcd = MyFunc() abcd ) )
It is executed as,
ExecuteMAXScriptScript( "fileIn \"path/to/maxscript/script.ms\"", false, &fpv )
I was not been able to read returned array from fpv.v