3ds Max is renowned for its customization abilities.To facilitate this even more, support for many languages was added along the way.
At the beginning it was just MAXScript, followed by the powerful C++ SDK, but to open the power of 3ds Max to a wider modern developing audience, support for .NET and Python has been included.
Now 3ds Max is ready to take the next step and provide it's API to be used through one of the most popular languages (according to data provided by GitHut and RedMonk); the all mighty Web Language King - ECMAScript, or better known under its pseudonym: JavaScript.
3ds Max took the same path as Node.js did and integrated the powerful Google V8 JavaScript engine, with all its inherited strengths and weaknesses.
From an API perspective, we tried to keep the same approach as with Python and .NET API, thus allowing a smooth transition between these 3 languages.
In this small code sample here, you may see the clearness and elegance of this language when used with 3ds Max SDK:
let my_object = new MaxPlus.CreateGeomObject(MaxPlus.ClassIds.Cylinder);
my_object.setValue(Radius, 10.0);
my_object.setValue(Height, 30.0);
let my_node = new MaxPlus.CreateNode(my_object);
let my_mod = new MaxPlus.CreateObjectModifier(MaxPlus.ClassIds.Bend);
my_mod.setValue(BendAngle, 45.0);
my_node.AddModifier(mod);
MaxPlus.MaxScript.log("Created cylinder with bend modifier.");
From the syntax you can see that we went directly with supporting the Sixth Edition, known as ECMAScript 2015, which soon will be widely adopted.
Moreover, the ability of creating modules and importing them is also here, and it is following the CommonJS approach, thus allowing use of third party libraries along with our own:
const MaxPlus = require("3dsmax_core");
The new language wouldn't be enough without a proper set of tools, and we are well aware that there are plenty of JavaScript IDEs over there, but we want to make JavaScript a first class citizen within 3ds Max, perhaps with a later complete replacement of the MaxScript, this is why we are starting to give a special attention to an integrated solution for JavaScript in 3ds Max (Click on image to see the video illustration):
Image may be NSFW.
Clik here to view.
Conclusion:
It is important to accept the power of a language in a certain context, this is why we consider that 3d is the excellent place for using JavaScript and 3ds Max is just the beginning. This is "going viral" now and some similar work is also being made for Maya (for more details, look at our Maya dedicated Blog).
|
|
|
|
|
|
|
|
|
_ _ ______ _ _
/\ (_) | | ____| | ( )
/ \ _ __ _ __ _| | | |__ ___ ___ | |/ ___
/ /\ \ | '_ \| '__| | | | __/ _ \ / _ \| | / __|
/ ____ \| |_) | | | | | | | | (_) | (_) | | \__ \
/_/ \_\ .__/|_| |_|_| |_| \___/ \___/|_| |___/
| |
|_|
For real technology using JavaScript, check out the Forge platform: forge.autodesk.com
Image may be NSFW.Clik here to view.
