PDA

View Full Version : Accessing Maxscript utility properties from C++


SaladFingers
07-07-2005, 12:47 AM
I have a transform controller plugin I created, and I want to write a maxscript utility plugin that exposes all of my custom controllers currently in the scene. The modeler should be able to add/remove from this list and modify the controllers' properties and all that good stuff.

I understand how to do this in maxscript but I'm having trouble with my importer and exporter. The importer and exporter are written in C++ and need access to my global list of transform controller plugins. But if this global list is maintained in a maxscript utility plugin, how can I access it in C++?

Some ideas I have: 1) Forget about maxscript and instead write a max utility in C++ that manages the controller list and use function publishing to expose the appropriate functions to the importer/exporter. This is probably a valid option but I'd prefer not to do this since writing the utility in C++ would be a lot more work than doing it in maxscript. Also I'm still not sure how the importer/exporter would retrieve the utility plugin object to call functions on it. 2) Use the ExecuteStringScript() method of the GUP class to make maxscript calls. This would probably work but seems like a hack.

Any help is appreciated.

SaladFingers
07-21-2005, 06:45 AM
I realize this forum isn't geared toward C++ max plugins, and that's probably why I never got a reply to my question. Nevertheless I'll describe the solution just in case anyone has a similar problem in the future.

To get the C++ importer/exporter talking to the maxscript utility, I made another (C++) controller plugin and create a single instance of this controller and attach it to a hidden node in the scene. The user never sees this hidden node/controller setup, but both the importer/exporter and the maxscript utility can communicate with it by searching through the scene for an instance of the private controller. Once the controller is found the communication happens with the standard parameter block system and function publishing. So the importer/exporter and maxscript utility plugins never talk to each other directly, rather they both talk to the single hidden controller plugin instance. The maxscript utility just acts as the UI for the hidden controller.

CGTalk Moderation
07-21-2005, 06:45 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.