diff --git a/include/obj/NiGeometryData.h b/include/obj/NiGeometryData.h index 1740a4e9a35cb83b588910df88c7e6a5490ccbe2..42fcc084ce5095b4ae8e15a13c48424165c4343c 100644 --- a/include/obj/NiGeometryData.h +++ b/include/obj/NiGeometryData.h @@ -63,6 +63,9 @@ protected: vector<int > vertexIndices; public: + NIFLIB_API string GetName(); + NIFLIB_API void SetName( const string & new_name ); + //--Counts--// /*! diff --git a/src/obj/NiBoneLODController.cpp b/src/obj/NiBoneLODController.cpp index 240da183b2554452419841320d809437be103d22..d54a64774298aaa17435d91acd52493adf01f5ab 100644 --- a/src/obj/NiBoneLODController.cpp +++ b/src/obj/NiBoneLODController.cpp @@ -63,7 +63,7 @@ void NiBoneLODController::Read( istream& in, list<unsigned int> & link_stack, co link_stack.push_back( block_num ); }; }; - if ( info.version >= 0x04020200 ) { + if ( ( info.version >= 0x04020200 ) && ( info.userVersion == 0 ) ) { NifStream( numShapeGroups, in, info ); shapeGroups1.resize(numShapeGroups); for (unsigned int i2 = 0; i2 < shapeGroups1.size(); i2++) { @@ -114,7 +114,7 @@ void NiBoneLODController::Write( ostream& out, const map<NiObjectRef,unsigned in } }; }; - if ( info.version >= 0x04020200 ) { + if ( ( info.version >= 0x04020200 ) && ( info.userVersion == 0 ) ) { NifStream( numShapeGroups, out, info ); for (unsigned int i2 = 0; i2 < shapeGroups1.size(); i2++) { shapeGroups1[i2].numLinkPairs = (unsigned int)(shapeGroups1[i2].linkPairs.size()); @@ -240,7 +240,7 @@ void NiBoneLODController::FixLinks( const map<unsigned int,NiObjectRef> & object nodeGroups[i1].nodes[i2] = FixLink<NiNode>( objects, link_stack, info ); }; }; - if ( info.version >= 0x04020200 ) { + if ( ( info.version >= 0x04020200 ) && ( info.userVersion == 0 ) ) { for (unsigned int i2 = 0; i2 < shapeGroups1.size(); i2++) { for (unsigned int i3 = 0; i3 < shapeGroups1[i2].linkPairs.size(); i3++) { shapeGroups1[i2].linkPairs[i3].shape = FixLink<NiTriBasedGeom>( objects, link_stack, info ); diff --git a/src/obj/NiGeometryData.cpp b/src/obj/NiGeometryData.cpp index 9bf1015259590699e96dc02d2629f93f0f68d53d..25ff5316c0a8d52791800cd9ce2edf939d5f19e3 100644 --- a/src/obj/NiGeometryData.cpp +++ b/src/obj/NiGeometryData.cpp @@ -408,6 +408,15 @@ static void CalcCenteredSphere(const vector<Vector3>& vertices, Vector3& center, } } + +string NiGeometryData::GetName() { + return name; +} + +void NiGeometryData::SetName( const string & new_name ) { + name = new_name; +} + int NiGeometryData::GetVertexCount() const { return int(vertices.size()); } diff --git a/src/obj/NiMorphData.cpp b/src/obj/NiMorphData.cpp index 29d794c61c30517ad7e805a703b5565c3e925033..093222941b403e6ffdea1c1abb0308b7d227dc11 100644 --- a/src/obj/NiMorphData.cpp +++ b/src/obj/NiMorphData.cpp @@ -62,7 +62,7 @@ void NiMorphData::Read( istream& in, list<unsigned int> & link_stack, const NifI if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A020000 ) ) { NifStream( morphs[i1].unknownInt, in, info ); }; - if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) ) { + if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) && ( info.userVersion == 0 ) ) { NifStream( morphs[i1].unknownInt, in, info ); }; morphs[i1].vectors.resize(numVertices); @@ -99,7 +99,7 @@ void NiMorphData::Write( ostream& out, const map<NiObjectRef,unsigned int> & lin if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A020000 ) ) { NifStream( morphs[i1].unknownInt, out, info ); }; - if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) ) { + if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) && ( info.userVersion == 0 ) ) { NifStream( morphs[i1].unknownInt, out, info ); }; for (unsigned int i2 = 0; i2 < morphs[i1].vectors.size(); i2++) {