Archived

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

Alload

[MAX] A plugin that doesn't appear in the export list

Recommended Posts

Alload    122
I wrote the beginning of a scene exporter plugin for 3D Studio MAX, but my plugin doesn''t appear in the list of format available in the EXPORT menu. Concerning the DllMain function, I''m sure the function is called by MAX because I have put a Message Box every time the function is called. Here''are the plugin code, if you could try to see what''s wrong:
  
HINSTANCE hInstance = NULL;
int controlsInit = FALSE;

extern "C" BOOL WINAPI DllMain(HINSTANCE hInstanceDLL, DWORD dwReason, LPVOID lpvReserved)
{
	hInstance = hInstanceDLL;

	if (!controlsInit)
	{
		controlsInit = TRUE;
		InitCustomControls(hInstance);	//Initialisation des contrôles de MAX

		InitCommonControls();			//Initialisation des contrôles de Windows

	}

	return TRUE;
}

///////////////////////////////////////////////////////////////////


class CPluginDesc : public ClassDesc
{
public:
	int IsPublic() {return 1;}
	void* Create(BOOL loading = FALSE) {return new CExport;}
	const TCHAR* ClassName() {return _T("MAX Export class");}
	SClass_ID SuperClassID() {return SCENE_EXPORT_CLASS_ID;}
	Class_ID ClassID() {return Class_ID(0x49232852, 0x75804d71);}
	const TCHAR* Category() {return _T("");}
};

static CPluginDesc plugindesc;

extern ClassDesc* GetPluginDesc()
{
	return &plugindesc;
}

///////////////////////////////////////////////////////////////////


class CExport : public SceneExport
{
public:
	CExport() {}
	~CExport() {}

	int ExtCount() {return 1;}
	const TCHAR *Ext(int i) {if (i == 0) return _T("MTD"); else return _T("");}
	const TCHAR *LongDesc() {return _T("Exporteur de MAX à Direct3D");}
	const TCHAR *ShortDesc() {return _T("MAX à Direct3D");}
	const TCHAR *AuthorName() {return _T("Arnaud");}
	const TCHAR *CopyrightMessage() {return _T("");}
	const TCHAR *OtherMessage1() {return _T("");}
	const TCHAR *OtherMessage2() {return _T("");}
	unsigned int Version() {return 100;}
	int SupportsOptions(int ext, DWORD options) {return FALSE;}

	void ShowAbout(HWND hWnd);
	int DoExport(	const TCHAR *name, ExpInterface *ei, Interface *i,
					BOOL suppressPrompts = FALSE, DWORD options = 0);
};

///////////////////////////////////////////////////////////////////



extern "C" __declspec(dllexport) const TCHAR* LibDescription()
{
	return _T("Exportation de scènes 3D Studio MAX");
}

extern "C" __declspec(dllexport) int LibNumberClasses()
{
	return 1;
}

extern "C" __declspec(dllexport) ClassDesc* LibClassDesc(int i)
{
	switch (i)
	{
	case ''0'':
		return GetPluginDesc();
		break;

	default:
		return 0;
		break;
	}
}

extern "C" __declspec(dllexport) ULONG LibVersion() 
{
	return VERSION_3DSMAX;
}

  

Share this post


Link to post
Share on other sites