Im a maya Rigger (sometimes venturing to low level TA work :D), so i use Mel and Python heavily. Im now faced with using Max regularly, porting tools and plugins across, and need to get to grips with scripting in it… quick.
So my question is…
Whats the best language to go for? All the scripting tutorials I’ve found so far are MAXScript and while im sure its a solid language I’d really rather not learn something so niche. I’ve heared somewhere that Max supports C#, but honesly im finding it tricky getting notes on this. Can you use c# as a substitute for MAXScript? Are there any other supported languages? Again if I’m going to spend time learning another language I’d really rather it be something I can use elswhere, which is why I migrated from mel to python :D.
You options for programming in 3ds max are C++ or MAXScript. In MAXScript you are able to use C# as part of your scripts - you cannot directly execute 3ds max commands from C#.
You can use C# as your interface library and listen for change events in your MAXScript to execute the commands.
I recently read this analogy from another technical artist:
“You have to treat Max like a lady, you can’t just shove it (C# code) in wherever you want”.
Apparently you can get some IronPython support for Max 2011+, though it is not an official part of Max going forward (yet).
You could also use MaxSharp, the .NET wrapper for the SDK, though you won’t be able to do a lot of things.
You can work in C++, but the Max SDK is not something I’d learn lightly and will probably be more niche than learning MXS.
So I’d just go ahead and use MaxScript. It is a pretty terrible language by some accounts, but if you’re used to using Python it probably isn’t that bad.
There are a number of ways to use C# in Max, but like Dennis said, you need to call it from script. There are more and less complex ways of doing so, and there are lots of tutorials available. I’d suggest doing as much in C# as possible, and thinking carefully about how you interface with MXS and C#.
If you’re having trouble with specific things, feel free to ask on the forums or IRC, there are a number of us here who have a lot of experience with the problems you’ll experience.
Unfortunately, your options will be limited for rigging and using C#- you’re probably going to have to learn a good deal of maxscript, or come up with some ingenious system for manipulating the rigs through C#.
For now, Maxscript/C# is the only reasonable option. Maxscript has its strengths, though some things about it are annoying (inconsistencies, legacy support, etc.), it won’t take too long to get up and running.
I’ve helped some artists here learn the basics of Maxscript in a short amount of time, so it’s nothing too complex.
But as Rob said, doing as much stuff as you can in C# would be a great choice, as C# is a lovely language and platform to build upon, especially mixed with Visual Studio (Express or Pro) and all the solutions .NET provides.
Great, thanks all for the info guys. I really appreciate it.
I’ve got a little ramp up time to learn this stuff, so I’ve got to use my time wisely. Also seeing I have to re-learn Max too (haven’t used it in six years!!!), and get to a quite high level, I doubt I’ll have the time to learn two new languages. Though, I do know some C++ so I’d hope that I’d be able to pickup C# reasonably quickly. So I’ll probably just learn MAXScript first, so I can get tools ported as quickly as we can. Though, I will take a peek at C# soon, I’ve heard good things about it ;D.
Just learn only what you need from MaxScript. If you are going to do any rigging all the script controllers and expressions only use MaxScript. I don’t “know” JavaScript, but I’ve created several Photoshop tools.
The listener isn’t as helpful as Maya’s, but the MaxScript help file is very well done.