Remember 3December
Find out where to celebrate your 3D CG art...
Theme color:
  • 1/3
You are here: Homepage /  Blogs /  The 3ds Max SDK Blog / Don't use the SDK when MAXScript will do.
Don't use the SDK when MAXScript will do.
Posted: Sep 15, 2009
Category:
Social Media:
Bookmark and Share

Sure it may take a bit of time to figure out what few lines of MAXScript you may need sometime to accomplish a desired task, but it is much quicker and flexible to use MAXScript in many cases than the SDK. Since I have been learning the Max SDK, I see SDK based solutions everywhere, and have been guilty of overlooking MAXScript (though to be fair, I am supposed to document the SDK, not MAXScript). 

A great example of this is a post I found on the forums at http://area.autodesk.com/forum/autodesk-3ds-max/sdk/how-to-use-fbx-sdk-to-creat-an-export-plugin-for-3dsmax/page-last/:

Hello,
I have to create a plug-in for 3dsmax that export all the scene in a collada format. I tried to create an export plug-in with 3dsmax SDK. SetFileFormat(pFileFormat) in my plug-in. Any idea please?
Thank you very much.

What this person wanted can be achieved in just a few lines of MAXScript. My response was this:

Writing FbX plugins is a lot of work. You can get the FbX SDK here (http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=6839916).

However, I think the best route to achieve what you want is to use MAXScript to automate the export to FBX and to launch the existing converter. Look for the topic “FBX Export Dialog Access” in the MAXScript reference. Then you will want to run your Collada to X converter program from MAXScript using DosCommand or ShellLaunch. Search for “Executing External Commands and Programs” in the MAXScript documentation.

In some cases what we need can be achieved by mixing MAXScript with 3ds Max. Consider using the function "ExecuteMAXScriptScript()" in your SDK programs more often! This can be an easy way to transition a script into a full-fledged plug-in.

My resolution for after the next 3ds Max release is to become more fluent at MAXScript. Something that I strongly recommend for everyone using the 3ds Max SDK.

In order to post any comments, you must be logged in!
Newest users comments View All 3 Comments
Posted by Christopher Diggins on Oct 13, 2009 at 09:05 AM
These are excellent points. I am researching ways to simplify and explain function publishing so that it is easier to extend MAXScript with new functions and objects. Your suggestions help push this higher up on the priority list.
Posted by Martin Breidt on Oct 12, 2009 at 05:50 AM
Good advise, but maybe there should be more documentation on how to interface between MAXScript and the SDK.
Examples: How do I develop a new MXS function, using the SDK? How do I call MAXScript from C++/SDK? How do I pass variables between them? How do I expose my SDK functions to MXS? Documentation and a set of examples (from simple to complicated) would be nice.
Posted by olaffinkbeiner on Sep 16, 2009 at 04:34 PM
Hi Christopher,
this is a very good advice. Maxscript is very powerfull in many situations. Have you documented how to extend maxscript in the SDK Documentation? It seems very complicated as quite a lot of stuff is missing in Maxscript and some 3rd party plugins cant be controlled properly via Maxscript...

kind regards

Olaf