Archived

This topic is now archived and is closed to further replies.

To those who know about 3DSMAX's plugins

This topic is 5795 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wrote the beginning of a scene exporter plugin for 3D Studio MAX 4. Then I have put the plugin in the plugins folder of MAX and I launched MAX. And there''s an error while MAX loads my plug: "The LibVersion function is not implemented." However there''s the LibVersion() in my code: __declspec(dllexport) ULONG LibVersion() { return VERSION_3DSMAX; } And the def file looks good: LIBRARY MAX Plugin EXPORTS LibDescription @1 LibNumberClasses @2 LibClassDesc @3 LibVersion @4 SECTIONS .data READ WRITE So if anyone could help me to get it working. Thanks

Share this post


Link to post
Share on other sites
First, I''m sorry in so much as I don''t have max...

but I think I can guess what your problem is

Basically I looks like you want to export a C style name & I guess you''re doing it from a C++ compiler

The thing is that the C++ compiler mangles the function names, the way to get around this is to have an extern "C" prototype for the function in the header file, ie

  
extern "C" __declspec(dllexport) ULONG LibVersion(void);


(or if you''re not using a header for the project just put it at the top of the source file

Share this post


Link to post
Share on other sites
The only thing I can think of is the calling convention. Did you change the default CC to somthing other than cdecl?

Otherwise, it looks exactly like how I have done it.

Share this post


Link to post
Share on other sites
Another problem.

As a scene exporter based on the SceneExport class, my plugin should be available in the EXPORT menu, shouldn''t it?

But it does not appear in it...

I dunno where the error comes from, because MAX loads my plugin without any error message.

Is there anything special which has to be done to make the plugin appear in the EXPORT menu?

Share this post


Link to post
Share on other sites
I assume you rememebered to do extern "C" on all the functions that need to be exported...

Otherwise you''ll just have to go back to the docs & examples...

Stick some messageboxes or debug messages that somehow flash up at points through your plugin...

Share this post


Link to post
Share on other sites