forked from blurstudio/Py3dsMax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blurPython.cpp
64 lines (48 loc) · 1.82 KB
/
blurPython.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
\file blurPython.cpp
\remarks Entry point for the blurPython dlx
\author Blur Studio (c) 2010
\email beta@blur.com
\license This software is released under the GNU General Public License. For more info, visit: http://www.gnu.org/
*/
#include "imports.h"
#pragma comment( lib, "comctl32.lib" )
//------------------------------------------------------------------------------------------------------
HMODULE hInstance = NULL;
HINSTANCE g_hInst;
BOOL APIENTRY DLLMain( HMODULE hModule, DWORD ul_reason, LPVOID lpReserved ) {
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof( icex );
icex.dwICC = ICC_TREEVIEW_CLASSES | ICC_LISTVIEW_CLASSES;
switch ( ul_reason ) {
case DLL_PROCESS_ATTACH: {
hInstance = hModule;
g_hInst = hModule;
DisableThreadLibraryCalls( hModule );
break;
}
case DLL_PROCESS_DETACH: {
// Kill the python system
Py_Finalize();
}
}
return TRUE;
}
// the init_module function is found in the studiomax_module file
PyMODINIT_FUNC init_module();
__declspec( dllexport ) int LibInitialize(void)
{
init_module();
return TRUE;
}
__declspec( dllexport ) const TCHAR* LibDescription() { return _T( "Py3dsMax Python Extension" ); }
__declspec( dllexport ) ULONG LibVersion() { return VERSION_3DSMAX; }
// Maxscript 2012 requires these additional exports
#if __MAXSCRIPT_2012__ || __MAXSCRIPT_2013__ || __MAXSCRIPT_2015__
// we aren't defining any classes in this plugin, so this is pretty easy
// other plugins should refer to samples/scriptplugin for an example of the new
// registration system - that is the only plugin that does not error out of the samples
// in max
__declspec( dllexport ) int LibNumberClasses() { return 0; }
__declspec( dllexport ) ClassDesc* LibClassDesc( int i ) { return 0; }
#endif