diff --git a/MaxNifPlugins_Readme.txt b/MaxNifPlugins_Readme.txt index 7bcfc267ee9d79054f7b5e70c56811c77ad54a9d..6df6d5b1c7abba727207c8efbf21f3946698a34a 100644 --- a/MaxNifPlugins_Readme.txt +++ b/MaxNifPlugins_Readme.txt @@ -1,20 +1,25 @@ - MaxPlugins 0.2.5 + MaxPlugins 0.2.7 ================ - This plugin set currently consists of an exporter, importer and a utility - plugin. This is a early release, so expect it to be buggy. + This plugin currently consists of an exporter, importer and a utility + plugin. Report problems and ask questions here: - http://niftools.sourceforge.net/forum/viewforum.php?f=6 + http://www.niftools.org/forum/viewforum.php?f=6 A tutorial on how to use the exporter and utility plugins can be found here: http://www.silgrad.com/wbb2/thread.php?threadid=2477 + + A wiki for the 3ds Max plugins is available at: + http://www.niftools.org/wiki/index.php/3ds_Max + Enjoy! + Additional Notes ---------------- @@ -23,16 +28,24 @@ If your collision mesh comes out deformed, go to the utilities tab, choose "Reset XForm" and click "Reset Selected". This should fix it. - + Change log ---------- + 0.2.7 + ----- + o All + - Add options to disable certain parts of plug via INI + o Added so people who only want importer can disable exporter. + + o Exporter + - Fix bug with NiTriShape export which created corrupted files. + + 0.2.6 ----- o All - Consolidate code to single plugin: NifPlugins.dlu - - Please remove the following when upgrading to this release. - o MaxNifImport.dli, NifExport.dle, NifProps.dlu, NifFurniture.dlu - Started Wiki Documentation Project: o http://www.niftools.org/wiki/index.php/3ds_Max @@ -195,17 +208,18 @@ Requirements ------------ - Exporter and Utility: + Plugins: 3D Studio Max 6, 7 and 8 - - Importer - 3d Studio Max 8 Installation ------------ Copy NifPlugins.dlu, to your 3dsmax\plugins directory. Copy MaxNifTools.ini to your 3dsmax\plugcfg directory. + + Please remove the following when upgrading to 0.2.6 or later release: + MaxNifImport.dli, NifExport.dle, NifProps.dlu, NifFurniture.dlu + Usage ----- diff --git a/MaxNifTools.ini b/MaxNifTools.ini index 4dcf39a7e11228d6ec13fddd6a19ddd46d043070..7c11d9c63b1957db1878be0c338ec29cc18b32a7 100644 --- a/MaxNifTools.ini +++ b/MaxNifTools.ini @@ -2,11 +2,13 @@ ; Niftools Max tools configuration file ; [System] +; Max SDK Plugin Version (0 - AutoSelect; 0x17700d00 - Max6, 0x1f401100 - Max8) Default: 0 +MaxSDKVersion=0 ; ShortDescription used in the ShortDescription=Netimmerse/Gamebryo ; KnownApplications - Used to indicate which sections in the ini file point ; to "Applications" which have their own settings in a section below. -KnownApplications=Oblivion;Morrowind;Civilization 4;Dark Age of Camelot;User +KnownApplications=Oblivion;Morrowind;Civilization 4;Dark Age of Camelot;Freedom Force;Freedom Force vs. the 3rd Reich;Star Trek: Bridge Commander;User ; Reparse the Applications (and therefore Texture directory cache) on every import/export Reparse=0 ; Website - Primary website @@ -15,8 +17,8 @@ Website=http://www.niftools.org Wiki=http://www.niftools.org/wiki/index.php/3ds_Max [MaxNifExport] -; Max SDK Plugin Version (0 - AutoSelect; 0x17700d00 - Max6, 0x1f401100 - Max8) Default: 0 -MaxSDKVersion=0 +; Enable/Disable Exporter Class in max. Default: 1 +Enable=1 ; Current Application to get setting/directory information from. Should match KnownApps above or Auto. ; Auto will check the import file against the known root paths use that app if a directory match is found. CurrentApp=Auto @@ -71,8 +73,8 @@ FixNormals=0 UseAlternateStripper=0 [MaxNifImport] -; Max SDK Plugin Version (0 - AutoSelect; 0x17700d00 - Max6, 0x1f401100 - Max8) Default: 0 -MaxSDKVersion=0 +; Enable/Disable Importer Class in max. Default: 1 +Enable=1 ; Current Application to get setting/directory information from. Should match KnownApps above or Auto. ; Auto will check the import file against the known root paths use that app if a directory match is found. CurrentApp=Auto @@ -108,6 +110,14 @@ UseCiv4Shader=1 ImportUPB=1 IgnoreRootNode=0 +[NifFurniture] +; Enable/Disable Exporter Class in max. Default: 1 +Enable=1 + +[NifProps] +; Enable/Disable Property Utilities Class in max. Default: 1 +Enable=1 + [BipedImport] ; Top level bone import setting. Default:1 ImportBones=1 @@ -231,6 +241,40 @@ TextureRootPaths=$(ExtractFolder) TextureExtensions=.dds;.bmp;.tga TextureSearchPaths= +[Freedom Force] +NiVersion=4.0.0.2 +NiUserVersion=0 +InstallPath= +RootPath= +ExtractFolder= +RootPaths=${InstallPath};${ExtractFolder} +TextureRootPaths=$(ExtractFolder) +TextureExtensions=.dds;.bmp;.tga +TextureSearchPaths= + +[Freedom Force vs. the 3rd Reich] +NiVersion=10.1.0.0 +NiUserVersion=0 +InstallPath= +RootPath= +ExtractFolder= +RootPaths=${InstallPath};${ExtractFolder} +TextureRootPaths=$(ExtractFolder) +TextureExtensions=.tga +TextureSearchPaths= + +[Star Trek: Bridge Commander] +NiVersion=3.1 +NiUserVersion=0 +InstallPath= +RootPath= +ExtractFolder= +RootPaths=${InstallPath};${ExtractFolder} +TextureRootPaths=$(ExtractFolder) +TextureExtensions=.tga +TextureSearchPaths= + [User] NiVersion=20.0.0.5 NiUserVersion=0 + diff --git a/NifCommon/NifVersion.h b/NifCommon/NifVersion.h index 5339c14dc755ecd381ad081930253f853f0cd575..d03d748b7a31f38d65acfc5878954c981250063c 100644 --- a/NifCommon/NifVersion.h +++ b/NifCommon/NifVersion.h @@ -18,10 +18,10 @@ HISTORY: */ #define VERSION_MAJOR_INT 0 #define VERSION_MINOR_INT 2 -#define VERSION_BUILD_INT 6 +#define VERSION_BUILD_INT 7 #define VERSION_PATCH_INT 0 -#define VERSION_STRING "0, 2, 6, 0" +#define VERSION_STRING "0, 2, 7, 0" //#define DEF_VERSION_STRING(a,b,c,d) #a ", " #b ", " #c ", " #d //#define VERSION_STRING DEF_VERSION_STRING(a,b,c,d) diff --git a/NifCommon/niutils.h b/NifCommon/niutils.h index 3403a7d2595f5e1c1951d36d320d73fc849445d9..032a822764012c1a676391dc190bd86ce15f7050 100644 --- a/NifCommon/niutils.h +++ b/NifCommon/niutils.h @@ -36,6 +36,7 @@ INFO: See Implementation for minimalist comments #include <obj\NiAVObject.h> #include <obj\NiObjectNET.h> #include <obj\NiNode.h> +#include <obj\NiTriBasedGeom.h> #include <gen\QuaternionXYZW.h> #include <nif_math.h> diff --git a/NifExport/Mesh.cpp b/NifExport/Mesh.cpp index 6752fb9e2917d887bc1f58d9d2b694bc79f7c8d4..3ee02bb1fd6384aa92ac1f525022edc7fb2255e4 100755 --- a/NifExport/Mesh.cpp +++ b/NifExport/Mesh.cpp @@ -383,7 +383,7 @@ bool Exporter::makeSkin(NiTriBasedGeomRef shape, INode *node, FaceGroup &grp, Ti Exporter::Result SkinInstance::execute() { - shape->BindSkin(boneList, false); + shape->BindSkin(boneList); uint bone = 0; for (BoneWeightList::iterator bitr = boneWeights.begin(); bitr != boneWeights.end(); ++bitr, ++bone) { shape->SetBoneWeights(bone, (*bitr)); diff --git a/NifExport/resource.h b/NifExport/resource.h index dc059a1b5e514ac6d6fba9bc297b89b93a3c4ff5..b52595ed11706100c62a83f169da8f944d067965 100755 --- a/NifExport/resource.h +++ b/NifExport/resource.h @@ -63,6 +63,7 @@ #define IDC_EDIT 13490 #define IDC_SPIN 13496 #define IDC_LBL_WIKI 13497 +#define IDC_CHK_TANGENTS 13498 // Next default values for new objects // @@ -70,7 +71,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 103 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1033 +#define _APS_NEXT_CONTROL_VALUE 13499 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/NifPlugins/DllEntry.cpp b/NifPlugins/DllEntry.cpp index ba1eb1effbf8e58657320b11cc9b2c4539fa6953..ce77cbeb5f93af02b71df9f7aa777cc2551ff900 100644 --- a/NifPlugins/DllEntry.cpp +++ b/NifPlugins/DllEntry.cpp @@ -17,12 +17,27 @@ extern ClassDesc2* GetNifPropsDesc(); extern ClassDesc2* GetNifFurnitureDesc(); extern ClassDesc2* GetKfExportDesc(); +enum ClassDescType +{ + CD_Import, + CD_Export, + CD_Props, + CD_Furniture, + CD_KFExport, + CD_Count +}; + static void InitializeLibSettings(); HINSTANCE hInstance; static int controlsInit = FALSE; static int libVersion = VERSION_3DSMAX; static int foundOlderReleaseConflict = -1; +static int nClasses = 0; +static ClassDesc2* classDescriptions[CD_Count]; +static bool classDescEnabled[CD_Count]; + + // This function is called by Windows when the DLL is loaded. This // function may also be called many times during time critical operations @@ -60,9 +75,31 @@ void InitializeLibSettings() PathAppend(iniName, "plugcfg"); PathAppend(iniName, "MaxNifTools.ini"); } - libVersion = GetIniValue("MaxNifImport", "MaxSDKVersion", libVersion, iniName); + libVersion = GetIniValue("System", "MaxSDKVersion", libVersion, iniName); if (libVersion == 0) libVersion = VERSION_3DSMAX; + + nClasses = 0; + if ( GetIniValue<bool>("MaxNifExport", "Enable", true, iniName) ) { + classDescEnabled[CD_Export] = true; + classDescriptions[nClasses++] = GetNifExportDesc(); + } + if ( GetIniValue<bool>("MaxNifImport", "Enable", true, iniName) ) { + classDescEnabled[CD_Import] = true; + classDescriptions[nClasses++] = GetMaxNifImportDesc(); + } + if ( GetIniValue<bool>("NifProps", "Enable", true, iniName) ) { + classDescEnabled[CD_Props] = true; + classDescriptions[nClasses++] = GetNifPropsDesc(); + } + if ( GetIniValue<bool>("NifFurniture", "Enable", true, iniName) ) { + classDescEnabled[CD_Furniture] = true; + classDescriptions[nClasses++] = GetNifFurnitureDesc(); + } + if ( GetIniValue<bool>("KFExport", "Enable", false, iniName) ) { + classDescEnabled[CD_KFExport] = true; + classDescriptions[nClasses++] = GetKfExportDesc(); + } } // This function returns a string that describes the DLL and where the user @@ -91,10 +128,10 @@ __declspec( dllexport ) int LibNumberClasses() foundOlderReleaseConflict = 0; // Check for older releases - if ( NULL != GetModuleHandle("MaxNifImport.dli") - || NULL != GetModuleHandle("NifExport.dle") - || NULL != GetModuleHandle("NifFurniture.dlo") - || NULL != GetModuleHandle("NifProps.dlu") + if ( (classDescEnabled[CD_Import] && NULL != GetModuleHandle("MaxNifImport.dli")) + || (classDescEnabled[CD_Export] && NULL != GetModuleHandle("NifExport.dle")) + || (classDescEnabled[CD_Furniture] && NULL != GetModuleHandle("NifFurniture.dlo")) + || (classDescEnabled[CD_Props] && NULL != GetModuleHandle("NifProps.dlu")) ) { foundOlderReleaseConflict = 1; @@ -105,45 +142,43 @@ __declspec( dllexport ) int LibNumberClasses() TCHAR filename[MAX_PATH]; GetModuleFileName(hInstance, filename, MAX_PATH); - if (-1 != _taccess(PathMerge(filename, TEXT("MaxNifImport.dli")), 0)) + if (classDescEnabled[CD_Import] && -1 != _taccess(PathMerge(filename, TEXT("MaxNifImport.dli")), 0)) foundOlderReleaseConflict = 1; - else if (-1 != _taccess(PathMerge(filename, TEXT("NifExport.dle")), 0)) + else if (classDescEnabled[CD_Export] && -1 != _taccess(PathMerge(filename, TEXT("NifExport.dle")), 0)) foundOlderReleaseConflict = 1; - else if (-1 != _taccess(PathMerge(filename, TEXT("NifFurniture.dlo")), 0)) + else if (classDescEnabled[CD_Furniture] && -1 != _taccess(PathMerge(filename, TEXT("NifFurniture.dlo")), 0)) foundOlderReleaseConflict = 1; - else if (-1 != _taccess(PathMerge(filename, TEXT("NifProps.dlu")), 0)) + else if (classDescEnabled[CD_Props] && -1 != _taccess(PathMerge(filename, TEXT("NifProps.dlu")), 0)) foundOlderReleaseConflict = 1; } if (foundOlderReleaseConflict > 0) { - ::MessageBox( NULL - , "An older release of the Niftools Max Plugins was found.\n\n" + TCHAR buffer[512]; + sprintf(buffer, + "An older release of the Niftools Max Plugins was found.\n\n" "Please remove the following files from your 3dsmax\\plugins directory:\n" - "\tMaxNifImport.dli\n" - "\tNifExport.dle\n" - "\tNifFurniture.dlo\n" - "\tNifProps.dlu\n\n" + "%s%s%s%s" "The current version will be disabled." + , classDescEnabled[CD_Import] ? "\tMaxNifImport.dli\n" : "" + , classDescEnabled[CD_Export] ? "\tNifExport.dle\n" : "" + , classDescEnabled[CD_Furniture] ? "\tNifFurniture.dlo\n" : "" + , classDescEnabled[CD_Props] ? "\tNifProps.dlu\n\n" : "" + ); + ::MessageBox( NULL + , buffer , "Niftools Max Plugins" , MB_ICONSTOP|MB_OK ); return 0; } } - return 4; + return nClasses; } // This function returns the number of plug-in classes this DLL __declspec( dllexport ) ClassDesc* LibClassDesc(int i) { - switch(i) { - case 0: return GetMaxNifImportDesc(); - case 1: return GetNifExportDesc(); - case 2: return GetNifPropsDesc(); - case 3: return GetNifFurnitureDesc(); - //case 4: return GetKfExportDesc(); // Merged into NifExport. - default: return 0; - } + return classDescriptions[i]; } TCHAR *GetString(int id)