Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reading array parsed via FPValue in C++ SDK

4 REPLIES 4
Reply
Message 1 of 5
chameeraMG9HS
442 Views, 4 Replies

Reading array parsed via FPValue in C++ SDK

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.

4 REPLIES 4
Message 2 of 5

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

Message 3 of 5

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?

Message 4 of 5

how do you pass "cmdStr" variable (argument) to SDK? Depending on it you can find a way to pass an Array value

Message 5 of 5

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report