From fa702ee4d309e1c1ca5623ceba9a0cb8574a50b1 Mon Sep 17 00:00:00 2001
From: Shon Ferguson <shonferg@users.sourceforge.net>
Date: Fri, 25 May 2007 06:17:50 +0000
Subject: [PATCH] Moved Object Registration/Creation functionality into new
 ObjectRegistry class.  Hopefully this fixes the issue with the object map not
 being initialized yet since it is a static member of the class and should
 theoretically be initialized before code in functions of that class can be
 executed.  Seems to work for me, but I'll wait until Tazpn tests it to
 declare it fixed.

---
 include/ObjectRegistry.h                      | 35 +++++++++++++++++++
 include/niflib.h                              |  3 --
 niflib.vcproj                                 |  8 +++++
 src/ObjectRegistry.cpp                        | 27 ++++++++++++++
 src/niflib.cpp                                | 27 ++------------
 src/obj/AParticleModifier.cpp                 |  5 +--
 src/obj/AvoidNode.cpp                         |  5 +--
 src/obj/BSBound.cpp                           |  5 +--
 src/obj/BSFurnitureMarker.cpp                 |  5 +--
 src/obj/BSKeyframeController.cpp              |  5 +--
 src/obj/BSPSysArrayEmitter.cpp                |  5 +--
 src/obj/BSParentVelocityModifier.cpp          |  5 +--
 src/obj/BSWindModifier.cpp                    |  5 +--
 src/obj/BSXFlags.cpp                          |  5 +--
 src/obj/FxButton.cpp                          |  5 +--
 src/obj/FxRadioButton.cpp                     |  5 +--
 src/obj/FxWidget.cpp                          |  5 +--
 src/obj/NiAVObject.cpp                        |  5 +--
 src/obj/NiAVObjectPalette.cpp                 |  5 +--
 src/obj/NiAlphaController.cpp                 |  5 +--
 src/obj/NiAlphaProperty.cpp                   |  5 +--
 src/obj/NiAmbientLight.cpp                    |  5 +--
 src/obj/NiAutoNormalParticles.cpp             |  5 +--
 src/obj/NiAutoNormalParticlesData.cpp         |  5 +--
 src/obj/NiBSAnimationNode.cpp                 |  5 +--
 src/obj/NiBSBoneLODController.cpp             |  5 +--
 src/obj/NiBSPArrayController.cpp              |  5 +--
 src/obj/NiBSParticleNode.cpp                  |  5 +--
 src/obj/NiBSplineBasisData.cpp                |  5 +--
 src/obj/NiBSplineCompFloatInterpolator.cpp    |  5 +--
 src/obj/NiBSplineCompPoint3Interpolator.cpp   |  5 +--
 .../NiBSplineCompTransformInterpolator.cpp    |  5 +--
 src/obj/NiBSplineData.cpp                     |  5 +--
 src/obj/NiBSplineFloatInterpolator.cpp        |  5 +--
 src/obj/NiBSplineInterpolator.cpp             |  5 +--
 src/obj/NiBSplinePoint3Interpolator.cpp       |  5 +--
 src/obj/NiBSplineTransformInterpolator.cpp    |  5 +--
 src/obj/NiBillboardNode.cpp                   |  5 +--
 src/obj/NiBinaryExtraData.cpp                 |  5 +--
 src/obj/NiBinaryVoxelData.cpp                 |  5 +--
 src/obj/NiBinaryVoxelExtraData.cpp            |  5 +--
 src/obj/NiBlendBoolInterpolator.cpp           |  5 +--
 src/obj/NiBlendFloatInterpolator.cpp          |  5 +--
 src/obj/NiBlendInterpolator.cpp               |  5 +--
 src/obj/NiBlendPoint3Interpolator.cpp         |  5 +--
 src/obj/NiBlendTransformInterpolator.cpp      |  5 +--
 src/obj/NiBone.cpp                            |  5 +--
 src/obj/NiBoneLODController.cpp               |  5 +--
 src/obj/NiBoolData.cpp                        |  5 +--
 src/obj/NiBoolInterpController.cpp            |  5 +--
 src/obj/NiBoolInterpolator.cpp                |  5 +--
 src/obj/NiBoolTimelineInterpolator.cpp        |  5 +--
 src/obj/NiBooleanExtraData.cpp                |  5 +--
 src/obj/NiCamera.cpp                          |  5 +--
 src/obj/NiClod.cpp                            |  5 +--
 src/obj/NiClodData.cpp                        |  5 +--
 src/obj/NiClodSkinInstance.cpp                |  5 +--
 src/obj/NiCollisionData.cpp                   |  5 +--
 src/obj/NiCollisionObject.cpp                 |  5 +--
 src/obj/NiColorData.cpp                       |  5 +--
 src/obj/NiColorExtraData.cpp                  |  5 +--
 src/obj/NiControllerManager.cpp               |  5 +--
 src/obj/NiControllerSequence.cpp              |  5 +--
 src/obj/NiDefaultAVObjectPalette.cpp          |  5 +--
 src/obj/NiDirectionalLight.cpp                |  5 +--
 src/obj/NiDitherProperty.cpp                  |  5 +--
 src/obj/NiDynamicEffect.cpp                   |  5 +--
 src/obj/NiExtraData.cpp                       |  5 +--
 src/obj/NiExtraDataController.cpp             |  5 +--
 src/obj/NiFlipController.cpp                  |  5 +--
 src/obj/NiFloatData.cpp                       |  5 +--
 src/obj/NiFloatExtraData.cpp                  |  5 +--
 src/obj/NiFloatExtraDataController.cpp        |  5 +--
 src/obj/NiFloatInterpController.cpp           |  5 +--
 src/obj/NiFloatInterpolator.cpp               |  5 +--
 src/obj/NiFloatsExtraData.cpp                 |  5 +--
 src/obj/NiFogProperty.cpp                     |  5 +--
 src/obj/NiGeomMorpherController.cpp           |  5 +--
 src/obj/NiGeometry.cpp                        |  5 +--
 src/obj/NiGeometryData.cpp                    |  5 +--
 src/obj/NiGravity.cpp                         |  5 +--
 src/obj/NiImage.cpp                           |  5 +--
 src/obj/NiIntegerExtraData.cpp                |  5 +--
 src/obj/NiIntegersExtraData.cpp               |  5 +--
 src/obj/NiInterpController.cpp                |  5 +--
 src/obj/NiInterpolator.cpp                    |  5 +--
 src/obj/NiKeyBasedInterpolator.cpp            |  5 +--
 src/obj/NiKeyframeController.cpp              |  5 +--
 src/obj/NiKeyframeData.cpp                    |  5 +--
 src/obj/NiLODData.cpp                         |  5 +--
 src/obj/NiLODNode.cpp                         |  5 +--
 src/obj/NiLight.cpp                           |  5 +--
 src/obj/NiLightColorController.cpp            |  5 +--
 src/obj/NiLightDimmerController.cpp           |  5 +--
 src/obj/NiLookAtController.cpp                |  5 +--
 src/obj/NiLookAtInterpolator.cpp              |  5 +--
 src/obj/NiMaterialColorController.cpp         |  5 +--
 src/obj/NiMaterialProperty.cpp                |  5 +--
 src/obj/NiMeshPSysData.cpp                    |  5 +--
 src/obj/NiMeshParticleSystem.cpp              |  5 +--
 src/obj/NiMorphData.cpp                       |  5 +--
 src/obj/NiMultiTargetTransformController.cpp  |  5 +--
 src/obj/NiMultiTextureProperty.cpp            |  5 +--
 src/obj/NiNode.cpp                            |  5 +--
 src/obj/NiObject.cpp                          |  7 ++--
 src/obj/NiObjectNET.cpp                       |  5 +--
 src/obj/NiPSysAgeDeathModifier.cpp            |  5 +--
 src/obj/NiPSysBombModifier.cpp                |  5 +--
 src/obj/NiPSysBoundUpdateModifier.cpp         |  5 +--
 src/obj/NiPSysBoxEmitter.cpp                  |  5 +--
 src/obj/NiPSysCollider.cpp                    |  5 +--
 src/obj/NiPSysColliderManager.cpp             |  5 +--
 src/obj/NiPSysColorModifier.cpp               |  5 +--
 src/obj/NiPSysCylinderEmitter.cpp             |  5 +--
 src/obj/NiPSysData.cpp                        |  5 +--
 src/obj/NiPSysDragModifier.cpp                |  5 +--
 src/obj/NiPSysEmitter.cpp                     |  5 +--
 src/obj/NiPSysEmitterCtlr.cpp                 |  5 +--
 src/obj/NiPSysEmitterCtlrData.cpp             |  5 +--
 src/obj/NiPSysEmitterDeclinationCtlr.cpp      |  5 +--
 src/obj/NiPSysEmitterDeclinationVarCtlr.cpp   |  5 +--
 src/obj/NiPSysEmitterInitialRadiusCtlr.cpp    |  5 +--
 src/obj/NiPSysEmitterLifeSpanCtlr.cpp         |  5 +--
 src/obj/NiPSysEmitterSpeedCtlr.cpp            |  5 +--
 src/obj/NiPSysGravityModifier.cpp             |  5 +--
 src/obj/NiPSysGravityStrengthCtlr.cpp         |  5 +--
 src/obj/NiPSysGrowFadeModifier.cpp            |  5 +--
 src/obj/NiPSysMeshEmitter.cpp                 |  5 +--
 src/obj/NiPSysMeshUpdateModifier.cpp          |  5 +--
 src/obj/NiPSysModifier.cpp                    |  5 +--
 src/obj/NiPSysModifierActiveCtlr.cpp          |  5 +--
 src/obj/NiPSysModifierBoolCtlr.cpp            |  5 +--
 src/obj/NiPSysModifierCtlr.cpp                |  5 +--
 src/obj/NiPSysModifierFloatCtlr.cpp           |  5 +--
 src/obj/NiPSysPlanarCollider.cpp              |  5 +--
 src/obj/NiPSysPositionModifier.cpp            |  5 +--
 src/obj/NiPSysResetOnLoopCtlr.cpp             |  5 +--
 src/obj/NiPSysRotationModifier.cpp            |  5 +--
 src/obj/NiPSysSpawnModifier.cpp               |  5 +--
 src/obj/NiPSysSphereEmitter.cpp               |  5 +--
 src/obj/NiPSysSphericalCollider.cpp           |  5 +--
 src/obj/NiPSysUpdateCtlr.cpp                  |  5 +--
 src/obj/NiPSysVolumeEmitter.cpp               |  5 +--
 src/obj/NiPalette.cpp                         |  5 +--
 src/obj/NiParticleBomb.cpp                    |  5 +--
 src/obj/NiParticleColorModifier.cpp           |  5 +--
 src/obj/NiParticleGrowFade.cpp                |  5 +--
 src/obj/NiParticleMeshModifier.cpp            |  5 +--
 src/obj/NiParticleMeshes.cpp                  |  5 +--
 src/obj/NiParticleMeshesData.cpp              |  5 +--
 src/obj/NiParticleRotation.cpp                |  5 +--
 src/obj/NiParticleSystem.cpp                  |  5 +--
 src/obj/NiParticleSystemController.cpp        |  5 +--
 src/obj/NiParticles.cpp                       |  5 +--
 src/obj/NiParticlesData.cpp                   |  5 +--
 src/obj/NiPathController.cpp                  |  5 +--
 src/obj/NiPathInterpolator.cpp                |  5 +--
 src/obj/NiPixelData.cpp                       |  5 +--
 src/obj/NiPlanarCollider.cpp                  |  5 +--
 src/obj/NiPoint3InterpController.cpp          |  5 +--
 src/obj/NiPoint3Interpolator.cpp              |  5 +--
 src/obj/NiPointLight.cpp                      |  5 +--
 src/obj/NiPosData.cpp                         |  5 +--
 src/obj/NiProperty.cpp                        |  5 +--
 src/obj/NiRangeLODData.cpp                    |  5 +--
 src/obj/NiRawImageData.cpp                    |  5 +--
 src/obj/NiRollController.cpp                  |  5 +--
 src/obj/NiRotatingParticles.cpp               |  5 +--
 src/obj/NiRotatingParticlesData.cpp           |  5 +--
 src/obj/NiScreenLODData.cpp                   |  5 +--
 src/obj/NiSequence.cpp                        |  5 +--
 src/obj/NiSequenceStreamHelper.cpp            |  5 +--
 src/obj/NiShadeProperty.cpp                   |  5 +--
 src/obj/NiSingleInterpController.cpp          |  5 +--
 src/obj/NiSkinData.cpp                        |  5 +--
 src/obj/NiSkinInstance.cpp                    |  5 +--
 src/obj/NiSkinPartition.cpp                   |  5 +--
 src/obj/NiSourceTexture.cpp                   |  5 +--
 src/obj/NiSpecularProperty.cpp                |  5 +--
 src/obj/NiSphericalCollider.cpp               |  5 +--
 src/obj/NiSpotLight.cpp                       |  5 +--
 src/obj/NiStencilProperty.cpp                 |  5 +--
 src/obj/NiStringExtraData.cpp                 |  5 +--
 src/obj/NiStringPalette.cpp                   |  5 +--
 src/obj/NiStringsExtraData.cpp                |  5 +--
 src/obj/NiSwitchNode.cpp                      |  5 +--
 src/obj/NiTextKeyExtraData.cpp                |  5 +--
 src/obj/NiTexture.cpp                         |  5 +--
 src/obj/NiTextureEffect.cpp                   |  5 +--
 src/obj/NiTextureModeProperty.cpp             |  5 +--
 src/obj/NiTextureProperty.cpp                 |  5 +--
 src/obj/NiTextureTransformController.cpp      |  5 +--
 src/obj/NiTexturingProperty.cpp               |  5 +--
 src/obj/NiTimeController.cpp                  |  5 +--
 src/obj/NiTransformController.cpp             |  5 +--
 src/obj/NiTransformData.cpp                   |  5 +--
 src/obj/NiTransformInterpolator.cpp           |  5 +--
 src/obj/NiTriBasedGeom.cpp                    |  5 +--
 src/obj/NiTriBasedGeomData.cpp                |  5 +--
 src/obj/NiTriShape.cpp                        |  5 +--
 src/obj/NiTriShapeData.cpp                    |  5 +--
 src/obj/NiTriShapeSkinController.cpp          |  5 +--
 src/obj/NiTriStrips.cpp                       |  5 +--
 src/obj/NiTriStripsData.cpp                   |  5 +--
 src/obj/NiUVController.cpp                    |  5 +--
 src/obj/NiUVData.cpp                          |  5 +--
 src/obj/NiVectorExtraData.cpp                 |  5 +--
 src/obj/NiVertWeightsExtraData.cpp            |  5 +--
 src/obj/NiVertexColorProperty.cpp             |  5 +--
 src/obj/NiVisController.cpp                   |  5 +--
 src/obj/NiVisData.cpp                         |  5 +--
 src/obj/NiWireframeProperty.cpp               |  5 +--
 src/obj/NiZBufferProperty.cpp                 |  5 +--
 src/obj/RootCollisionNode.cpp                 |  5 +--
 src/obj/bhkBlendCollisionObject.cpp           |  5 +--
 src/obj/bhkBlendController.cpp                |  5 +--
 src/obj/bhkBoxShape.cpp                       |  5 +--
 src/obj/bhkBvTreeShape.cpp                    |  5 +--
 src/obj/bhkCapsuleShape.cpp                   |  5 +--
 src/obj/bhkCollisionObject.cpp                |  5 +--
 src/obj/bhkConstraint.cpp                     |  5 +--
 src/obj/bhkConvexShape.cpp                    |  5 +--
 src/obj/bhkConvexTransformShape.cpp           |  5 +--
 src/obj/bhkConvexVerticesShape.cpp            |  5 +--
 src/obj/bhkEntity.cpp                         |  5 +--
 src/obj/bhkHingeConstraint.cpp                |  5 +--
 src/obj/bhkLimitedHingeConstraint.cpp         |  5 +--
 src/obj/bhkListShape.cpp                      |  5 +--
 src/obj/bhkMalleableConstraint.cpp            |  5 +--
 src/obj/bhkMoppBvTreeShape.cpp                |  5 +--
 src/obj/bhkMultiSphereShape.cpp               |  5 +--
 src/obj/bhkNiCollisionObject.cpp              |  5 +--
 src/obj/bhkNiTriStripsShape.cpp               |  5 +--
 src/obj/bhkPCollisionObject.cpp               |  5 +--
 src/obj/bhkPackedNiTriStripsShape.cpp         |  5 +--
 src/obj/bhkPhantom.cpp                        |  5 +--
 src/obj/bhkPrismaticConstraint.cpp            |  5 +--
 src/obj/bhkRagdollConstraint.cpp              |  5 +--
 src/obj/bhkRefObject.cpp                      |  5 +--
 src/obj/bhkRigidBody.cpp                      |  5 +--
 src/obj/bhkRigidBodyT.cpp                     |  5 +--
 src/obj/bhkSPCollisionObject.cpp              |  5 +--
 src/obj/bhkSerializable.cpp                   |  5 +--
 src/obj/bhkShape.cpp                          |  5 +--
 src/obj/bhkShapeCollection.cpp                |  5 +--
 src/obj/bhkShapePhantom.cpp                   |  5 +--
 src/obj/bhkSimpleShapePhantom.cpp             |  5 +--
 src/obj/bhkSphereRepShape.cpp                 |  5 +--
 src/obj/bhkSphereShape.cpp                    |  5 +--
 src/obj/bhkStiffSpringConstraint.cpp          |  5 +--
 src/obj/bhkTransformShape.cpp                 |  5 +--
 src/obj/bhkWorldObject.cpp                    |  5 +--
 src/obj/hkPackedNiTriStripsData.cpp           |  5 +--
 253 files changed, 818 insertions(+), 524 deletions(-)
 create mode 100644 include/ObjectRegistry.h
 create mode 100644 src/ObjectRegistry.cpp

diff --git a/include/ObjectRegistry.h b/include/ObjectRegistry.h
new file mode 100644
index 00000000..d330feef
--- /dev/null
+++ b/include/ObjectRegistry.h
@@ -0,0 +1,35 @@
+/* Copyright (c) 2006, NIF File Format Library and Tools
+All rights reserved.  Please see niflib.h for license. */
+
+#include <map>
+#include <string>
+#include "obj/Niobject.h"
+
+namespace Niflib {
+
+using namespace std;
+typedef NiObject * (*obj_factory_func)();
+
+/*!
+ * Stores the mapping between object names and factory function pointers to create them
+ */
+class ObjectRegistry {
+public:
+	/*!
+	 * Registers a new type of NiObject for use by the Read functions.
+	 * \param[in] type_name The textual name of the object that will appear in the NIF file.  For example: "NiNode"
+	 * \param[in] create_func The Create function of the NiObject that will be called during file reading to initialize new objects of the types encountered in the file.
+	 */
+	NIFLIB_API static void RegisterObject( const string & type_name, obj_factory_func create_func );
+
+	/*! 
+	 * NIFLIB_HIDDEN function.  For internal use only.
+	 * Called during file reads to create objects of a named type.
+	 */
+	NIFLIB_HIDDEN static NiObject * CreateObject( const string & type_name );
+
+private:
+	static map<string, obj_factory_func> object_map;
+};
+
+} //End namespace Niflib
\ No newline at end of file
diff --git a/include/niflib.h b/include/niflib.h
index 4520af40..e57f78c9 100644
--- a/include/niflib.h
+++ b/include/niflib.h
@@ -213,9 +213,6 @@ NIFLIB_API Ref<NiNode> FindCommonAncestor( const vector< Ref<NiAVObject> > & obj
  */
 NIFLIB_API list< Ref<NiNode> > ListAncestors( NiAVObject * leaf );
 
-/*! NIFLIB_HIDDEN function.  For internal use only. */
-NIFLIB_HIDDEN Ref<NiObject> CreateObject( string obj_type );
-
 /*!
  * Returns whether the requested version is explicitly supported.  This does
  * not mean that the file will not open, rather it means that we have not
diff --git a/niflib.vcproj b/niflib.vcproj
index b54dfb79..3dbfb456 100644
--- a/niflib.vcproj
+++ b/niflib.vcproj
@@ -341,6 +341,10 @@
 					/>
 				</FileConfiguration>
 			</File>
+			<File
+				RelativePath=".\src\ObjectRegistry.cpp"
+				>
+			</File>
 			<File
 				RelativePath=".\src\Type.cpp"
 				>
@@ -1563,6 +1567,10 @@
 				RelativePath=".\include\niflib.h"
 				>
 			</File>
+			<File
+				RelativePath=".\include\ObjectRegistry.h"
+				>
+			</File>
 			<File
 				RelativePath=".\include\Ref.h"
 				>
diff --git a/src/ObjectRegistry.cpp b/src/ObjectRegistry.cpp
new file mode 100644
index 00000000..033eb956
--- /dev/null
+++ b/src/ObjectRegistry.cpp
@@ -0,0 +1,27 @@
+/* Copyright (c) 2006, NIF File Format Library and Tools
+All rights reserved.  Please see niflib.h for license. */
+
+#include "../include/ObjectRegistry.h"
+
+namespace Niflib {
+
+void ObjectRegistry::RegisterObject( const string & type_name, obj_factory_func create_func ) {
+	object_map[type_name] = create_func;
+}
+
+NiObject * ObjectRegistry::CreateObject( const string & type_name ) {
+	NiObject * object = NULL;
+
+	map<string, obj_factory_func>::iterator it;
+	it = object_map.find(type_name);
+
+	if ( it != object_map.end() ) {
+		//Requested type has been registered
+		return it->second();
+	} else {
+		//An unknown type has been encountered
+		return NULL; //Return null
+	}
+}
+
+} //End namespace Niflib
\ No newline at end of file
diff --git a/src/niflib.cpp b/src/niflib.cpp
index 5a434a0b..bf790484 100644
--- a/src/niflib.cpp
+++ b/src/niflib.cpp
@@ -9,6 +9,7 @@ All rights reserved.  Please see niflib.h for license. */
 
 #include "../include/niflib.h"
 #include "../include/NIF_IO.h"
+#include "../include/ObjectRegistry.h"
 #include "../include/kfm.h"
 #include "../include/obj/NiObject.h"
 #include "../include/obj/NiNode.h"
@@ -36,11 +37,6 @@ All rights reserved.  Please see niflib.h for license. */
 
 namespace Niflib {
 
-//Stores the mapping between object names and factory function pointers to create them
-typedef NiObject * (*obj_factory_func)();
-bool global_object_map_init = false;
-map<string, obj_factory_func> global_object_map;
-
 //Utility Functions
 void EnumerateObjects( NiObject * root, map<Type*,unsigned int> & type_map, map<NiObjectRef, unsigned int> & link_map, bool reverse = false );
 NiObjectRef FindRoot( vector<NiObjectRef> const & objects );
@@ -59,23 +55,6 @@ static void SplitNifTree( NiObject * root_object, NiObject * xnif_root, list<NiO
 
 //--Function Bodies--//
 
-NiObjectRef CreateObject( string obj_type ) {
-	NiObject * object = NULL;
-
-	map<string, obj_factory_func>::iterator it;
-	it = global_object_map.find(obj_type);
-
-	if ( it != global_object_map.end() ) {
-		//Requested type has been registered
-		object = it->second();
-	} else {
-		//An unknown type has been encountered
-		return NULL; //Return null
-	}
-	
-	return NiObjectRef(object);
-}
-
 NiObjectRef ReadNifTree( string const & file_name, NifInfo * info ) {
 	//Read object list
 	vector<NiObjectRef> objects = ReadNifList( file_name, info );
@@ -272,7 +251,7 @@ vector<NiObjectRef> ReadNifList( istream & in, NifInfo * info ) {
 		}
 
 		//Create object of the type that was found
-		new_obj = CreateObject(objectType);
+		new_obj = ObjectRegistry::CreateObject(objectType);
 
 		//Check for an unknown object type
 		if ( new_obj == NULL ) {
@@ -935,7 +914,7 @@ void MergeNifTrees( NiNode * target, NiControllerSequence * right, unsigned vers
 
 				//If the controller wasn't found, create one of the right type and attach it
 				if ( ctlr == NULL ) {
-					NiObjectRef new_ctlr = CreateObject( ctlr_type );
+					NiObjectRef new_ctlr = ObjectRegistry::CreateObject( ctlr_type );
 					ctlr = DynamicCast<NiSingleInterpController>( new_ctlr );
 					if ( ctlr == NULL ) {
 						throw runtime_error ("Non-NiSingleInterpController controller found in KF file.");
diff --git a/src/obj/AParticleModifier.cpp b/src/obj/AParticleModifier.cpp
index cf6f07dc..1e44289f 100644
--- a/src/obj/AParticleModifier.cpp
+++ b/src/obj/AParticleModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/AParticleModifier.h"
 #include "../../include/obj/NiParticleSystemController.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["AParticleModifier"] = AParticleModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "AParticleModifier", AParticleModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/AvoidNode.cpp b/src/obj/AvoidNode.cpp
index 1a12619a..77f85ce3 100644
--- a/src/obj/AvoidNode.cpp
+++ b/src/obj/AvoidNode.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/AvoidNode.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["AvoidNode"] = AvoidNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "AvoidNode", AvoidNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/BSBound.cpp b/src/obj/BSBound.cpp
index 254611c0..80e4d3ef 100644
--- a/src/obj/BSBound.cpp
+++ b/src/obj/BSBound.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/BSBound.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["BSBound"] = BSBound::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "BSBound", BSBound::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/BSFurnitureMarker.cpp b/src/obj/BSFurnitureMarker.cpp
index 160d4016..453b9b0b 100644
--- a/src/obj/BSFurnitureMarker.cpp
+++ b/src/obj/BSFurnitureMarker.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/BSFurnitureMarker.h"
 #include "../../include/gen/FurniturePosition.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["BSFurnitureMarker"] = BSFurnitureMarker::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "BSFurnitureMarker", BSFurnitureMarker::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/BSKeyframeController.cpp b/src/obj/BSKeyframeController.cpp
index 152152e0..b5d36e56 100644
--- a/src/obj/BSKeyframeController.cpp
+++ b/src/obj/BSKeyframeController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/BSKeyframeController.h"
 #include "../../include/obj/NiKeyframeData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["BSKeyframeController"] = BSKeyframeController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "BSKeyframeController", BSKeyframeController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/BSPSysArrayEmitter.cpp b/src/obj/BSPSysArrayEmitter.cpp
index 0b9a0585..f2d6615d 100644
--- a/src/obj/BSPSysArrayEmitter.cpp
+++ b/src/obj/BSPSysArrayEmitter.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/BSPSysArrayEmitter.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["BSPSysArrayEmitter"] = BSPSysArrayEmitter::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "BSPSysArrayEmitter", BSPSysArrayEmitter::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/BSParentVelocityModifier.cpp b/src/obj/BSParentVelocityModifier.cpp
index 84e886e2..454aaf91 100644
--- a/src/obj/BSParentVelocityModifier.cpp
+++ b/src/obj/BSParentVelocityModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/BSParentVelocityModifier.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["BSParentVelocityModifier"] = BSParentVelocityModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "BSParentVelocityModifier", BSParentVelocityModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/BSWindModifier.cpp b/src/obj/BSWindModifier.cpp
index 86c6f9e0..23b566be 100644
--- a/src/obj/BSWindModifier.cpp
+++ b/src/obj/BSWindModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/BSWindModifier.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["BSWindModifier"] = BSWindModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "BSWindModifier", BSWindModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/BSXFlags.cpp b/src/obj/BSXFlags.cpp
index 6af9d6ac..66b7760b 100644
--- a/src/obj/BSXFlags.cpp
+++ b/src/obj/BSXFlags.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/BSXFlags.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["BSXFlags"] = BSXFlags::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "BSXFlags", BSXFlags::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/FxButton.cpp b/src/obj/FxButton.cpp
index 51f49376..65ac6e67 100644
--- a/src/obj/FxButton.cpp
+++ b/src/obj/FxButton.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/FxButton.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["FxButton"] = FxButton::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "FxButton", FxButton::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/FxRadioButton.cpp b/src/obj/FxRadioButton.cpp
index d6d8af0f..e9c30aaa 100644
--- a/src/obj/FxRadioButton.cpp
+++ b/src/obj/FxRadioButton.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/FxRadioButton.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["FxRadioButton"] = FxRadioButton::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "FxRadioButton", FxRadioButton::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/FxWidget.cpp b/src/obj/FxWidget.cpp
index 38340384..5cdb7f9a 100644
--- a/src/obj/FxWidget.cpp
+++ b/src/obj/FxWidget.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/FxWidget.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["FxWidget"] = FxWidget::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "FxWidget", FxWidget::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiAVObject.cpp b/src/obj/NiAVObject.cpp
index cef4ad85..10c834c8 100644
--- a/src/obj/NiAVObject.cpp
+++ b/src/obj/NiAVObject.cpp
@@ -12,6 +12,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiAVObject.h"
 #include "../../include/gen/BoundingBox.h"
@@ -59,8 +60,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiAVObject"] = NiAVObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiAVObject", NiAVObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiAVObjectPalette.cpp b/src/obj/NiAVObjectPalette.cpp
index 046ba7ea..bb08ec95 100644
--- a/src/obj/NiAVObjectPalette.cpp
+++ b/src/obj/NiAVObjectPalette.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiAVObjectPalette.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiAVObjectPalette"] = NiAVObjectPalette::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiAVObjectPalette", NiAVObjectPalette::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiAlphaController.cpp b/src/obj/NiAlphaController.cpp
index a1726601..7078380f 100644
--- a/src/obj/NiAlphaController.cpp
+++ b/src/obj/NiAlphaController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiAlphaController.h"
 #include "../../include/obj/NiFloatData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiAlphaController"] = NiAlphaController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiAlphaController", NiAlphaController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiAlphaProperty.cpp b/src/obj/NiAlphaProperty.cpp
index d4742205..e5969492 100644
--- a/src/obj/NiAlphaProperty.cpp
+++ b/src/obj/NiAlphaProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiAlphaProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiAlphaProperty"] = NiAlphaProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiAlphaProperty", NiAlphaProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiAmbientLight.cpp b/src/obj/NiAmbientLight.cpp
index 00a6b974..6acfbc16 100644
--- a/src/obj/NiAmbientLight.cpp
+++ b/src/obj/NiAmbientLight.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiAmbientLight.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiAmbientLight"] = NiAmbientLight::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiAmbientLight", NiAmbientLight::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiAutoNormalParticles.cpp b/src/obj/NiAutoNormalParticles.cpp
index 3761fce0..fca65596 100644
--- a/src/obj/NiAutoNormalParticles.cpp
+++ b/src/obj/NiAutoNormalParticles.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiAutoNormalParticles.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiAutoNormalParticles"] = NiAutoNormalParticles::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiAutoNormalParticles", NiAutoNormalParticles::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiAutoNormalParticlesData.cpp b/src/obj/NiAutoNormalParticlesData.cpp
index 5a37fb8a..6160b4c1 100644
--- a/src/obj/NiAutoNormalParticlesData.cpp
+++ b/src/obj/NiAutoNormalParticlesData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiAutoNormalParticlesData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiAutoNormalParticlesData"] = NiAutoNormalParticlesData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiAutoNormalParticlesData", NiAutoNormalParticlesData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSAnimationNode.cpp b/src/obj/NiBSAnimationNode.cpp
index a432f964..c6df3d67 100644
--- a/src/obj/NiBSAnimationNode.cpp
+++ b/src/obj/NiBSAnimationNode.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSAnimationNode.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSAnimationNode"] = NiBSAnimationNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSAnimationNode", NiBSAnimationNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSBoneLODController.cpp b/src/obj/NiBSBoneLODController.cpp
index 4ad4a229..528ff282 100644
--- a/src/obj/NiBSBoneLODController.cpp
+++ b/src/obj/NiBSBoneLODController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSBoneLODController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSBoneLODController"] = NiBSBoneLODController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSBoneLODController", NiBSBoneLODController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSPArrayController.cpp b/src/obj/NiBSPArrayController.cpp
index 18b56f75..8ac4a6b4 100644
--- a/src/obj/NiBSPArrayController.cpp
+++ b/src/obj/NiBSPArrayController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSPArrayController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSPArrayController"] = NiBSPArrayController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSPArrayController", NiBSPArrayController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSParticleNode.cpp b/src/obj/NiBSParticleNode.cpp
index 6a4fdd1b..58517d72 100644
--- a/src/obj/NiBSParticleNode.cpp
+++ b/src/obj/NiBSParticleNode.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSParticleNode.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSParticleNode"] = NiBSParticleNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSParticleNode", NiBSParticleNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineBasisData.cpp b/src/obj/NiBSplineBasisData.cpp
index 9ad56109..08ddbdbe 100644
--- a/src/obj/NiBSplineBasisData.cpp
+++ b/src/obj/NiBSplineBasisData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineBasisData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineBasisData"] = NiBSplineBasisData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineBasisData", NiBSplineBasisData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineCompFloatInterpolator.cpp b/src/obj/NiBSplineCompFloatInterpolator.cpp
index 3666250d..3f41f2ca 100644
--- a/src/obj/NiBSplineCompFloatInterpolator.cpp
+++ b/src/obj/NiBSplineCompFloatInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineCompFloatInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineCompFloatInterpolator"] = NiBSplineCompFloatInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineCompFloatInterpolator", NiBSplineCompFloatInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineCompPoint3Interpolator.cpp b/src/obj/NiBSplineCompPoint3Interpolator.cpp
index 1f3e8b59..f8396f27 100644
--- a/src/obj/NiBSplineCompPoint3Interpolator.cpp
+++ b/src/obj/NiBSplineCompPoint3Interpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineCompPoint3Interpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineCompPoint3Interpolator"] = NiBSplineCompPoint3Interpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineCompPoint3Interpolator", NiBSplineCompPoint3Interpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineCompTransformInterpolator.cpp b/src/obj/NiBSplineCompTransformInterpolator.cpp
index 2d003834..29332ff1 100644
--- a/src/obj/NiBSplineCompTransformInterpolator.cpp
+++ b/src/obj/NiBSplineCompTransformInterpolator.cpp
@@ -18,6 +18,7 @@ static const int SizeofScale = 1;
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineCompTransformInterpolator.h"
 using namespace Niflib;
@@ -50,8 +51,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineCompTransformInterpolator"] = NiBSplineCompTransformInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineCompTransformInterpolator", NiBSplineCompTransformInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineData.cpp b/src/obj/NiBSplineData.cpp
index 47d5f876..716edb09 100644
--- a/src/obj/NiBSplineData.cpp
+++ b/src/obj/NiBSplineData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineData"] = NiBSplineData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineData", NiBSplineData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineFloatInterpolator.cpp b/src/obj/NiBSplineFloatInterpolator.cpp
index e4607bc4..241dc130 100644
--- a/src/obj/NiBSplineFloatInterpolator.cpp
+++ b/src/obj/NiBSplineFloatInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineFloatInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineFloatInterpolator"] = NiBSplineFloatInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineFloatInterpolator", NiBSplineFloatInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineInterpolator.cpp b/src/obj/NiBSplineInterpolator.cpp
index 27a486d8..abd688ce 100644
--- a/src/obj/NiBSplineInterpolator.cpp
+++ b/src/obj/NiBSplineInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineInterpolator.h"
 #include "../../include/obj/NiBSplineData.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineInterpolator"] = NiBSplineInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineInterpolator", NiBSplineInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplinePoint3Interpolator.cpp b/src/obj/NiBSplinePoint3Interpolator.cpp
index 65f0342f..60abf7b2 100644
--- a/src/obj/NiBSplinePoint3Interpolator.cpp
+++ b/src/obj/NiBSplinePoint3Interpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplinePoint3Interpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplinePoint3Interpolator"] = NiBSplinePoint3Interpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplinePoint3Interpolator", NiBSplinePoint3Interpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBSplineTransformInterpolator.cpp b/src/obj/NiBSplineTransformInterpolator.cpp
index b4415fe1..7868b573 100644
--- a/src/obj/NiBSplineTransformInterpolator.cpp
+++ b/src/obj/NiBSplineTransformInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBSplineTransformInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBSplineTransformInterpolator"] = NiBSplineTransformInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBSplineTransformInterpolator", NiBSplineTransformInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBillboardNode.cpp b/src/obj/NiBillboardNode.cpp
index 6624ed9a..879d3b68 100644
--- a/src/obj/NiBillboardNode.cpp
+++ b/src/obj/NiBillboardNode.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBillboardNode.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBillboardNode"] = NiBillboardNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBillboardNode", NiBillboardNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBinaryExtraData.cpp b/src/obj/NiBinaryExtraData.cpp
index e0f5c40e..ba3ff098 100644
--- a/src/obj/NiBinaryExtraData.cpp
+++ b/src/obj/NiBinaryExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBinaryExtraData.h"
 #include "../../include/gen/ByteArray.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBinaryExtraData"] = NiBinaryExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBinaryExtraData", NiBinaryExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBinaryVoxelData.cpp b/src/obj/NiBinaryVoxelData.cpp
index 054aabfb..7b98e2e0 100644
--- a/src/obj/NiBinaryVoxelData.cpp
+++ b/src/obj/NiBinaryVoxelData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBinaryVoxelData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBinaryVoxelData"] = NiBinaryVoxelData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBinaryVoxelData", NiBinaryVoxelData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBinaryVoxelExtraData.cpp b/src/obj/NiBinaryVoxelExtraData.cpp
index 5eff1b33..118b61c8 100644
--- a/src/obj/NiBinaryVoxelExtraData.cpp
+++ b/src/obj/NiBinaryVoxelExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBinaryVoxelExtraData.h"
 #include "../../include/obj/NiBinaryVoxelData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBinaryVoxelExtraData"] = NiBinaryVoxelExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBinaryVoxelExtraData", NiBinaryVoxelExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBlendBoolInterpolator.cpp b/src/obj/NiBlendBoolInterpolator.cpp
index 23e8da39..90d0dfef 100644
--- a/src/obj/NiBlendBoolInterpolator.cpp
+++ b/src/obj/NiBlendBoolInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBlendBoolInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBlendBoolInterpolator"] = NiBlendBoolInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBlendBoolInterpolator", NiBlendBoolInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBlendFloatInterpolator.cpp b/src/obj/NiBlendFloatInterpolator.cpp
index 49dca8b0..6876010c 100644
--- a/src/obj/NiBlendFloatInterpolator.cpp
+++ b/src/obj/NiBlendFloatInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBlendFloatInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBlendFloatInterpolator"] = NiBlendFloatInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBlendFloatInterpolator", NiBlendFloatInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBlendInterpolator.cpp b/src/obj/NiBlendInterpolator.cpp
index 18e329ac..6153f61c 100644
--- a/src/obj/NiBlendInterpolator.cpp
+++ b/src/obj/NiBlendInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBlendInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBlendInterpolator"] = NiBlendInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBlendInterpolator", NiBlendInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBlendPoint3Interpolator.cpp b/src/obj/NiBlendPoint3Interpolator.cpp
index d10ebc12..c1479c4a 100644
--- a/src/obj/NiBlendPoint3Interpolator.cpp
+++ b/src/obj/NiBlendPoint3Interpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBlendPoint3Interpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBlendPoint3Interpolator"] = NiBlendPoint3Interpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBlendPoint3Interpolator", NiBlendPoint3Interpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBlendTransformInterpolator.cpp b/src/obj/NiBlendTransformInterpolator.cpp
index c32ccbd9..c9c9b1ac 100644
--- a/src/obj/NiBlendTransformInterpolator.cpp
+++ b/src/obj/NiBlendTransformInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBlendTransformInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBlendTransformInterpolator"] = NiBlendTransformInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBlendTransformInterpolator", NiBlendTransformInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBone.cpp b/src/obj/NiBone.cpp
index ec52c4db..4d0e47f9 100644
--- a/src/obj/NiBone.cpp
+++ b/src/obj/NiBone.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBone.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBone"] = NiBone::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBone", NiBone::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBoneLODController.cpp b/src/obj/NiBoneLODController.cpp
index 5e1683a7..5b56e5c3 100644
--- a/src/obj/NiBoneLODController.cpp
+++ b/src/obj/NiBoneLODController.cpp
@@ -12,6 +12,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBoneLODController.h"
 #include "../../include/gen/NodeGroup.h"
@@ -51,8 +52,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBoneLODController"] = NiBoneLODController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBoneLODController", NiBoneLODController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBoolData.cpp b/src/obj/NiBoolData.cpp
index 9596c12c..a7ec06bb 100644
--- a/src/obj/NiBoolData.cpp
+++ b/src/obj/NiBoolData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBoolData.h"
 #include "../../include/gen/KeyGroup.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBoolData"] = NiBoolData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBoolData", NiBoolData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBoolInterpController.cpp b/src/obj/NiBoolInterpController.cpp
index 758d9362..c0f305c4 100644
--- a/src/obj/NiBoolInterpController.cpp
+++ b/src/obj/NiBoolInterpController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBoolInterpController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBoolInterpController"] = NiBoolInterpController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBoolInterpController", NiBoolInterpController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBoolInterpolator.cpp b/src/obj/NiBoolInterpolator.cpp
index 8fe524bf..edd57ad7 100644
--- a/src/obj/NiBoolInterpolator.cpp
+++ b/src/obj/NiBoolInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBoolInterpolator.h"
 #include "../../include/obj/NiBoolData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBoolInterpolator"] = NiBoolInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBoolInterpolator", NiBoolInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBoolTimelineInterpolator.cpp b/src/obj/NiBoolTimelineInterpolator.cpp
index 826fc438..a9983bd6 100644
--- a/src/obj/NiBoolTimelineInterpolator.cpp
+++ b/src/obj/NiBoolTimelineInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBoolTimelineInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBoolTimelineInterpolator"] = NiBoolTimelineInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBoolTimelineInterpolator", NiBoolTimelineInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiBooleanExtraData.cpp b/src/obj/NiBooleanExtraData.cpp
index 789d465d..2e372d86 100644
--- a/src/obj/NiBooleanExtraData.cpp
+++ b/src/obj/NiBooleanExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiBooleanExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiBooleanExtraData"] = NiBooleanExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiBooleanExtraData", NiBooleanExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiCamera.cpp b/src/obj/NiCamera.cpp
index a57df07a..536c6b8e 100644
--- a/src/obj/NiCamera.cpp
+++ b/src/obj/NiCamera.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiCamera.h"
 #include "../../include/obj/NiObject.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiCamera"] = NiCamera::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiCamera", NiCamera::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiClod.cpp b/src/obj/NiClod.cpp
index 251d2508..8a8d64ff 100644
--- a/src/obj/NiClod.cpp
+++ b/src/obj/NiClod.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiClod.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiClod"] = NiClod::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiClod", NiClod::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiClodData.cpp b/src/obj/NiClodData.cpp
index 3c35bc21..7f6c060a 100644
--- a/src/obj/NiClodData.cpp
+++ b/src/obj/NiClodData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiClodData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiClodData"] = NiClodData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiClodData", NiClodData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiClodSkinInstance.cpp b/src/obj/NiClodSkinInstance.cpp
index 81ebf580..42dab7ed 100644
--- a/src/obj/NiClodSkinInstance.cpp
+++ b/src/obj/NiClodSkinInstance.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiClodSkinInstance.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiClodSkinInstance"] = NiClodSkinInstance::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiClodSkinInstance", NiClodSkinInstance::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiCollisionData.cpp b/src/obj/NiCollisionData.cpp
index 87b324da..3402d9cb 100644
--- a/src/obj/NiCollisionData.cpp
+++ b/src/obj/NiCollisionData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiCollisionData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiCollisionData"] = NiCollisionData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiCollisionData", NiCollisionData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiCollisionObject.cpp b/src/obj/NiCollisionObject.cpp
index 74b14095..ce6ae598 100644
--- a/src/obj/NiCollisionObject.cpp
+++ b/src/obj/NiCollisionObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiCollisionObject.h"
 #include "../../include/obj/NiAVObject.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiCollisionObject"] = NiCollisionObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiCollisionObject", NiCollisionObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiColorData.cpp b/src/obj/NiColorData.cpp
index d7cb5259..5cca6623 100644
--- a/src/obj/NiColorData.cpp
+++ b/src/obj/NiColorData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiColorData.h"
 #include "../../include/gen/KeyGroup.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiColorData"] = NiColorData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiColorData", NiColorData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiColorExtraData.cpp b/src/obj/NiColorExtraData.cpp
index ae1ab91e..b4903136 100644
--- a/src/obj/NiColorExtraData.cpp
+++ b/src/obj/NiColorExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiColorExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiColorExtraData"] = NiColorExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiColorExtraData", NiColorExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiControllerManager.cpp b/src/obj/NiControllerManager.cpp
index a1a95760..0f28aa45 100644
--- a/src/obj/NiControllerManager.cpp
+++ b/src/obj/NiControllerManager.cpp
@@ -12,6 +12,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiControllerManager.h"
 #include "../../include/obj/NiControllerSequence.h"
@@ -46,8 +47,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiControllerManager"] = NiControllerManager::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiControllerManager", NiControllerManager::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiControllerSequence.cpp b/src/obj/NiControllerSequence.cpp
index e2b842eb..2c218297 100644
--- a/src/obj/NiControllerSequence.cpp
+++ b/src/obj/NiControllerSequence.cpp
@@ -15,6 +15,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiControllerSequence.h"
 #include "../../include/obj/NiTextKeyExtraData.h"
@@ -50,8 +51,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiControllerSequence"] = NiControllerSequence::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiControllerSequence", NiControllerSequence::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiDefaultAVObjectPalette.cpp b/src/obj/NiDefaultAVObjectPalette.cpp
index b2a7edef..714b12d8 100644
--- a/src/obj/NiDefaultAVObjectPalette.cpp
+++ b/src/obj/NiDefaultAVObjectPalette.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiDefaultAVObjectPalette.h"
 #include "../../include/gen/AVObject.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiDefaultAVObjectPalette"] = NiDefaultAVObjectPalette::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiDefaultAVObjectPalette", NiDefaultAVObjectPalette::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiDirectionalLight.cpp b/src/obj/NiDirectionalLight.cpp
index 3677c656..1ccfdeaf 100644
--- a/src/obj/NiDirectionalLight.cpp
+++ b/src/obj/NiDirectionalLight.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiDirectionalLight.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiDirectionalLight"] = NiDirectionalLight::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiDirectionalLight", NiDirectionalLight::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiDitherProperty.cpp b/src/obj/NiDitherProperty.cpp
index 3aa12366..b5153560 100644
--- a/src/obj/NiDitherProperty.cpp
+++ b/src/obj/NiDitherProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiDitherProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiDitherProperty"] = NiDitherProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiDitherProperty", NiDitherProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiDynamicEffect.cpp b/src/obj/NiDynamicEffect.cpp
index c7880ff1..be771fd2 100644
--- a/src/obj/NiDynamicEffect.cpp
+++ b/src/obj/NiDynamicEffect.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiDynamicEffect.h"
 #include "../../include/obj/NiAVObject.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiDynamicEffect"] = NiDynamicEffect::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiDynamicEffect", NiDynamicEffect::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiExtraData.cpp b/src/obj/NiExtraData.cpp
index 5e5f7aa9..1cb9a689 100644
--- a/src/obj/NiExtraData.cpp
+++ b/src/obj/NiExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiExtraData"] = NiExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiExtraData", NiExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiExtraDataController.cpp b/src/obj/NiExtraDataController.cpp
index 44109f6e..cb6a2726 100644
--- a/src/obj/NiExtraDataController.cpp
+++ b/src/obj/NiExtraDataController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiExtraDataController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiExtraDataController"] = NiExtraDataController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiExtraDataController", NiExtraDataController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFlipController.cpp b/src/obj/NiFlipController.cpp
index 6e34abc4..57cbb3d9 100644
--- a/src/obj/NiFlipController.cpp
+++ b/src/obj/NiFlipController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFlipController.h"
 #include "../../include/obj/NiSourceTexture.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFlipController"] = NiFlipController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFlipController", NiFlipController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFloatData.cpp b/src/obj/NiFloatData.cpp
index e97a5cc6..6663f85f 100644
--- a/src/obj/NiFloatData.cpp
+++ b/src/obj/NiFloatData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFloatData.h"
 #include "../../include/gen/KeyGroup.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFloatData"] = NiFloatData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFloatData", NiFloatData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFloatExtraData.cpp b/src/obj/NiFloatExtraData.cpp
index 0a1609e1..04cb9d6b 100644
--- a/src/obj/NiFloatExtraData.cpp
+++ b/src/obj/NiFloatExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFloatExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFloatExtraData"] = NiFloatExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFloatExtraData", NiFloatExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFloatExtraDataController.cpp b/src/obj/NiFloatExtraDataController.cpp
index 45ab9b1e..458eaac5 100644
--- a/src/obj/NiFloatExtraDataController.cpp
+++ b/src/obj/NiFloatExtraDataController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFloatExtraDataController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFloatExtraDataController"] = NiFloatExtraDataController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFloatExtraDataController", NiFloatExtraDataController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFloatInterpController.cpp b/src/obj/NiFloatInterpController.cpp
index 9fe2f90a..1024dc0b 100644
--- a/src/obj/NiFloatInterpController.cpp
+++ b/src/obj/NiFloatInterpController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFloatInterpController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFloatInterpController"] = NiFloatInterpController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFloatInterpController", NiFloatInterpController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFloatInterpolator.cpp b/src/obj/NiFloatInterpolator.cpp
index 2dc28e06..b466cf88 100644
--- a/src/obj/NiFloatInterpolator.cpp
+++ b/src/obj/NiFloatInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFloatInterpolator.h"
 #include "../../include/obj/NiFloatData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFloatInterpolator"] = NiFloatInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFloatInterpolator", NiFloatInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFloatsExtraData.cpp b/src/obj/NiFloatsExtraData.cpp
index 48c17b44..3685e142 100644
--- a/src/obj/NiFloatsExtraData.cpp
+++ b/src/obj/NiFloatsExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFloatsExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFloatsExtraData"] = NiFloatsExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFloatsExtraData", NiFloatsExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiFogProperty.cpp b/src/obj/NiFogProperty.cpp
index 179c07d3..f69a156c 100644
--- a/src/obj/NiFogProperty.cpp
+++ b/src/obj/NiFogProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiFogProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiFogProperty"] = NiFogProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiFogProperty", NiFogProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiGeomMorpherController.cpp b/src/obj/NiGeomMorpherController.cpp
index 7ad8ddad..f69abc37 100644
--- a/src/obj/NiGeomMorpherController.cpp
+++ b/src/obj/NiGeomMorpherController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiGeomMorpherController.h"
 #include "../../include/obj/NiMorphData.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiGeomMorpherController"] = NiGeomMorpherController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiGeomMorpherController", NiGeomMorpherController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiGeometry.cpp b/src/obj/NiGeometry.cpp
index 9018e0de..32ede96e 100644
--- a/src/obj/NiGeometry.cpp
+++ b/src/obj/NiGeometry.cpp
@@ -14,6 +14,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiGeometry.h"
 #include "../../include/obj/NiGeometryData.h"
@@ -49,8 +50,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiGeometry"] = NiGeometry::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiGeometry", NiGeometry::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiGeometryData.cpp b/src/obj/NiGeometryData.cpp
index db06751c..c9c0c1ea 100644
--- a/src/obj/NiGeometryData.cpp
+++ b/src/obj/NiGeometryData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiGeometryData.h"
 #include "../../include/obj/NiObject.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiGeometryData"] = NiGeometryData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiGeometryData", NiGeometryData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiGravity.cpp b/src/obj/NiGravity.cpp
index 359ed3de..6028bf17 100644
--- a/src/obj/NiGravity.cpp
+++ b/src/obj/NiGravity.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiGravity.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiGravity"] = NiGravity::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiGravity", NiGravity::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiImage.cpp b/src/obj/NiImage.cpp
index 9ec15b4c..e92f34c8 100644
--- a/src/obj/NiImage.cpp
+++ b/src/obj/NiImage.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiImage.h"
 #include "../../include/obj/NiRawImageData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiImage"] = NiImage::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiImage", NiImage::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiIntegerExtraData.cpp b/src/obj/NiIntegerExtraData.cpp
index 7ae0e1fd..aba40b8c 100644
--- a/src/obj/NiIntegerExtraData.cpp
+++ b/src/obj/NiIntegerExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiIntegerExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiIntegerExtraData"] = NiIntegerExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiIntegerExtraData", NiIntegerExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiIntegersExtraData.cpp b/src/obj/NiIntegersExtraData.cpp
index 2972e963..b04fd91f 100644
--- a/src/obj/NiIntegersExtraData.cpp
+++ b/src/obj/NiIntegersExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiIntegersExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiIntegersExtraData"] = NiIntegersExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiIntegersExtraData", NiIntegersExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiInterpController.cpp b/src/obj/NiInterpController.cpp
index c26645b6..e0b95098 100644
--- a/src/obj/NiInterpController.cpp
+++ b/src/obj/NiInterpController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiInterpController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiInterpController"] = NiInterpController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiInterpController", NiInterpController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiInterpolator.cpp b/src/obj/NiInterpolator.cpp
index 90dcfe06..6dd2cd92 100644
--- a/src/obj/NiInterpolator.cpp
+++ b/src/obj/NiInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiInterpolator"] = NiInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiInterpolator", NiInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiKeyBasedInterpolator.cpp b/src/obj/NiKeyBasedInterpolator.cpp
index f8b76bf5..e17ecce5 100644
--- a/src/obj/NiKeyBasedInterpolator.cpp
+++ b/src/obj/NiKeyBasedInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiKeyBasedInterpolator.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiKeyBasedInterpolator"] = NiKeyBasedInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiKeyBasedInterpolator", NiKeyBasedInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiKeyframeController.cpp b/src/obj/NiKeyframeController.cpp
index 6d709bd5..d1b3d86a 100644
--- a/src/obj/NiKeyframeController.cpp
+++ b/src/obj/NiKeyframeController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiKeyframeController.h"
 #include "../../include/obj/NiKeyframeData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiKeyframeController"] = NiKeyframeController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiKeyframeController", NiKeyframeController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiKeyframeData.cpp b/src/obj/NiKeyframeData.cpp
index 1e145de2..a9335ed5 100644
--- a/src/obj/NiKeyframeData.cpp
+++ b/src/obj/NiKeyframeData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiKeyframeData.h"
 #include "../../include/gen/KeyGroup.h"
@@ -46,8 +47,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiKeyframeData"] = NiKeyframeData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiKeyframeData", NiKeyframeData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiLODData.cpp b/src/obj/NiLODData.cpp
index 690649a1..fae71e1c 100644
--- a/src/obj/NiLODData.cpp
+++ b/src/obj/NiLODData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiLODData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiLODData"] = NiLODData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiLODData", NiLODData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiLODNode.cpp b/src/obj/NiLODNode.cpp
index 082ec978..ef95d3d9 100644
--- a/src/obj/NiLODNode.cpp
+++ b/src/obj/NiLODNode.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiLODNode.h"
 #include "../../include/gen/LODRange.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiLODNode"] = NiLODNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiLODNode", NiLODNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiLight.cpp b/src/obj/NiLight.cpp
index a80428da..458a5e2e 100644
--- a/src/obj/NiLight.cpp
+++ b/src/obj/NiLight.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiLight.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiLight"] = NiLight::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiLight", NiLight::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiLightColorController.cpp b/src/obj/NiLightColorController.cpp
index 2d048f1b..82447d5e 100644
--- a/src/obj/NiLightColorController.cpp
+++ b/src/obj/NiLightColorController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiLightColorController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiLightColorController"] = NiLightColorController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiLightColorController", NiLightColorController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiLightDimmerController.cpp b/src/obj/NiLightDimmerController.cpp
index 46c0e9e7..d0b16f76 100644
--- a/src/obj/NiLightDimmerController.cpp
+++ b/src/obj/NiLightDimmerController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiLightDimmerController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiLightDimmerController"] = NiLightDimmerController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiLightDimmerController", NiLightDimmerController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiLookAtController.cpp b/src/obj/NiLookAtController.cpp
index 675403fb..80969a63 100644
--- a/src/obj/NiLookAtController.cpp
+++ b/src/obj/NiLookAtController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiLookAtController.h"
 #include "../../include/obj/NiNode.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiLookAtController"] = NiLookAtController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiLookAtController", NiLookAtController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiLookAtInterpolator.cpp b/src/obj/NiLookAtInterpolator.cpp
index b7c8dd65..735ec098 100644
--- a/src/obj/NiLookAtInterpolator.cpp
+++ b/src/obj/NiLookAtInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiLookAtInterpolator.h"
 #include "../../include/obj/NiNode.h"
@@ -46,8 +47,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiLookAtInterpolator"] = NiLookAtInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiLookAtInterpolator", NiLookAtInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiMaterialColorController.cpp b/src/obj/NiMaterialColorController.cpp
index 10993a96..a1f00d9b 100644
--- a/src/obj/NiMaterialColorController.cpp
+++ b/src/obj/NiMaterialColorController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiMaterialColorController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiMaterialColorController"] = NiMaterialColorController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiMaterialColorController", NiMaterialColorController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiMaterialProperty.cpp b/src/obj/NiMaterialProperty.cpp
index c2ee56ee..27083f2f 100644
--- a/src/obj/NiMaterialProperty.cpp
+++ b/src/obj/NiMaterialProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiMaterialProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiMaterialProperty"] = NiMaterialProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiMaterialProperty", NiMaterialProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiMeshPSysData.cpp b/src/obj/NiMeshPSysData.cpp
index 02dce6c3..41fa21e8 100644
--- a/src/obj/NiMeshPSysData.cpp
+++ b/src/obj/NiMeshPSysData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiMeshPSysData.h"
 #include "../../include/obj/NiObject.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiMeshPSysData"] = NiMeshPSysData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiMeshPSysData", NiMeshPSysData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiMeshParticleSystem.cpp b/src/obj/NiMeshParticleSystem.cpp
index a4c2c937..5ada8751 100644
--- a/src/obj/NiMeshParticleSystem.cpp
+++ b/src/obj/NiMeshParticleSystem.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiMeshParticleSystem.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiMeshParticleSystem"] = NiMeshParticleSystem::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiMeshParticleSystem", NiMeshParticleSystem::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiMorphData.cpp b/src/obj/NiMorphData.cpp
index 11e22b00..4ed0112b 100644
--- a/src/obj/NiMorphData.cpp
+++ b/src/obj/NiMorphData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiMorphData.h"
 #include "../../include/gen/Morph.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiMorphData"] = NiMorphData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiMorphData", NiMorphData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiMultiTargetTransformController.cpp b/src/obj/NiMultiTargetTransformController.cpp
index af1d7935..5f5fc0fd 100644
--- a/src/obj/NiMultiTargetTransformController.cpp
+++ b/src/obj/NiMultiTargetTransformController.cpp
@@ -12,6 +12,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiMultiTargetTransformController.h"
 #include "../../include/obj/NiNode.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiMultiTargetTransformController"] = NiMultiTargetTransformController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiMultiTargetTransformController", NiMultiTargetTransformController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiMultiTextureProperty.cpp b/src/obj/NiMultiTextureProperty.cpp
index 11d4c754..1e959fba 100644
--- a/src/obj/NiMultiTextureProperty.cpp
+++ b/src/obj/NiMultiTextureProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiMultiTextureProperty.h"
 #include "../../include/gen/MultiTextureElement.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiMultiTextureProperty"] = NiMultiTextureProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiMultiTextureProperty", NiMultiTextureProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiNode.cpp b/src/obj/NiNode.cpp
index 5c774682..640cb628 100644
--- a/src/obj/NiNode.cpp
+++ b/src/obj/NiNode.cpp
@@ -14,6 +14,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiNode.h"
 #include "../../include/obj/NiAVObject.h"
@@ -61,8 +62,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiNode"] = NiNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiNode", NiNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiObject.cpp b/src/obj/NiObject.cpp
index bc23c038..cece3015 100644
--- a/src/obj/NiObject.cpp
+++ b/src/obj/NiObject.cpp
@@ -12,6 +12,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiObject.h"
 using namespace Niflib;
@@ -48,8 +49,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiObject"] = NiObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiObject", NiObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
@@ -160,7 +161,7 @@ NiObjectRef NiObject::Clone( unsigned int version, unsigned int user_version ) {
 	stringstream tmp;
 
 	//Create a new object of the same type
-	NiObjectRef clone = CreateObject( this->GetType().GetTypeName() );
+	NiObjectRef clone = ObjectRegistry::CreateObject( this->GetType().GetTypeName() );
 
 	//Dummy map
 	map<NiObjectRef,unsigned int> link_map;
diff --git a/src/obj/NiObjectNET.cpp b/src/obj/NiObjectNET.cpp
index f248b86f..281d0e67 100644
--- a/src/obj/NiObjectNET.cpp
+++ b/src/obj/NiObjectNET.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiObjectNET.h"
 #include "../../include/obj/NiExtraData.h"
@@ -50,8 +51,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiObjectNET"] = NiObjectNET::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiObjectNET", NiObjectNET::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysAgeDeathModifier.cpp b/src/obj/NiPSysAgeDeathModifier.cpp
index f2f3a8cc..c320fbe5 100644
--- a/src/obj/NiPSysAgeDeathModifier.cpp
+++ b/src/obj/NiPSysAgeDeathModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysAgeDeathModifier.h"
 #include "../../include/obj/NiPSysSpawnModifier.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysAgeDeathModifier"] = NiPSysAgeDeathModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysAgeDeathModifier", NiPSysAgeDeathModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysBombModifier.cpp b/src/obj/NiPSysBombModifier.cpp
index 3c37d577..2e2e9a13 100644
--- a/src/obj/NiPSysBombModifier.cpp
+++ b/src/obj/NiPSysBombModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysBombModifier.h"
 #include "../../include/obj/NiNode.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysBombModifier"] = NiPSysBombModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysBombModifier", NiPSysBombModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysBoundUpdateModifier.cpp b/src/obj/NiPSysBoundUpdateModifier.cpp
index 5615c9d7..9bc50ed4 100644
--- a/src/obj/NiPSysBoundUpdateModifier.cpp
+++ b/src/obj/NiPSysBoundUpdateModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysBoundUpdateModifier.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysBoundUpdateModifier"] = NiPSysBoundUpdateModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysBoundUpdateModifier", NiPSysBoundUpdateModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysBoxEmitter.cpp b/src/obj/NiPSysBoxEmitter.cpp
index 6f1ad84d..d8ed4b13 100644
--- a/src/obj/NiPSysBoxEmitter.cpp
+++ b/src/obj/NiPSysBoxEmitter.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysBoxEmitter.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysBoxEmitter"] = NiPSysBoxEmitter::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysBoxEmitter", NiPSysBoxEmitter::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysCollider.cpp b/src/obj/NiPSysCollider.cpp
index 412f5eb2..01c5acbd 100644
--- a/src/obj/NiPSysCollider.cpp
+++ b/src/obj/NiPSysCollider.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysCollider.h"
 #include "../../include/obj/NiPSysSpawnModifier.h"
@@ -46,8 +47,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysCollider"] = NiPSysCollider::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysCollider", NiPSysCollider::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysColliderManager.cpp b/src/obj/NiPSysColliderManager.cpp
index 4c53e5b5..685c447f 100644
--- a/src/obj/NiPSysColliderManager.cpp
+++ b/src/obj/NiPSysColliderManager.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysColliderManager.h"
 #include "../../include/obj/NiPSysPlanarCollider.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysColliderManager"] = NiPSysColliderManager::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysColliderManager", NiPSysColliderManager::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysColorModifier.cpp b/src/obj/NiPSysColorModifier.cpp
index b18f375f..1f44adad 100644
--- a/src/obj/NiPSysColorModifier.cpp
+++ b/src/obj/NiPSysColorModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysColorModifier.h"
 #include "../../include/obj/NiColorData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysColorModifier"] = NiPSysColorModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysColorModifier", NiPSysColorModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysCylinderEmitter.cpp b/src/obj/NiPSysCylinderEmitter.cpp
index 0f77e7e0..4fe63557 100644
--- a/src/obj/NiPSysCylinderEmitter.cpp
+++ b/src/obj/NiPSysCylinderEmitter.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysCylinderEmitter.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysCylinderEmitter"] = NiPSysCylinderEmitter::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysCylinderEmitter", NiPSysCylinderEmitter::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysData.cpp b/src/obj/NiPSysData.cpp
index a57179ed..6a27a00c 100644
--- a/src/obj/NiPSysData.cpp
+++ b/src/obj/NiPSysData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysData"] = NiPSysData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysData", NiPSysData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysDragModifier.cpp b/src/obj/NiPSysDragModifier.cpp
index 5820d519..46576d2c 100644
--- a/src/obj/NiPSysDragModifier.cpp
+++ b/src/obj/NiPSysDragModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysDragModifier.h"
 #include "../../include/obj/NiObject.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysDragModifier"] = NiPSysDragModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysDragModifier", NiPSysDragModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitter.cpp b/src/obj/NiPSysEmitter.cpp
index e52666f7..b1fc2d87 100644
--- a/src/obj/NiPSysEmitter.cpp
+++ b/src/obj/NiPSysEmitter.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitter.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitter"] = NiPSysEmitter::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitter", NiPSysEmitter::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitterCtlr.cpp b/src/obj/NiPSysEmitterCtlr.cpp
index 9c383159..c37ad67f 100644
--- a/src/obj/NiPSysEmitterCtlr.cpp
+++ b/src/obj/NiPSysEmitterCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitterCtlr.h"
 #include "../../include/obj/NiPSysEmitterCtlrData.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitterCtlr"] = NiPSysEmitterCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitterCtlr", NiPSysEmitterCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitterCtlrData.cpp b/src/obj/NiPSysEmitterCtlrData.cpp
index 56d51f04..1989876b 100644
--- a/src/obj/NiPSysEmitterCtlrData.cpp
+++ b/src/obj/NiPSysEmitterCtlrData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitterCtlrData.h"
 #include "../../include/gen/KeyGroup.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitterCtlrData"] = NiPSysEmitterCtlrData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitterCtlrData", NiPSysEmitterCtlrData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitterDeclinationCtlr.cpp b/src/obj/NiPSysEmitterDeclinationCtlr.cpp
index 70032b15..8c662b08 100644
--- a/src/obj/NiPSysEmitterDeclinationCtlr.cpp
+++ b/src/obj/NiPSysEmitterDeclinationCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitterDeclinationCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitterDeclinationCtlr"] = NiPSysEmitterDeclinationCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitterDeclinationCtlr", NiPSysEmitterDeclinationCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitterDeclinationVarCtlr.cpp b/src/obj/NiPSysEmitterDeclinationVarCtlr.cpp
index f46a5b8a..2be970f5 100644
--- a/src/obj/NiPSysEmitterDeclinationVarCtlr.cpp
+++ b/src/obj/NiPSysEmitterDeclinationVarCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitterDeclinationVarCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitterDeclinationVarCtlr"] = NiPSysEmitterDeclinationVarCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitterDeclinationVarCtlr", NiPSysEmitterDeclinationVarCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitterInitialRadiusCtlr.cpp b/src/obj/NiPSysEmitterInitialRadiusCtlr.cpp
index 8b9c0426..8d82322b 100644
--- a/src/obj/NiPSysEmitterInitialRadiusCtlr.cpp
+++ b/src/obj/NiPSysEmitterInitialRadiusCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitterInitialRadiusCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitterInitialRadiusCtlr"] = NiPSysEmitterInitialRadiusCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitterInitialRadiusCtlr", NiPSysEmitterInitialRadiusCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitterLifeSpanCtlr.cpp b/src/obj/NiPSysEmitterLifeSpanCtlr.cpp
index 37eb730a..dbff256c 100644
--- a/src/obj/NiPSysEmitterLifeSpanCtlr.cpp
+++ b/src/obj/NiPSysEmitterLifeSpanCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitterLifeSpanCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitterLifeSpanCtlr"] = NiPSysEmitterLifeSpanCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitterLifeSpanCtlr", NiPSysEmitterLifeSpanCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysEmitterSpeedCtlr.cpp b/src/obj/NiPSysEmitterSpeedCtlr.cpp
index 9c1f01b4..978bce7a 100644
--- a/src/obj/NiPSysEmitterSpeedCtlr.cpp
+++ b/src/obj/NiPSysEmitterSpeedCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysEmitterSpeedCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysEmitterSpeedCtlr"] = NiPSysEmitterSpeedCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysEmitterSpeedCtlr", NiPSysEmitterSpeedCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysGravityModifier.cpp b/src/obj/NiPSysGravityModifier.cpp
index d952c032..99a659c4 100644
--- a/src/obj/NiPSysGravityModifier.cpp
+++ b/src/obj/NiPSysGravityModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysGravityModifier.h"
 #include "../../include/obj/NiNode.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysGravityModifier"] = NiPSysGravityModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysGravityModifier", NiPSysGravityModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysGravityStrengthCtlr.cpp b/src/obj/NiPSysGravityStrengthCtlr.cpp
index 3198cb07..5c1dd3c2 100644
--- a/src/obj/NiPSysGravityStrengthCtlr.cpp
+++ b/src/obj/NiPSysGravityStrengthCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysGravityStrengthCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysGravityStrengthCtlr"] = NiPSysGravityStrengthCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysGravityStrengthCtlr", NiPSysGravityStrengthCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysGrowFadeModifier.cpp b/src/obj/NiPSysGrowFadeModifier.cpp
index 664f2508..096f2eab 100644
--- a/src/obj/NiPSysGrowFadeModifier.cpp
+++ b/src/obj/NiPSysGrowFadeModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysGrowFadeModifier.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysGrowFadeModifier"] = NiPSysGrowFadeModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysGrowFadeModifier", NiPSysGrowFadeModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysMeshEmitter.cpp b/src/obj/NiPSysMeshEmitter.cpp
index 2c499a14..c4ead69b 100644
--- a/src/obj/NiPSysMeshEmitter.cpp
+++ b/src/obj/NiPSysMeshEmitter.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysMeshEmitter.h"
 #include "../../include/obj/NiTriBasedGeom.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysMeshEmitter"] = NiPSysMeshEmitter::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysMeshEmitter", NiPSysMeshEmitter::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysMeshUpdateModifier.cpp b/src/obj/NiPSysMeshUpdateModifier.cpp
index ae92a42c..156d3e24 100644
--- a/src/obj/NiPSysMeshUpdateModifier.cpp
+++ b/src/obj/NiPSysMeshUpdateModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysMeshUpdateModifier.h"
 #include "../../include/obj/NiNode.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysMeshUpdateModifier"] = NiPSysMeshUpdateModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysMeshUpdateModifier", NiPSysMeshUpdateModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysModifier.cpp b/src/obj/NiPSysModifier.cpp
index 77c601a7..7ac43605 100644
--- a/src/obj/NiPSysModifier.cpp
+++ b/src/obj/NiPSysModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysModifier.h"
 #include "../../include/obj/NiParticleSystem.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysModifier"] = NiPSysModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysModifier", NiPSysModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysModifierActiveCtlr.cpp b/src/obj/NiPSysModifierActiveCtlr.cpp
index 654a30e6..93b15e10 100644
--- a/src/obj/NiPSysModifierActiveCtlr.cpp
+++ b/src/obj/NiPSysModifierActiveCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysModifierActiveCtlr.h"
 #include "../../include/obj/NiVisData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysModifierActiveCtlr"] = NiPSysModifierActiveCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysModifierActiveCtlr", NiPSysModifierActiveCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysModifierBoolCtlr.cpp b/src/obj/NiPSysModifierBoolCtlr.cpp
index 252bcb5e..fe5f7eec 100644
--- a/src/obj/NiPSysModifierBoolCtlr.cpp
+++ b/src/obj/NiPSysModifierBoolCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysModifierBoolCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysModifierBoolCtlr"] = NiPSysModifierBoolCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysModifierBoolCtlr", NiPSysModifierBoolCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysModifierCtlr.cpp b/src/obj/NiPSysModifierCtlr.cpp
index f1eba0c9..ccc9f3f9 100644
--- a/src/obj/NiPSysModifierCtlr.cpp
+++ b/src/obj/NiPSysModifierCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysModifierCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysModifierCtlr"] = NiPSysModifierCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysModifierCtlr", NiPSysModifierCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysModifierFloatCtlr.cpp b/src/obj/NiPSysModifierFloatCtlr.cpp
index 721ec802..34acd2b7 100644
--- a/src/obj/NiPSysModifierFloatCtlr.cpp
+++ b/src/obj/NiPSysModifierFloatCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysModifierFloatCtlr.h"
 #include "../../include/obj/NiFloatData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysModifierFloatCtlr"] = NiPSysModifierFloatCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysModifierFloatCtlr", NiPSysModifierFloatCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysPlanarCollider.cpp b/src/obj/NiPSysPlanarCollider.cpp
index 825086aa..19abe6a1 100644
--- a/src/obj/NiPSysPlanarCollider.cpp
+++ b/src/obj/NiPSysPlanarCollider.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysPlanarCollider.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysPlanarCollider"] = NiPSysPlanarCollider::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysPlanarCollider", NiPSysPlanarCollider::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysPositionModifier.cpp b/src/obj/NiPSysPositionModifier.cpp
index 5eac172b..4365a838 100644
--- a/src/obj/NiPSysPositionModifier.cpp
+++ b/src/obj/NiPSysPositionModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysPositionModifier.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysPositionModifier"] = NiPSysPositionModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysPositionModifier", NiPSysPositionModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysResetOnLoopCtlr.cpp b/src/obj/NiPSysResetOnLoopCtlr.cpp
index 2fbbd40f..94600424 100644
--- a/src/obj/NiPSysResetOnLoopCtlr.cpp
+++ b/src/obj/NiPSysResetOnLoopCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysResetOnLoopCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysResetOnLoopCtlr"] = NiPSysResetOnLoopCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysResetOnLoopCtlr", NiPSysResetOnLoopCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysRotationModifier.cpp b/src/obj/NiPSysRotationModifier.cpp
index 9a0954b9..22374212 100644
--- a/src/obj/NiPSysRotationModifier.cpp
+++ b/src/obj/NiPSysRotationModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysRotationModifier.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysRotationModifier"] = NiPSysRotationModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysRotationModifier", NiPSysRotationModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysSpawnModifier.cpp b/src/obj/NiPSysSpawnModifier.cpp
index b2ff5335..f7327ea9 100644
--- a/src/obj/NiPSysSpawnModifier.cpp
+++ b/src/obj/NiPSysSpawnModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysSpawnModifier.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysSpawnModifier"] = NiPSysSpawnModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysSpawnModifier", NiPSysSpawnModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysSphereEmitter.cpp b/src/obj/NiPSysSphereEmitter.cpp
index 040da760..cfef1081 100644
--- a/src/obj/NiPSysSphereEmitter.cpp
+++ b/src/obj/NiPSysSphereEmitter.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysSphereEmitter.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysSphereEmitter"] = NiPSysSphereEmitter::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysSphereEmitter", NiPSysSphereEmitter::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysSphericalCollider.cpp b/src/obj/NiPSysSphericalCollider.cpp
index 7c57bb3c..8a8be6dc 100644
--- a/src/obj/NiPSysSphericalCollider.cpp
+++ b/src/obj/NiPSysSphericalCollider.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysSphericalCollider.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysSphericalCollider"] = NiPSysSphericalCollider::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysSphericalCollider", NiPSysSphericalCollider::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysUpdateCtlr.cpp b/src/obj/NiPSysUpdateCtlr.cpp
index 45bee883..44654767 100644
--- a/src/obj/NiPSysUpdateCtlr.cpp
+++ b/src/obj/NiPSysUpdateCtlr.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysUpdateCtlr.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysUpdateCtlr"] = NiPSysUpdateCtlr::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysUpdateCtlr", NiPSysUpdateCtlr::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPSysVolumeEmitter.cpp b/src/obj/NiPSysVolumeEmitter.cpp
index 96677d61..13ef4281 100644
--- a/src/obj/NiPSysVolumeEmitter.cpp
+++ b/src/obj/NiPSysVolumeEmitter.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPSysVolumeEmitter.h"
 #include "../../include/obj/NiNode.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPSysVolumeEmitter"] = NiPSysVolumeEmitter::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPSysVolumeEmitter", NiPSysVolumeEmitter::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPalette.cpp b/src/obj/NiPalette.cpp
index dc12c669..e5649b70 100644
--- a/src/obj/NiPalette.cpp
+++ b/src/obj/NiPalette.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPalette.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPalette"] = NiPalette::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPalette", NiPalette::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleBomb.cpp b/src/obj/NiParticleBomb.cpp
index 9e49fb27..62e769fa 100644
--- a/src/obj/NiParticleBomb.cpp
+++ b/src/obj/NiParticleBomb.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleBomb.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleBomb"] = NiParticleBomb::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleBomb", NiParticleBomb::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleColorModifier.cpp b/src/obj/NiParticleColorModifier.cpp
index 9862b7ad..4f86fd69 100644
--- a/src/obj/NiParticleColorModifier.cpp
+++ b/src/obj/NiParticleColorModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleColorModifier.h"
 #include "../../include/obj/NiColorData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleColorModifier"] = NiParticleColorModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleColorModifier", NiParticleColorModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleGrowFade.cpp b/src/obj/NiParticleGrowFade.cpp
index 5126fd27..2fc7019e 100644
--- a/src/obj/NiParticleGrowFade.cpp
+++ b/src/obj/NiParticleGrowFade.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleGrowFade.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleGrowFade"] = NiParticleGrowFade::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleGrowFade", NiParticleGrowFade::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleMeshModifier.cpp b/src/obj/NiParticleMeshModifier.cpp
index a4b0b3c7..ab2313ef 100644
--- a/src/obj/NiParticleMeshModifier.cpp
+++ b/src/obj/NiParticleMeshModifier.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleMeshModifier.h"
 #include "../../include/obj/NiAVObject.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleMeshModifier"] = NiParticleMeshModifier::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleMeshModifier", NiParticleMeshModifier::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleMeshes.cpp b/src/obj/NiParticleMeshes.cpp
index 022432ea..061c56af 100644
--- a/src/obj/NiParticleMeshes.cpp
+++ b/src/obj/NiParticleMeshes.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleMeshes.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleMeshes"] = NiParticleMeshes::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleMeshes", NiParticleMeshes::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleMeshesData.cpp b/src/obj/NiParticleMeshesData.cpp
index 60f5449c..9bf842e5 100644
--- a/src/obj/NiParticleMeshesData.cpp
+++ b/src/obj/NiParticleMeshesData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleMeshesData.h"
 #include "../../include/obj/NiAVObject.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleMeshesData"] = NiParticleMeshesData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleMeshesData", NiParticleMeshesData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleRotation.cpp b/src/obj/NiParticleRotation.cpp
index 9f7c0171..42b6e021 100644
--- a/src/obj/NiParticleRotation.cpp
+++ b/src/obj/NiParticleRotation.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleRotation.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleRotation"] = NiParticleRotation::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleRotation", NiParticleRotation::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleSystem.cpp b/src/obj/NiParticleSystem.cpp
index 0350935a..05466bf4 100644
--- a/src/obj/NiParticleSystem.cpp
+++ b/src/obj/NiParticleSystem.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleSystem.h"
 #include "../../include/obj/NiPSysModifier.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleSystem"] = NiParticleSystem::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleSystem", NiParticleSystem::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticleSystemController.cpp b/src/obj/NiParticleSystemController.cpp
index 81414a85..90a9e8f9 100644
--- a/src/obj/NiParticleSystemController.cpp
+++ b/src/obj/NiParticleSystemController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticleSystemController.h"
 #include "../../include/gen/Particle.h"
@@ -48,8 +49,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticleSystemController"] = NiParticleSystemController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticleSystemController", NiParticleSystemController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticles.cpp b/src/obj/NiParticles.cpp
index c32d5c3d..c529bcfc 100644
--- a/src/obj/NiParticles.cpp
+++ b/src/obj/NiParticles.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticles.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticles"] = NiParticles::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticles", NiParticles::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiParticlesData.cpp b/src/obj/NiParticlesData.cpp
index 77755137..eaa3fb70 100644
--- a/src/obj/NiParticlesData.cpp
+++ b/src/obj/NiParticlesData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiParticlesData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiParticlesData"] = NiParticlesData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiParticlesData", NiParticlesData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPathController.cpp b/src/obj/NiPathController.cpp
index 4d8723cb..db48f369 100644
--- a/src/obj/NiPathController.cpp
+++ b/src/obj/NiPathController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPathController.h"
 #include "../../include/obj/NiPosData.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPathController"] = NiPathController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPathController", NiPathController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPathInterpolator.cpp b/src/obj/NiPathInterpolator.cpp
index eb94abc4..0b64d3e6 100644
--- a/src/obj/NiPathInterpolator.cpp
+++ b/src/obj/NiPathInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPathInterpolator.h"
 #include "../../include/obj/NiPosData.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPathInterpolator"] = NiPathInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPathInterpolator", NiPathInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPixelData.cpp b/src/obj/NiPixelData.cpp
index a3e06ff9..11a798e9 100644
--- a/src/obj/NiPixelData.cpp
+++ b/src/obj/NiPixelData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPixelData.h"
 #include "../../include/gen/MipMap.h"
@@ -46,8 +47,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPixelData"] = NiPixelData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPixelData", NiPixelData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPlanarCollider.cpp b/src/obj/NiPlanarCollider.cpp
index c16b7c6f..f7482c66 100644
--- a/src/obj/NiPlanarCollider.cpp
+++ b/src/obj/NiPlanarCollider.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPlanarCollider.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPlanarCollider"] = NiPlanarCollider::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPlanarCollider", NiPlanarCollider::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPoint3InterpController.cpp b/src/obj/NiPoint3InterpController.cpp
index 3d9e321c..86c8bcbd 100644
--- a/src/obj/NiPoint3InterpController.cpp
+++ b/src/obj/NiPoint3InterpController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPoint3InterpController.h"
 #include "../../include/obj/NiPosData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPoint3InterpController"] = NiPoint3InterpController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPoint3InterpController", NiPoint3InterpController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPoint3Interpolator.cpp b/src/obj/NiPoint3Interpolator.cpp
index 2dff6ce6..15544532 100644
--- a/src/obj/NiPoint3Interpolator.cpp
+++ b/src/obj/NiPoint3Interpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPoint3Interpolator.h"
 #include "../../include/obj/NiPosData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPoint3Interpolator"] = NiPoint3Interpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPoint3Interpolator", NiPoint3Interpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPointLight.cpp b/src/obj/NiPointLight.cpp
index 697e4463..a3b6651a 100644
--- a/src/obj/NiPointLight.cpp
+++ b/src/obj/NiPointLight.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPointLight.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPointLight"] = NiPointLight::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPointLight", NiPointLight::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiPosData.cpp b/src/obj/NiPosData.cpp
index ee02576e..58126833 100644
--- a/src/obj/NiPosData.cpp
+++ b/src/obj/NiPosData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiPosData.h"
 #include "../../include/gen/KeyGroup.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiPosData"] = NiPosData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiPosData", NiPosData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiProperty.cpp b/src/obj/NiProperty.cpp
index ce799510..92e282f8 100644
--- a/src/obj/NiProperty.cpp
+++ b/src/obj/NiProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiProperty"] = NiProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiProperty", NiProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiRangeLODData.cpp b/src/obj/NiRangeLODData.cpp
index ce6f7771..23421fae 100644
--- a/src/obj/NiRangeLODData.cpp
+++ b/src/obj/NiRangeLODData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiRangeLODData.h"
 #include "../../include/gen/LODRange.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiRangeLODData"] = NiRangeLODData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiRangeLODData", NiRangeLODData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiRawImageData.cpp b/src/obj/NiRawImageData.cpp
index 96e3e75c..c1b48c4c 100644
--- a/src/obj/NiRawImageData.cpp
+++ b/src/obj/NiRawImageData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiRawImageData.h"
 #include "../../include/gen/ByteColor3.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiRawImageData"] = NiRawImageData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiRawImageData", NiRawImageData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiRollController.cpp b/src/obj/NiRollController.cpp
index 99d2421c..81829eb4 100644
--- a/src/obj/NiRollController.cpp
+++ b/src/obj/NiRollController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiRollController.h"
 #include "../../include/obj/NiFloatData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiRollController"] = NiRollController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiRollController", NiRollController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiRotatingParticles.cpp b/src/obj/NiRotatingParticles.cpp
index d68578f9..f0758974 100644
--- a/src/obj/NiRotatingParticles.cpp
+++ b/src/obj/NiRotatingParticles.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiRotatingParticles.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiRotatingParticles"] = NiRotatingParticles::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiRotatingParticles", NiRotatingParticles::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiRotatingParticlesData.cpp b/src/obj/NiRotatingParticlesData.cpp
index 17b06e62..d15f8923 100644
--- a/src/obj/NiRotatingParticlesData.cpp
+++ b/src/obj/NiRotatingParticlesData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiRotatingParticlesData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiRotatingParticlesData"] = NiRotatingParticlesData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiRotatingParticlesData", NiRotatingParticlesData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiScreenLODData.cpp b/src/obj/NiScreenLODData.cpp
index e37d8369..b33ad5de 100644
--- a/src/obj/NiScreenLODData.cpp
+++ b/src/obj/NiScreenLODData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiScreenLODData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiScreenLODData"] = NiScreenLODData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiScreenLODData", NiScreenLODData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSequence.cpp b/src/obj/NiSequence.cpp
index ba60babf..d9da9fb2 100644
--- a/src/obj/NiSequence.cpp
+++ b/src/obj/NiSequence.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSequence.h"
 #include "../../include/gen/ControllerLink.h"
@@ -49,8 +50,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSequence"] = NiSequence::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSequence", NiSequence::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSequenceStreamHelper.cpp b/src/obj/NiSequenceStreamHelper.cpp
index 34494cf6..28e79dea 100644
--- a/src/obj/NiSequenceStreamHelper.cpp
+++ b/src/obj/NiSequenceStreamHelper.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSequenceStreamHelper.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSequenceStreamHelper"] = NiSequenceStreamHelper::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSequenceStreamHelper", NiSequenceStreamHelper::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiShadeProperty.cpp b/src/obj/NiShadeProperty.cpp
index c844c350..cacb2901 100644
--- a/src/obj/NiShadeProperty.cpp
+++ b/src/obj/NiShadeProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiShadeProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiShadeProperty"] = NiShadeProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiShadeProperty", NiShadeProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSingleInterpController.cpp b/src/obj/NiSingleInterpController.cpp
index c6b01867..93e3e229 100644
--- a/src/obj/NiSingleInterpController.cpp
+++ b/src/obj/NiSingleInterpController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSingleInterpController.h"
 #include "../../include/obj/NiInterpolator.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSingleInterpController"] = NiSingleInterpController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSingleInterpController", NiSingleInterpController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSkinData.cpp b/src/obj/NiSkinData.cpp
index e13bbbf0..4456c398 100644
--- a/src/obj/NiSkinData.cpp
+++ b/src/obj/NiSkinData.cpp
@@ -14,6 +14,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSkinData.h"
 #include "../../include/gen/SkinData.h"
@@ -50,8 +51,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSkinData"] = NiSkinData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSkinData", NiSkinData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSkinInstance.cpp b/src/obj/NiSkinInstance.cpp
index c4848a13..7520f1fd 100644
--- a/src/obj/NiSkinInstance.cpp
+++ b/src/obj/NiSkinInstance.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSkinInstance.h"
 #include "../../include/obj/NiSkinData.h"
@@ -58,8 +59,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSkinInstance"] = NiSkinInstance::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSkinInstance", NiSkinInstance::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSkinPartition.cpp b/src/obj/NiSkinPartition.cpp
index 818f9134..399205e4 100644
--- a/src/obj/NiSkinPartition.cpp
+++ b/src/obj/NiSkinPartition.cpp
@@ -39,6 +39,7 @@ typedef vector<SkinPartition> PartitionList;
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSkinPartition.h"
 #include "../../include/gen/SkinPartition.h"
@@ -72,8 +73,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSkinPartition"] = NiSkinPartition::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSkinPartition", NiSkinPartition::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSourceTexture.cpp b/src/obj/NiSourceTexture.cpp
index f5f1b033..e0041dca 100644
--- a/src/obj/NiSourceTexture.cpp
+++ b/src/obj/NiSourceTexture.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSourceTexture.h"
 #include "../../include/obj/NiObject.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSourceTexture"] = NiSourceTexture::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSourceTexture", NiSourceTexture::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSpecularProperty.cpp b/src/obj/NiSpecularProperty.cpp
index db298968..c2e4076f 100644
--- a/src/obj/NiSpecularProperty.cpp
+++ b/src/obj/NiSpecularProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSpecularProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSpecularProperty"] = NiSpecularProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSpecularProperty", NiSpecularProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSphericalCollider.cpp b/src/obj/NiSphericalCollider.cpp
index 4b770ef0..73bfbc82 100644
--- a/src/obj/NiSphericalCollider.cpp
+++ b/src/obj/NiSphericalCollider.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSphericalCollider.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSphericalCollider"] = NiSphericalCollider::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSphericalCollider", NiSphericalCollider::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSpotLight.cpp b/src/obj/NiSpotLight.cpp
index 2d03d7fd..73c9c422 100644
--- a/src/obj/NiSpotLight.cpp
+++ b/src/obj/NiSpotLight.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSpotLight.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSpotLight"] = NiSpotLight::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSpotLight", NiSpotLight::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiStencilProperty.cpp b/src/obj/NiStencilProperty.cpp
index e45806ec..77532e1f 100644
--- a/src/obj/NiStencilProperty.cpp
+++ b/src/obj/NiStencilProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiStencilProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiStencilProperty"] = NiStencilProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiStencilProperty", NiStencilProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiStringExtraData.cpp b/src/obj/NiStringExtraData.cpp
index 21c90f32..ade57350 100644
--- a/src/obj/NiStringExtraData.cpp
+++ b/src/obj/NiStringExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiStringExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiStringExtraData"] = NiStringExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiStringExtraData", NiStringExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiStringPalette.cpp b/src/obj/NiStringPalette.cpp
index b6d5d712..9e180c22 100644
--- a/src/obj/NiStringPalette.cpp
+++ b/src/obj/NiStringPalette.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiStringPalette.h"
 #include "../../include/gen/StringPalette.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiStringPalette"] = NiStringPalette::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiStringPalette", NiStringPalette::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiStringsExtraData.cpp b/src/obj/NiStringsExtraData.cpp
index e3b2826b..a9618020 100644
--- a/src/obj/NiStringsExtraData.cpp
+++ b/src/obj/NiStringsExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiStringsExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiStringsExtraData"] = NiStringsExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiStringsExtraData", NiStringsExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiSwitchNode.cpp b/src/obj/NiSwitchNode.cpp
index 76180777..153fcdec 100644
--- a/src/obj/NiSwitchNode.cpp
+++ b/src/obj/NiSwitchNode.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiSwitchNode.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiSwitchNode"] = NiSwitchNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiSwitchNode", NiSwitchNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTextKeyExtraData.cpp b/src/obj/NiTextKeyExtraData.cpp
index f17970c2..2c066ddb 100644
--- a/src/obj/NiTextKeyExtraData.cpp
+++ b/src/obj/NiTextKeyExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTextKeyExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTextKeyExtraData"] = NiTextKeyExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTextKeyExtraData", NiTextKeyExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTexture.cpp b/src/obj/NiTexture.cpp
index a7aa6cbf..3dd99f3d 100644
--- a/src/obj/NiTexture.cpp
+++ b/src/obj/NiTexture.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTexture.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTexture"] = NiTexture::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTexture", NiTexture::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTextureEffect.cpp b/src/obj/NiTextureEffect.cpp
index 4fdd03d5..0a43836c 100644
--- a/src/obj/NiTextureEffect.cpp
+++ b/src/obj/NiTextureEffect.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTextureEffect.h"
 #include "../../include/obj/NiSourceTexture.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTextureEffect"] = NiTextureEffect::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTextureEffect", NiTextureEffect::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTextureModeProperty.cpp b/src/obj/NiTextureModeProperty.cpp
index 5951d16d..e5dca9b0 100644
--- a/src/obj/NiTextureModeProperty.cpp
+++ b/src/obj/NiTextureModeProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTextureModeProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTextureModeProperty"] = NiTextureModeProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTextureModeProperty", NiTextureModeProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTextureProperty.cpp b/src/obj/NiTextureProperty.cpp
index ee3554ec..2be4acef 100644
--- a/src/obj/NiTextureProperty.cpp
+++ b/src/obj/NiTextureProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTextureProperty.h"
 #include "../../include/obj/NiImage.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTextureProperty"] = NiTextureProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTextureProperty", NiTextureProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTextureTransformController.cpp b/src/obj/NiTextureTransformController.cpp
index c528bc6c..dd87a51e 100644
--- a/src/obj/NiTextureTransformController.cpp
+++ b/src/obj/NiTextureTransformController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTextureTransformController.h"
 #include "../../include/obj/NiFloatData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTextureTransformController"] = NiTextureTransformController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTextureTransformController", NiTextureTransformController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTexturingProperty.cpp b/src/obj/NiTexturingProperty.cpp
index 5ccd92fe..b34bc1da 100644
--- a/src/obj/NiTexturingProperty.cpp
+++ b/src/obj/NiTexturingProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTexturingProperty.h"
 #include "../../include/gen/TexDesc.h"
@@ -66,8 +67,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTexturingProperty"] = NiTexturingProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTexturingProperty", NiTexturingProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTimeController.cpp b/src/obj/NiTimeController.cpp
index f718864c..d346f975 100644
--- a/src/obj/NiTimeController.cpp
+++ b/src/obj/NiTimeController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTimeController.h"
 #include "../../include/obj/NiObjectNET.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTimeController"] = NiTimeController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTimeController", NiTimeController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTransformController.cpp b/src/obj/NiTransformController.cpp
index 5dac92a3..16d71ecc 100644
--- a/src/obj/NiTransformController.cpp
+++ b/src/obj/NiTransformController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTransformController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTransformController"] = NiTransformController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTransformController", NiTransformController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTransformData.cpp b/src/obj/NiTransformData.cpp
index bafef508..6e64d1fa 100644
--- a/src/obj/NiTransformData.cpp
+++ b/src/obj/NiTransformData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTransformData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTransformData"] = NiTransformData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTransformData", NiTransformData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTransformInterpolator.cpp b/src/obj/NiTransformInterpolator.cpp
index b20bfb18..135b5797 100644
--- a/src/obj/NiTransformInterpolator.cpp
+++ b/src/obj/NiTransformInterpolator.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTransformInterpolator.h"
 #include "../../include/obj/NiTransformData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTransformInterpolator"] = NiTransformInterpolator::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTransformInterpolator", NiTransformInterpolator::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTriBasedGeom.cpp b/src/obj/NiTriBasedGeom.cpp
index 3224d54c..8ca51cf5 100644
--- a/src/obj/NiTriBasedGeom.cpp
+++ b/src/obj/NiTriBasedGeom.cpp
@@ -16,6 +16,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTriBasedGeom.h"
 using namespace Niflib;
@@ -48,8 +49,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTriBasedGeom"] = NiTriBasedGeom::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTriBasedGeom", NiTriBasedGeom::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTriBasedGeomData.cpp b/src/obj/NiTriBasedGeomData.cpp
index b80fad7d..06ab5534 100644
--- a/src/obj/NiTriBasedGeomData.cpp
+++ b/src/obj/NiTriBasedGeomData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTriBasedGeomData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTriBasedGeomData"] = NiTriBasedGeomData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTriBasedGeomData", NiTriBasedGeomData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTriShape.cpp b/src/obj/NiTriShape.cpp
index 15a1f92d..484a2c4e 100644
--- a/src/obj/NiTriShape.cpp
+++ b/src/obj/NiTriShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTriShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTriShape"] = NiTriShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTriShape", NiTriShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTriShapeData.cpp b/src/obj/NiTriShapeData.cpp
index e188b0a7..cd3c4717 100644
--- a/src/obj/NiTriShapeData.cpp
+++ b/src/obj/NiTriShapeData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTriShapeData.h"
 #include "../../include/gen/MatchGroup.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTriShapeData"] = NiTriShapeData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTriShapeData", NiTriShapeData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTriShapeSkinController.cpp b/src/obj/NiTriShapeSkinController.cpp
index 28a7b7eb..91831091 100644
--- a/src/obj/NiTriShapeSkinController.cpp
+++ b/src/obj/NiTriShapeSkinController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTriShapeSkinController.h"
 #include "../../include/gen/OldSkinData.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTriShapeSkinController"] = NiTriShapeSkinController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTriShapeSkinController", NiTriShapeSkinController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTriStrips.cpp b/src/obj/NiTriStrips.cpp
index cf90f218..a9bb80c2 100644
--- a/src/obj/NiTriStrips.cpp
+++ b/src/obj/NiTriStrips.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTriStrips.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTriStrips"] = NiTriStrips::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTriStrips", NiTriStrips::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiTriStripsData.cpp b/src/obj/NiTriStripsData.cpp
index 3001ce36..512dbd5a 100644
--- a/src/obj/NiTriStripsData.cpp
+++ b/src/obj/NiTriStripsData.cpp
@@ -24,6 +24,7 @@ typedef	std::list<TriStrip> TriStrips;
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiTriStripsData.h"
 using namespace Niflib;
@@ -56,8 +57,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiTriStripsData"] = NiTriStripsData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiTriStripsData", NiTriStripsData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiUVController.cpp b/src/obj/NiUVController.cpp
index 83455ca3..87e631dd 100644
--- a/src/obj/NiUVController.cpp
+++ b/src/obj/NiUVController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiUVController.h"
 #include "../../include/obj/NiUVData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiUVController"] = NiUVController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiUVController", NiUVController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiUVData.cpp b/src/obj/NiUVData.cpp
index c107fa42..f52175cc 100644
--- a/src/obj/NiUVData.cpp
+++ b/src/obj/NiUVData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiUVData.h"
 #include "../../include/gen/KeyGroup.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiUVData"] = NiUVData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiUVData", NiUVData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiVectorExtraData.cpp b/src/obj/NiVectorExtraData.cpp
index ffda4f8d..192e5ebd 100644
--- a/src/obj/NiVectorExtraData.cpp
+++ b/src/obj/NiVectorExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiVectorExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiVectorExtraData"] = NiVectorExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiVectorExtraData", NiVectorExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiVertWeightsExtraData.cpp b/src/obj/NiVertWeightsExtraData.cpp
index 9640160e..9c5d728b 100644
--- a/src/obj/NiVertWeightsExtraData.cpp
+++ b/src/obj/NiVertWeightsExtraData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiVertWeightsExtraData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiVertWeightsExtraData"] = NiVertWeightsExtraData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiVertWeightsExtraData", NiVertWeightsExtraData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiVertexColorProperty.cpp b/src/obj/NiVertexColorProperty.cpp
index f9549771..5d29d756 100644
--- a/src/obj/NiVertexColorProperty.cpp
+++ b/src/obj/NiVertexColorProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiVertexColorProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiVertexColorProperty"] = NiVertexColorProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiVertexColorProperty", NiVertexColorProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiVisController.cpp b/src/obj/NiVisController.cpp
index 9d7e79b3..bce2216b 100644
--- a/src/obj/NiVisController.cpp
+++ b/src/obj/NiVisController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiVisController.h"
 #include "../../include/obj/NiVisData.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiVisController"] = NiVisController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiVisController", NiVisController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiVisData.cpp b/src/obj/NiVisData.cpp
index cc38b323..e0167449 100644
--- a/src/obj/NiVisData.cpp
+++ b/src/obj/NiVisData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiVisData.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiVisData"] = NiVisData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiVisData", NiVisData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiWireframeProperty.cpp b/src/obj/NiWireframeProperty.cpp
index 2f2fd0e2..e82d7fb5 100644
--- a/src/obj/NiWireframeProperty.cpp
+++ b/src/obj/NiWireframeProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiWireframeProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiWireframeProperty"] = NiWireframeProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiWireframeProperty", NiWireframeProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/NiZBufferProperty.cpp b/src/obj/NiZBufferProperty.cpp
index 1faf321f..b5deea74 100644
--- a/src/obj/NiZBufferProperty.cpp
+++ b/src/obj/NiZBufferProperty.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/NiZBufferProperty.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["NiZBufferProperty"] = NiZBufferProperty::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "NiZBufferProperty", NiZBufferProperty::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/RootCollisionNode.cpp b/src/obj/RootCollisionNode.cpp
index 9702fd3a..75dad327 100644
--- a/src/obj/RootCollisionNode.cpp
+++ b/src/obj/RootCollisionNode.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/RootCollisionNode.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["RootCollisionNode"] = RootCollisionNode::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "RootCollisionNode", RootCollisionNode::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkBlendCollisionObject.cpp b/src/obj/bhkBlendCollisionObject.cpp
index cab1dc9c..f9427719 100644
--- a/src/obj/bhkBlendCollisionObject.cpp
+++ b/src/obj/bhkBlendCollisionObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkBlendCollisionObject.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkBlendCollisionObject"] = bhkBlendCollisionObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkBlendCollisionObject", bhkBlendCollisionObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkBlendController.cpp b/src/obj/bhkBlendController.cpp
index 0787e1c6..31c774fb 100644
--- a/src/obj/bhkBlendController.cpp
+++ b/src/obj/bhkBlendController.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkBlendController.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkBlendController"] = bhkBlendController::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkBlendController", bhkBlendController::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkBoxShape.cpp b/src/obj/bhkBoxShape.cpp
index f48cf8fe..0a0168d6 100644
--- a/src/obj/bhkBoxShape.cpp
+++ b/src/obj/bhkBoxShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkBoxShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkBoxShape"] = bhkBoxShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkBoxShape", bhkBoxShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkBvTreeShape.cpp b/src/obj/bhkBvTreeShape.cpp
index c577bd0a..011a8b18 100644
--- a/src/obj/bhkBvTreeShape.cpp
+++ b/src/obj/bhkBvTreeShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkBvTreeShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkBvTreeShape"] = bhkBvTreeShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkBvTreeShape", bhkBvTreeShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkCapsuleShape.cpp b/src/obj/bhkCapsuleShape.cpp
index 6fc1bdaf..9f32343f 100644
--- a/src/obj/bhkCapsuleShape.cpp
+++ b/src/obj/bhkCapsuleShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkCapsuleShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkCapsuleShape"] = bhkCapsuleShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkCapsuleShape", bhkCapsuleShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkCollisionObject.cpp b/src/obj/bhkCollisionObject.cpp
index 4f027172..227e62f5 100644
--- a/src/obj/bhkCollisionObject.cpp
+++ b/src/obj/bhkCollisionObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkCollisionObject.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkCollisionObject"] = bhkCollisionObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkCollisionObject", bhkCollisionObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkConstraint.cpp b/src/obj/bhkConstraint.cpp
index f32170ef..7a9b80fe 100644
--- a/src/obj/bhkConstraint.cpp
+++ b/src/obj/bhkConstraint.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkConstraint.h"
 #include "../../include/obj/bhkEntity.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkConstraint"] = bhkConstraint::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkConstraint", bhkConstraint::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkConvexShape.cpp b/src/obj/bhkConvexShape.cpp
index 0e75e217..ee06652f 100644
--- a/src/obj/bhkConvexShape.cpp
+++ b/src/obj/bhkConvexShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkConvexShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkConvexShape"] = bhkConvexShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkConvexShape", bhkConvexShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkConvexTransformShape.cpp b/src/obj/bhkConvexTransformShape.cpp
index ad351729..9365dab0 100644
--- a/src/obj/bhkConvexTransformShape.cpp
+++ b/src/obj/bhkConvexTransformShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkConvexTransformShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkConvexTransformShape"] = bhkConvexTransformShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkConvexTransformShape", bhkConvexTransformShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkConvexVerticesShape.cpp b/src/obj/bhkConvexVerticesShape.cpp
index ad2a7a48..92efd373 100644
--- a/src/obj/bhkConvexVerticesShape.cpp
+++ b/src/obj/bhkConvexVerticesShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkConvexVerticesShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkConvexVerticesShape"] = bhkConvexVerticesShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkConvexVerticesShape", bhkConvexVerticesShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkEntity.cpp b/src/obj/bhkEntity.cpp
index 0fbb1f68..f98175c0 100644
--- a/src/obj/bhkEntity.cpp
+++ b/src/obj/bhkEntity.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkEntity.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkEntity"] = bhkEntity::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkEntity", bhkEntity::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkHingeConstraint.cpp b/src/obj/bhkHingeConstraint.cpp
index 21837417..8793c041 100644
--- a/src/obj/bhkHingeConstraint.cpp
+++ b/src/obj/bhkHingeConstraint.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkHingeConstraint.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkHingeConstraint"] = bhkHingeConstraint::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkHingeConstraint", bhkHingeConstraint::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkLimitedHingeConstraint.cpp b/src/obj/bhkLimitedHingeConstraint.cpp
index 6e50759c..26ff69a1 100644
--- a/src/obj/bhkLimitedHingeConstraint.cpp
+++ b/src/obj/bhkLimitedHingeConstraint.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkLimitedHingeConstraint.h"
 #include "../../include/gen/LimitedHingeDescriptor.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkLimitedHingeConstraint"] = bhkLimitedHingeConstraint::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkLimitedHingeConstraint", bhkLimitedHingeConstraint::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkListShape.cpp b/src/obj/bhkListShape.cpp
index 81c552b0..6e5b9dbc 100644
--- a/src/obj/bhkListShape.cpp
+++ b/src/obj/bhkListShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkListShape.h"
 #include "../../include/obj/bhkShape.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkListShape"] = bhkListShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkListShape", bhkListShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkMalleableConstraint.cpp b/src/obj/bhkMalleableConstraint.cpp
index 0c698c62..05bce480 100644
--- a/src/obj/bhkMalleableConstraint.cpp
+++ b/src/obj/bhkMalleableConstraint.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkMalleableConstraint.h"
 #include "../../include/gen/RagdollDescriptor.h"
@@ -46,8 +47,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkMalleableConstraint"] = bhkMalleableConstraint::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkMalleableConstraint", bhkMalleableConstraint::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkMoppBvTreeShape.cpp b/src/obj/bhkMoppBvTreeShape.cpp
index 17a3c623..ad21d1ef 100644
--- a/src/obj/bhkMoppBvTreeShape.cpp
+++ b/src/obj/bhkMoppBvTreeShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkMoppBvTreeShape.h"
 #include "../../include/obj/bhkShape.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkMoppBvTreeShape"] = bhkMoppBvTreeShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkMoppBvTreeShape", bhkMoppBvTreeShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkMultiSphereShape.cpp b/src/obj/bhkMultiSphereShape.cpp
index 3c9bb1eb..7f85ed89 100644
--- a/src/obj/bhkMultiSphereShape.cpp
+++ b/src/obj/bhkMultiSphereShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkMultiSphereShape.h"
 #include "../../include/gen/Sphere.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkMultiSphereShape"] = bhkMultiSphereShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkMultiSphereShape", bhkMultiSphereShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkNiCollisionObject.cpp b/src/obj/bhkNiCollisionObject.cpp
index cee64dd5..5b7ac31d 100644
--- a/src/obj/bhkNiCollisionObject.cpp
+++ b/src/obj/bhkNiCollisionObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkNiCollisionObject.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkNiCollisionObject"] = bhkNiCollisionObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkNiCollisionObject", bhkNiCollisionObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkNiTriStripsShape.cpp b/src/obj/bhkNiTriStripsShape.cpp
index 79315546..f97387d1 100644
--- a/src/obj/bhkNiTriStripsShape.cpp
+++ b/src/obj/bhkNiTriStripsShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkNiTriStripsShape.h"
 #include "../../include/gen/OblivionColFilter.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkNiTriStripsShape"] = bhkNiTriStripsShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkNiTriStripsShape", bhkNiTriStripsShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkPCollisionObject.cpp b/src/obj/bhkPCollisionObject.cpp
index 74d96696..99bd88c7 100644
--- a/src/obj/bhkPCollisionObject.cpp
+++ b/src/obj/bhkPCollisionObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkPCollisionObject.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkPCollisionObject"] = bhkPCollisionObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkPCollisionObject", bhkPCollisionObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkPackedNiTriStripsShape.cpp b/src/obj/bhkPackedNiTriStripsShape.cpp
index fdfe85c4..eeedb116 100644
--- a/src/obj/bhkPackedNiTriStripsShape.cpp
+++ b/src/obj/bhkPackedNiTriStripsShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkPackedNiTriStripsShape.h"
 #include "../../include/gen/OblivionSubShape.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkPackedNiTriStripsShape"] = bhkPackedNiTriStripsShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkPackedNiTriStripsShape", bhkPackedNiTriStripsShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkPhantom.cpp b/src/obj/bhkPhantom.cpp
index 7c4a6cf5..e298608f 100644
--- a/src/obj/bhkPhantom.cpp
+++ b/src/obj/bhkPhantom.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkPhantom.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkPhantom"] = bhkPhantom::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkPhantom", bhkPhantom::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkPrismaticConstraint.cpp b/src/obj/bhkPrismaticConstraint.cpp
index 54b0f3a3..f397e12f 100644
--- a/src/obj/bhkPrismaticConstraint.cpp
+++ b/src/obj/bhkPrismaticConstraint.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkPrismaticConstraint.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkPrismaticConstraint"] = bhkPrismaticConstraint::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkPrismaticConstraint", bhkPrismaticConstraint::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkRagdollConstraint.cpp b/src/obj/bhkRagdollConstraint.cpp
index cb495dab..a00293ef 100644
--- a/src/obj/bhkRagdollConstraint.cpp
+++ b/src/obj/bhkRagdollConstraint.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkRagdollConstraint.h"
 #include "../../include/gen/RagdollDescriptor.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkRagdollConstraint"] = bhkRagdollConstraint::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkRagdollConstraint", bhkRagdollConstraint::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkRefObject.cpp b/src/obj/bhkRefObject.cpp
index 9f7b7812..f3c627bf 100644
--- a/src/obj/bhkRefObject.cpp
+++ b/src/obj/bhkRefObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkRefObject.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkRefObject"] = bhkRefObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkRefObject", bhkRefObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkRigidBody.cpp b/src/obj/bhkRigidBody.cpp
index 29ad51c7..b17574e6 100644
--- a/src/obj/bhkRigidBody.cpp
+++ b/src/obj/bhkRigidBody.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkRigidBody.h"
 #include "../../include/gen/QuaternionXYZW.h"
@@ -45,8 +46,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkRigidBody"] = bhkRigidBody::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkRigidBody", bhkRigidBody::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkRigidBodyT.cpp b/src/obj/bhkRigidBodyT.cpp
index 1c7d7512..4533c290 100644
--- a/src/obj/bhkRigidBodyT.cpp
+++ b/src/obj/bhkRigidBodyT.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkRigidBodyT.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkRigidBodyT"] = bhkRigidBodyT::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkRigidBodyT", bhkRigidBodyT::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkSPCollisionObject.cpp b/src/obj/bhkSPCollisionObject.cpp
index ee4786d7..d824ea9c 100644
--- a/src/obj/bhkSPCollisionObject.cpp
+++ b/src/obj/bhkSPCollisionObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkSPCollisionObject.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkSPCollisionObject"] = bhkSPCollisionObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkSPCollisionObject", bhkSPCollisionObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkSerializable.cpp b/src/obj/bhkSerializable.cpp
index ca0451e3..94f0aa77 100644
--- a/src/obj/bhkSerializable.cpp
+++ b/src/obj/bhkSerializable.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkSerializable.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkSerializable"] = bhkSerializable::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkSerializable", bhkSerializable::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkShape.cpp b/src/obj/bhkShape.cpp
index f0b96a6f..26629ba7 100644
--- a/src/obj/bhkShape.cpp
+++ b/src/obj/bhkShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkShape"] = bhkShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkShape", bhkShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkShapeCollection.cpp b/src/obj/bhkShapeCollection.cpp
index a25ad12a..d072bb5b 100644
--- a/src/obj/bhkShapeCollection.cpp
+++ b/src/obj/bhkShapeCollection.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkShapeCollection.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkShapeCollection"] = bhkShapeCollection::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkShapeCollection", bhkShapeCollection::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkShapePhantom.cpp b/src/obj/bhkShapePhantom.cpp
index cfed30e7..8c918792 100644
--- a/src/obj/bhkShapePhantom.cpp
+++ b/src/obj/bhkShapePhantom.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkShapePhantom.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkShapePhantom"] = bhkShapePhantom::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkShapePhantom", bhkShapePhantom::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkSimpleShapePhantom.cpp b/src/obj/bhkSimpleShapePhantom.cpp
index a72a6216..9109873f 100644
--- a/src/obj/bhkSimpleShapePhantom.cpp
+++ b/src/obj/bhkSimpleShapePhantom.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkSimpleShapePhantom.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkSimpleShapePhantom"] = bhkSimpleShapePhantom::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkSimpleShapePhantom", bhkSimpleShapePhantom::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkSphereRepShape.cpp b/src/obj/bhkSphereRepShape.cpp
index 1b9f4e7c..892fa316 100644
--- a/src/obj/bhkSphereRepShape.cpp
+++ b/src/obj/bhkSphereRepShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkSphereRepShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkSphereRepShape"] = bhkSphereRepShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkSphereRepShape", bhkSphereRepShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkSphereShape.cpp b/src/obj/bhkSphereShape.cpp
index 57882041..33d33755 100644
--- a/src/obj/bhkSphereShape.cpp
+++ b/src/obj/bhkSphereShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkSphereShape.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkSphereShape"] = bhkSphereShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkSphereShape", bhkSphereShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkStiffSpringConstraint.cpp b/src/obj/bhkStiffSpringConstraint.cpp
index d23bf1a0..d1b7e7f8 100644
--- a/src/obj/bhkStiffSpringConstraint.cpp
+++ b/src/obj/bhkStiffSpringConstraint.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkStiffSpringConstraint.h"
 using namespace Niflib;
@@ -43,8 +44,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkStiffSpringConstraint"] = bhkStiffSpringConstraint::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkStiffSpringConstraint", bhkStiffSpringConstraint::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkTransformShape.cpp b/src/obj/bhkTransformShape.cpp
index 6496c6cb..d99747a7 100644
--- a/src/obj/bhkTransformShape.cpp
+++ b/src/obj/bhkTransformShape.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkTransformShape.h"
 #include "../../include/obj/bhkShape.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkTransformShape"] = bhkTransformShape::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkTransformShape", bhkTransformShape::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/bhkWorldObject.cpp b/src/obj/bhkWorldObject.cpp
index a003098c..13d6d56a 100644
--- a/src/obj/bhkWorldObject.cpp
+++ b/src/obj/bhkWorldObject.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/bhkWorldObject.h"
 #include "../../include/obj/bhkShape.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["bhkWorldObject"] = bhkWorldObject::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "bhkWorldObject", bhkWorldObject::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
diff --git a/src/obj/hkPackedNiTriStripsData.cpp b/src/obj/hkPackedNiTriStripsData.cpp
index 0f19ae62..0211194c 100644
--- a/src/obj/hkPackedNiTriStripsData.cpp
+++ b/src/obj/hkPackedNiTriStripsData.cpp
@@ -11,6 +11,7 @@ All rights reserved.  Please see niflib.h for license. */
 //--END CUSTOM CODE--//
 
 #include "../../include/FixLink.h"
+#include "../../include/ObjectRegistry.h"
 #include "../../include/NIF_IO.h"
 #include "../../include/obj/hkPackedNiTriStripsData.h"
 #include "../../include/gen/hkTriangle.h"
@@ -44,8 +45,8 @@ namespace Niflib {
 	static bool obj_initialized = Initialization();
 
 	static bool Initialization() {
-		//Add the function to the global object map
-		global_object_map["hkPackedNiTriStripsData"] = hkPackedNiTriStripsData::Create;
+		//Register this object type with Niflib
+		ObjectRegistry::RegisterObject( "hkPackedNiTriStripsData", hkPackedNiTriStripsData::Create );
 
 		//Do this stuff just to make sure the compiler doesn't optimize this function and the static bool away.
 		obj_initialized = true;
-- 
GitLab