View Full Version : SDK Question - using Max's variable types in Visual Studio
09-03-2009, 04:13 PM
I'm doing my first steps in programming with Max's SDK, and I find it very frustrating, for someone who used to get the answers quickly from Microsoft's MSDN - I'm kind of lost when it comes to Max's SDK reference.
I hope someone would be able to help me with couple of very basic consepts that I don't get:
I'm trying to create a DLL for reading and writing files, that will return to Max the information in the files in a format Max can understand.
my question is, how can I return to Max the variables types that it used to, for instance:
how do I return 'undefined'? is it the same as 'null'?
how can I return an array that it's first index is 1 and not 0?
how can I return to Max a variable that can be any type? (for example a variable that can be sometimes a number and sometimes text)
I will appritiate any light on this subject
09-04-2009, 05:50 PM
'undefined' in c++ ?
arrayindices starting with 1 in c++ ?
a variable that can be sometimes a number and sometimes text in c++ ?
09-04-2009, 09:08 PM
that's what I'm asking, does Max's SDK offer variable Types of it's own, that I should use (for example use the SDK's 'Array' class instead of regular array) or should I use C++ types.
What do expirienced SDK programers do?
09-04-2009, 09:20 PM
you can find (almost) all the answers in 3ds Max 2010 SDK Help (http://usa.autodesk.com/adsk/servlet/pc/index?id=13577829&siteID=123112) in the section:
- 3ds Max SDK Programmer's Guide
- 3dsMax Features
- MAXScript Scripting Engine and relative subsections
Be sure to take a look at code samples that ships with the SDK, in folder:
..\maxsdk\samples\maxscript\axsagni is a gold mine.
09-05-2009, 09:41 AM
Thank you for your answer Enrico!
that section do shed some light on the subject, I found that I can do:
and that functions should generally return value of the type: Value*
I will take a close look on the code samples you mentioned, Thanks again!
09-05-2009, 10:23 AM
I'm glad it helped, I went through the same steep path months ago, but in the end it's fairly rewarding. I forgot to mention to take a look at:
too, since code in SDK Help was sometimes buggy, in particular IntervalArray, while the one in those folders works.
In matter of MXSAgni, take a look at file polyop.cpp, as it shows how the MaxScript polyOp structure is built, to see how in and out parameters for each method are handled between C++ and MXS.
09-05-2009, 10:23 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.