From 33bcda3e51f3a4b64896c23cc0ca0d720d423c63 Mon Sep 17 00:00:00 2001 From: Tazpn <tazpn@users.sourceforge.net> Date: Sun, 25 Jun 2006 19:22:42 +0000 Subject: [PATCH] Only call GoTo on the root node and enable by default. --- NifImport/MaxNifImport.cpp | 5 +++-- NifImport/MaxNifTools.ini | 4 ++-- NifImport/niutils.cpp | 12 ------------ NifImport/niutils.h | 1 - 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/NifImport/MaxNifImport.cpp b/NifImport/MaxNifImport.cpp index 1bbe69a..7e3277a 100644 --- a/NifImport/MaxNifImport.cpp +++ b/NifImport/MaxNifImport.cpp @@ -134,11 +134,12 @@ public: // load file blocks = ReadNifList( name ); nodes = DynamicCast<NiNode>(blocks); - if (goToSkeletonBindPosition) - GoToSkeletonBindPosition(nodes); // Apply post processing checks after reading blocks if (isValid()){ + if (goToSkeletonBindPosition && !nodes.empty()) + nodes[0]->GoToSkeletonBindPosition(); + hasSkeleton = HasSkeleton(); isBiped = IsBiped(); skeleton = (appSettings != NULL) ? appSettings->Skeleton : ""; diff --git a/NifImport/MaxNifTools.ini b/NifImport/MaxNifTools.ini index 3726d4f..2667f20 100644 --- a/NifImport/MaxNifTools.ini +++ b/NifImport/MaxNifTools.ini @@ -79,7 +79,7 @@ RootPaths=${RootPath};${MeshRootPath};${TextureRootPath} TextureRootPaths=${RootPath};${TextureRootPath} TextureExtensions=.dds; TextureSearchPaths=${RootPath}\Textures;${TextureRootPath}\Textures\Characters;${TextureRootPath}\Textures\Armor -GoToSkeletonBindPosition=0 +GoToSkeletonBindPosition=1 [Morrowind] InstallPath=[HKLM\SOFTWARE\Bethesda Softworks\Morrowind]=@"Installed Path" @@ -99,4 +99,4 @@ RootPaths=${ExtractFolder};${InstallPath}\Assets;${InstallPath}\Mods;%USERPROFIL TextureRootPaths=$(ExtractFolder)\art\shared\ TextureExtensions=.dds;.bmp TextureSearchPaths= -GoToSkeletonBindPosition=0 \ No newline at end of file +GoToSkeletonBindPosition=1 \ No newline at end of file diff --git a/NifImport/niutils.cpp b/NifImport/niutils.cpp index 52353b8..3240427 100644 --- a/NifImport/niutils.cpp +++ b/NifImport/niutils.cpp @@ -514,15 +514,3 @@ void FindImages(NameValueCollection& images, const string& rootPath, const strin } } } - - -void GoToSkeletonBindPosition(vector<NiNodeRef>& blocks) -{ - //Send all skeleton roots to bind position - for (uint i = 0; i < blocks.size(); ++i) { - NiNodeRef node = blocks[i]; - if ( node != NULL && node->IsSkeletonRoot() ) { - node->GoToSkeletonBindPosition(); - } - } -} \ No newline at end of file diff --git a/NifImport/niutils.h b/NifImport/niutils.h index 2458ee3..6e2f12b 100644 --- a/NifImport/niutils.h +++ b/NifImport/niutils.h @@ -208,7 +208,6 @@ extern Niflib::NiNodeRef FindNodeByName( const vector<Niflib::NiNodeRef>& blocks extern std::vector<Niflib::NiNodeRef> SelectNodesByName( const vector<Niflib::NiNodeRef>& blocks, LPCTSTR match); extern int CountNodesByName( const vector<Niflib::NiNodeRef>& blocks, LPCTSTR match ); extern std::vector<std::string> GetNamesOfNodes( const vector<Niflib::NiNodeRef>& blocks ); -extern void GoToSkeletonBindPosition(std::vector<Niflib::NiNodeRef>& blocks); // Simple conversion helpers static inline float TODEG(float x) { return x * 180.0f / PI; } -- GitLab