Notifications
Clear all

[Closed] How to create a new Utility Class?

First of all, maybe I have to write some context.
Here is 3DMax2010, I have my own max plugin working, which is basically a mesh exporter. When I need to execute the export, go to the Menu->Export->select the file etc… This is too time consuming, so I want to create a single button export for such purpose. Since am going to keep upgrading it, the best IMO, is to have an specific utility where one click button can export whatever I need, later I can easily add more script code for the new functionality.

Reading the MaxScript documentation I found you can have

utility MyUtility "MyName" (
...
)

But this seems too limited ’cause it lays inside the MaxScript Utility class, i need to have it in a separate utility class, guessing, but haven’t found any reference in the doc either from MxSDK or Script. I read on a post years ago (2005), that wasn’t possible, but am sure i have seen this recently, how could I implement that?

4 Replies

I never played with the SDK so can’t help with code, but of’cuz its possible.
There’s examples in “OUR_MAX_VERS_SDK\maxsdk\howto\utilities” folder

#include "utilapi.h"
class ExportMeshesUtil : public UtilityObj
{
	// ...
}

Thank you, that’s right. I finally got it, those custom controls are very picky, but I think they are finally set up. Although my new dlu is correctly loaded, doesn’t display in my utilities list (or using utilitypluign.classes in the maxscript listener). It perfectly matches the settings of the howto\utilities example, need more time to figure out now what’s wrong… any hint will be appreciated.

[Edit] don’t know if the order of the def file matters, the @1, @2, but using the same order as in the example it worked.

Wouldn’t it be easier to just create a small macroscript with one or more “max export” commands calling the SDK exporter you already have? Or am I misunderstanding the issue?

@Pjanssen It would also work, but I already manage to have a dlu plugin calling my exporter using

GetCOREInterface()->ExportToFile

and is very extensible and flexible.