diff --git a/niflib.cpp b/niflib.cpp index 402947e45bf4d551777f71709f82fa9d6ed7c227..a701683406e25a4902b0c1eb8add2109d2f30e4c 100644 --- a/niflib.cpp +++ b/niflib.cpp @@ -729,7 +729,7 @@ void MapParentNodeNames( map<string,NiAVObjectRef> & name_map, NiAVObjectRef par //} //Add the par node to the map, and then call this function for each of its children - name_map[par->name] = par; + name_map[par->GetName()] = par; //TODO: Implement functions to get and set children list<NiAVObjectRef> links;// = par->GetAttr("Children")->asLinkList();; @@ -761,7 +761,7 @@ void ReassignTreeCrossRefs( map<string,NiAVObjectRef> & name_map, NiAVObjectRef //existing nodes by changing their data or attatched properties void MergeSceneGraph( map<string,NiAVObjectRef> & name_map, const NiAVObjectRef & root, NiAVObjectRef par ) { //Check if this block's name exists in the block map - string name = par->name; + string name = par->GetName(); if ( name_map.find(name) != name_map.end() ) { //This block already exists in the original file, so continue on to its children @@ -809,7 +809,7 @@ void MergeSceneGraph( map<string,NiAVObjectRef> & name_map, const NiAVObjectRef //par_par->GetAttr("Children")->RemoveLinks( par ); //Get the block to attatch to - NiObjectRef attatch = DynamicCast<NiObject>(name_map[par_par->name]); + NiObjectRef attatch = DynamicCast<NiObject>(name_map[par_par->GetName()]); //TODO: Implement children ////Add this block as new child diff --git a/obj/NiObjectNET.cpp b/obj/NiObjectNET.cpp index d5e20ad4fd6e88425861b4cec93c53b8018c998a..44f8e36a5c0c95f6d71a4b7b4bc1c0ffb65088c8 100644 --- a/obj/NiObjectNET.cpp +++ b/obj/NiObjectNET.cpp @@ -27,3 +27,12 @@ string NiObjectNET::asString( bool verbose ) const { void NiObjectNET::FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ) { NI_OBJECT_N_E_T_FIXLINKS } + +string NiObjectNET::GetName() { + return name; +} + +void NiObjectNET::SetName( string & new_name ) { + name = new_name; +} + diff --git a/obj/NiObjectNET.h b/obj/NiObjectNET.h index fa214213d9e9ce33184668c386ddd98150c5624d..2c5da457d0f7653bc19067b209fc4117fde5eeab 100644 --- a/obj/NiObjectNET.h +++ b/obj/NiObjectNET.h @@ -24,6 +24,9 @@ public: virtual void Write( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version ) const; virtual string asString( bool verbose = false ) const; virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> link_stack, unsigned int version ); + + string GetName(); + void SetName( string & new_name ); //TODO: pointer to extra data type... find out what that is. AExtraData right now. Need functions to add/remove. //TODO: pointer to first NiTimeController type. Need functions to add/remove. private: