diff -r 67fbc5c123ba code/CMakeModules/Find3dsMaxSDK.cmake
--- a/code/CMakeModules/Find3dsMaxSDK.cmake	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/CMakeModules/Find3dsMaxSDK.cmake	Wed Jul 27 21:08:19 2011 +0200
@@ -17,6 +17,7 @@
   "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/include"
   "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/include"
   "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/include"
+  "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk/include"
 ) 
 
 find_path(MAXSDK_CS_INCLUDE_DIR bipexp.h
@@ -26,6 +27,7 @@
   "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/include/CS"
   "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/include/CS"
   "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/include/CS"
+  "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk/include/CS"
 )
 
 MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)          
@@ -37,6 +39,7 @@
                "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/lib"
                "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/lib"
 			   "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/lib"
+			   "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk/lib"
                )               
 ENDMACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
 
@@ -65,6 +68,12 @@
       ${MAXSDK_MAXSCRIPT_LIBRARY}
       ${MAXSDK_PARAMBLK2_LIBRARY}
       ${MAXSDK_BMM_LIBRARY} )
+	  
+	  if(IS_DIRECTORY "${MAXSDK_INCLUDE_DIR}/maxscript")
+		ADD_DEFINITIONS(-DDSMAX2012=1)
+		MESSAGE(STATUS "Added Definition -DDSMAX2012=1 ")
+	  endif(IS_DIRECTORY "${MAXSDK_INCLUDE_DIR}/maxscript")
+			
 
 else(MAXSDK_FOUND)
     set(MAXSDK_LIBRARIES)
diff -r 67fbc5c123ba code/nel/tools/3d/ligo/plugin_max/DllEntry.cpp
--- a/code/nel/tools/3d/ligo/plugin_max/DllEntry.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/ligo/plugin_max/DllEntry.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -41,6 +41,9 @@
 
 	hInstance = hinstDLL;				// Hang on to this DLL's instance handle.
 
+#ifdef DSMAX2012
+#else
+
 	if (!controlsInit) 
 	{
 		controlsInit = TRUE;
@@ -48,6 +51,8 @@
 		InitCommonControls();			// Initialize Win95 controls
 	}
 
+#endif // DSMAX2012
+
 	// initialize nel context
 	if (!NLMISC::INelContext::isContextInitialised())
 		new NLMISC::CApplicationContext();
diff -r 67fbc5c123ba code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp
--- a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -17,7 +17,11 @@
 #include <assert.h>
 
 // From MAXSDK
-#include <MaxScrpt/maxscrpt.h>
+#ifdef DSMAX2012
+#include <maxscript/maxscript.h>
+#else
+#include <Maxscrpt/maxscrpt.h>
+#endif // DSMAX2012
 
 #include "max_to_ligo.h"
 
diff -r 67fbc5c123ba code/nel/tools/3d/ligo/plugin_max/script.cpp
--- a/code/nel/tools/3d/ligo/plugin_max/script.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -19,7 +19,21 @@
 #include <assert.h>
 
 // Various MAX and MXS includes
-#include <MaxScrpt/MAXScrpt.h>
+
+#ifdef DSMAX2012
+#include <maxscript/maxscript.h>
+#include <maxscript/foundation/3dmath.h>
+#include <maxscript/foundation/numbers.h>
+#include <maxscript/maxwrapper/maxclasses.h>
+#include <maxscript/foundation/Streams.h>
+#include <maxscript/foundation/mxstime.h>
+#include <maxscript/maxwrapper/mxsobjects.h>
+#include <maxscript/compiler/parser.h>
+#include <max.h>
+#include <stdmat.h>
+#include <maxscript/foundation/functions.h>
+#else
+#include <Maxscrpt/maxscrpt.h>
 #include <MaxScrpt/3dmath.h>
 #include <MaxScrpt/Numbers.h>
 #include <MaxScrpt/MAXclses.h>
@@ -30,6 +44,7 @@
 #include <max.h>
 #include <stdmat.h>
 #include <MaxScrpt/definsfn.h>
+#endif // DSMAX2012
 
 // Visual
 #include <direct.h>
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp
--- a/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -39,12 +39,17 @@
 	hInstance = hinstDLL;				// Hang on to this DLL's instance handle.
 
 	NL3D::registerSerial3d();
+
+#ifdef DSMAX2012
+#else
 	
 	if (!controlsInit) {
 		controlsInit = TRUE;
 		InitCustomControls(hInstance);	// Initialize MAX's custom controls
 		InitCommonControls();			// Initialize Win95 controls
 	}
+
+#endif // DSMAX2012
 			
 	return (TRUE);
 }
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp
--- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -16,7 +16,11 @@
 
 #include "std_afx.h"
 #include "nel_export.h"
+#ifdef DSMAX2012
+#include <maxscript/foundation/strings.h>
+#else
 #include <MaxScrpt/strings.h>
+#endif // DSMAX2012
 #include "../nel_mesh_lib/export_nel.h"
 #include "../nel_mesh_lib/export_appdata.h"
 
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_export/std_afx.h
--- a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h	Wed Jul 27 21:08:19 2011 +0200
@@ -26,16 +26,31 @@
 #include <utilapi.h>
 #include <shlobj.h>
 #undef STRICT
-#include <MaxScrpt/maxscrpt.h>
+#ifdef DSMAX2012
+#include <maxscript/maxscript.h>
+#include <maxscript/foundation/3dmath.h>
+#include <maxscript/foundation/numbers.h>
+#include <maxscript/maxwrapper/maxclasses.h>
+#include <maxscript/foundation/Streams.h>
+#include <maxscript/foundation/mxstime.h>
+#include <maxscript/maxwrapper/mxsobjects.h>
+#include <maxscript/compiler/parser.h>
+#include <max.h>
+#include <stdmat.h>
+#include <maxscript/foundation/functions.h>
+#else
+#include <Maxscrpt/maxscrpt.h>
 #include <MaxScrpt/3dmath.h>
-#include <MaxScrpt/numbers.h>
-#include <MaxScrpt/maxclses.h>
-#include <MaxScrpt/streams.h>
-#include <MaxScrpt/mstime.h>
-#include <MaxScrpt/maxobj.h>
-#include <MaxScrpt/parser.h>
+#include <MaxScrpt/Numbers.h>
+#include <MaxScrpt/MAXclses.h>
+#include <MaxScrpt/Streams.h>
+#include <MaxScrpt/MSTime.h>
+#include <MaxScrpt/MAXObj.h>
+#include <MaxScrpt/Parser.h>
+#include <max.h>
 #include <stdmat.h>
 #include <MaxScrpt/definsfn.h>
+#endif // 3DSMAX2012
 #include <animtbl.h>
 #ifdef min
 #undef min
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h
--- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h	Wed Jul 27 21:08:19 2011 +0200
@@ -32,7 +32,11 @@
 #include <stdmat.h>
 #include <shaders.h>
 #include <iparamb2.h>
+#ifdef DSMAX2012
+#include <maxscript/maxscript.h>
+#else
 #include <Maxscrpt/maxscrpt.h>
+#endif // 3DSMAX2012
 //#include <parser.h>
 
 // Character Studio SDK include
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp
--- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -260,7 +260,12 @@
 			if (strcmp (paramDef.int_name, sName)==0)
 			{
 				// ok, return this subanim
+#ifdef DSMAX2012
+//Deprecated in 3ds Max 2012. Use GetControllerByID instead.
+				return param->GetControllerByID(id);
+#else
 				return param->GetController(id);
+#endif // DSMAX2012
 			}
 		}
 	}
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_mesh_lib/export_script.cpp
--- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_script.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_script.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -15,8 +15,14 @@
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "stdafx.h"
+#ifdef DSMAX2012
+#include <maxscript/compiler/parser.h>
+#include <maxscript/foundation/strings.h>
+#else
 #include <MaxScrpt/parser.h>
 #include <MaxScrpt/strings.h>
+#endif // DSMAX2012
+
 #include "export_nel.h"
 #include "export_appdata.h"
 
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_patch_converter/DllEntry.cpp
--- a/code/nel/tools/3d/plugin_max/nel_patch_converter/DllEntry.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/DllEntry.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -54,6 +54,10 @@
 	if (!NLMISC::INelContext::isContextInitialised())
 		new NLMISC::CApplicationContext();
 	nlassert(hInstance);
+
+#ifdef DSMAX2012
+#else
+
 	if (!controlsInit) 
 	{
 		// This method has been deprecated.
@@ -61,6 +65,9 @@
 		InitCustomControls(hInstance);	// Initialize MAX's custom controls
 		InitCommonControls();			// Initialize Win95 controls
 	}
+
+#endif // DSMAX2012
+
 	return (TRUE);
 }
 
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp
--- a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -22,24 +22,41 @@
 #define _CRT_SECURE_NO_DEPRECATE
 
 #include <assert.h>
-#include <MaxScrpt/maxscrpt.h>
+#ifdef DSMAX2012
+#include <maxscript/maxscript.h>
+#include <maxScript/foundation/3dmath.h>
+#else
+#include <Maxscrpt/maxscrpt.h>
 #include <MaxScrpt/3dmath.h>
+#endif // 3DSMAX2012
+
 
 // Various MAX and MXS includes
+#ifdef DSMAX2012
+#include <maxscript/foundation/numbers.h>
+#include <maxscript/maxwrapper/maxclasses.h>
+#include <maxscript/foundation/Streams.h>
+#include <maxscript/foundation/mxstime.h>
+#include <maxscript/maxwrapper/mxsobjects.h>
+#include <maxscript/compiler/parser.h>
+#include <maxscript/foundation/functions.h>
+#else
 #include <MaxScrpt/Numbers.h>
 #include <MaxScrpt/MAXclses.h>
 #include <MaxScrpt/Streams.h>
 #include <MaxScrpt/MSTime.h>
 #include <MaxScrpt/MAXObj.h>
 #include <MaxScrpt/Parser.h>
+// define the new primitives using macros from SDK
+#include <MaxScrpt/definsfn.h>
+#endif // DSMAX2012
 #include <modstack.h>
 #include <decomp.h>
 
 #include <max.h>
 #include <stdmat.h>
 
-// define the new primitives using macros from SDK
-#include <MaxScrpt/definsfn.h>
+
 
 #undef _CRT_SECURE_NO_DEPRECATE
 
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp
--- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -36,7 +36,8 @@
 	{
 		hInstance = hinstDLL;
 		DisableThreadLibraryCalls(hInstance);
-		
+#ifdef DSMAX2012
+#else
 		if (!controlsInit) 
 		{
 			controlsInit = TRUE;
@@ -53,6 +54,7 @@
 			// initialize Chicago controls
 			InitCommonControls();
 		}
+#endif // DSMAX2012
 	}
 	
 	return TRUE;
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_mods.cpp
--- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_mods.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/NP_mods.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -25,6 +25,9 @@
 {
 	hInstance = hinstDLL;
 
+#ifdef DSMAX2012
+#else
+
 	if ( !controlsInit ) 
 	{
 		controlsInit = TRUE;
@@ -40,7 +43,8 @@
 		
 		// initialize Chicago controls
 		InitCommonControls();
-		}
+	}
+#endif // DSMAX2012
 
 	switch(fdwReason) {
 		case DLL_PROCESS_ATTACH:
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_patch_lib/rpo2nel.cpp
--- a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo2nel.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo2nel.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -18,7 +18,11 @@
 
 // For MAX_RELEASE
 #include <plugapi.h>
-#include <MaxScrpt/maxscrpt.h>
+#ifdef DSMAX2012
+#include <maxscript/maxscript.h>
+#else
+#include <Maxscrpt/maxscrpt.h>
+#endif // 3DSMAX2012
 
 #include "rpo.h"
 #include "nel/3d/zone.h"
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp
--- a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -21,6 +21,9 @@
 			
 	hInstance = hinstDLL;
 
+#ifdef DSMAX2012
+#else
+
 	if ( !controlsInit ) 
 	{
 		controlsInit = TRUE;
@@ -36,7 +39,9 @@
 		
 		// initialize Chicago controls
 		InitCommonControls();
-		}
+	}
+
+#endif // DSMAX2012
 
 	switch(fdwReason) {
 		case DLL_PROCESS_ATTACH:
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h
--- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h	Wed Jul 27 21:08:19 2011 +0200
@@ -3,7 +3,11 @@
 
 #include "resource.h"
 #include <algorithm>
-#include <MaxScrpt/maxscrpt.h>
+#ifdef DSMAX2012
+#include <maxscript/maxscript.h>
+#else
+#include <Maxscrpt/maxscrpt.h>
+#endif // 3DSMAX2012
 #include "namesel.h"
 #include "nsclip.h"
 #include "sbmtlapi.h"
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/dllmain.cpp
--- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/dllmain.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/dllmain.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -18,8 +18,13 @@
 
 	switch (fdwReason) {
 		case DLL_PROCESS_ATTACH:
+
+#ifdef DSMAX2012
+#else
 			InitCustomControls(hInstance);	// Initialize MAX's custom controls
 			InitCommonControls();			// Initialize Win95 controls
+#endif // DSMAX2012
+
 			break;
 		}
 			
diff -r 67fbc5c123ba code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp
--- a/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp	Sun Jul 10 01:10:41 2011 +0300
+++ b/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp	Wed Jul 27 21:08:19 2011 +0200
@@ -44,12 +44,16 @@
 			
 	hInstance = hinstDLL;				// Hang on to this DLL's instance handle.
 
+#ifdef DSMAX2012
+#else
 	if (!controlsInit) {
 		controlsInit = TRUE;
 		InitCustomControls(hInstance);	// Initialize MAX's custom controls
 		InitCommonControls();			// Initialize Win95 controls
 	}
-			
+
+#endif // DSMAX2012
+
 	return (TRUE);
 }
 
