Maxscript enums

Hi all,
Is there any way to define enums in maxscript?

MaxScript has no native enum capabilities, no. You can define a mapping with the dictionary type if you’re running a version of Max that is new enough - 2019 or later I believe.

1 Like

Dictionaries became a thing in 2018.
But then you might as well make an enum in python and access it via maxscript, I have done this a number of times.

1 Like

I know this may be obnoxious, but why continue to code using MAXScript? Python isn’t great for enums, but you can sort of do them with static class variables.

Converting an entire legacy pipeline from MaxScript to Python is non-trivial. So sometimes you have to keep using MaxScript. :smiley: As for enums, I used MaxScript’s C# .net interface for a lot of that kind of stuff when I was still writing MaxScript. Generally, I wrote all of my tools in C# / WPF and then just used MaxScript for event handling in Max.