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

Started by
0 comments, last by Alload 22 years, 2 months ago
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;
}

  
Advertisement
Try returning "Standard" from ClassDesc::Category. That''s the only obvious difference compared to our exporter.



--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement