From 36b8cbfa7434f62f9d33e2c7eb3fe3ada818c339 Mon Sep 17 00:00:00 2001 From: Tazpn <tazpn@users.sourceforge.net> Date: Sun, 15 Oct 2006 16:00:20 +0000 Subject: [PATCH] 0.2.9 ----- o Exporter - Add BSX flags for NIF exports when animation is involved for Oblivion. - Worked around what appears to be a bug in the Bezier Scale controller. - Change time intervals when exporting MW style animation. - Fixed bug with missing reference in Footer in MW exported .KF files. - Call routine to apply skin offsets to Skin data (required for MW?) o Importer - Invoke Max Script in Max 5 so that we can import Note Tracks --- src/niflib.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/niflib.cpp b/src/niflib.cpp index 5a10597d..a02c6310 100644 --- a/src/niflib.cpp +++ b/src/niflib.cpp @@ -447,18 +447,17 @@ void WriteNifTree( ostream & out, list<NiObjectRef> const & roots, NifInfo & inf footer.numRoots = 0; if (roots.size() == 1) { const NiObjectRef& root = roots.front(); - if (root->IsDerivedType(NiAVObject::TypeConst())) { - // Handle most NIF file formats - footer.numRoots = 1; - footer.roots.resize(1); - footer.roots[0] = StaticCast<NiObject>(root); - } else if (root->IsDerivedType(NiControllerSequence::TypeConst())) { + if (root->IsDerivedType(NiControllerSequence::TypeConst())) { // KF animation files allow for multiple roots of type NiControllerSequence for ( uint i = 0; i < objects.size(); ++i ) { if (objects[i]->IsDerivedType(NiControllerSequence::TypeConst())) { footer.roots.push_back(objects[i]); } } + } else { // just assume its correctly passed in + footer.numRoots = 1; + footer.roots.resize(1); + footer.roots[0] = root; } } else { footer.numRoots = roots.size(); @@ -716,13 +715,13 @@ static void SplitNifTree( NiObjectRef const & root_block, NiObjectRef & xnif_roo } } - //If this node has no keyframe controller, put it in the list + //If this node has a keyframe controller, put it in the list if ( key_controller != NULL ) { node_controllers.push_back( pair<NiNodeRef,NiKeyframeControllerRef>( node, key_controller ) ); } } - for ( list< pair< NiNodeRef, NiKeyframeControllerRef> >::iterator it = node_controllers.begin(); it != node_controllers.end(); ++it ) { + for ( list< pair< NiNodeRef, NiKeyframeControllerRef> >::reverse_iterator it = node_controllers.rbegin(); it != node_controllers.rend(); ++it ) { //Add string data NiStringExtraDataRef nodextra = new NiStringExtraData; nodextra->SetData( it->first->GetName() ); -- GitLab