Notifications
Clear all

[Closed] Tying MAXScript struct values to C++ functions

Hello all, I’m working on a rendering plugin for max and recently got a request from a user to allow setting render options through MAXScript.

Looking over the Max documentation, it seems the way to do this is to create a MAXScript global struct that has its parameters exposed as described here for the scanline renderer.

My question is: How can I create a global MAXScript struct that has its values driven by c++ code? Or is there a better way to achieve this?

For example if I have the following c++ functions

int getSomeValue();
void setSomeValue(int value);

I would want the global struct to have an integer member named someValue that calls getSomeValue when it is read and setSomeValue when a script assigns a value to it.

2 Replies

You need to look into setting up an FPInterface (function publishing interface) for your plugin. That will allow you to expose whatever values you want to maxscript for scripting intput/output. The SDK samples and help files have lots of examples of how to set this up.

Thanks, that looks like exactly what i need.