/[Sims3RigEditor]/trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h
ViewVC logotype

Diff of /trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/14 12:49:25	81
+++ trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/14 20:21:40	84
@@ -108,7 +108,7 @@
 		this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
 		ConvertToManaged();
 		propgrid->SelectedObject = this->GR2LibPropertyWrapper;
-
+		this->GR2LibPropertyWrapper->HideNonSelectableObjects(this->propgrid);
 	}
 
 protected:
@@ -349,6 +349,7 @@
 		//GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();
 		if (toolinfo != NULL)
 		{
+			GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();
 			GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));
 
 			// Tool Vector
@@ -385,14 +386,16 @@
 		//GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();
 		if (toolinfo != NULL)
 		{
+			GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();
 			GR2LibPropertyWrapper->ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));
 			GR2LibPropertyWrapper->ExporterInfo->Version = gcnew versiontype(
 				toolinfo->ExporterMajorRevision,
 				toolinfo->ExporterMinorRevision,
 				toolinfo->ExporterCustomization,
 				toolinfo->ExporterBuildNumber);
+			GR2LibPropertyWrapper->ExporterInfo->ExtendedData = ExtendedData_ToManaged(toolinfo->ExtendedData);
 		}
-		GR2LibPropertyWrapper->ExporterInfo->ExtendedData = ExtendedData_ToManaged(toolinfo->ExtendedData);
+
 	}
 #pragma endregion
 #pragma region Textures_ToManaged
@@ -584,95 +587,100 @@
 #pragma region ArtToolInfo_ToNative
 	void ArtToolInfo_ToNative()
 	{
-		if (_grn_file->GrannyFileInfo->ArtToolInfo == NULL)
+		if (GR2LibPropertyWrapper->ArtToolInfo != nullptr)
 		{
-			_grn_file->GrannyFileInfo->ArtToolInfo = new granny_art_tool_info();
-		}
-
-		_grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName).ToPointer();
-		_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Major;
-		_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Minor;
-		_grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter;
+			if (_grn_file->GrannyFileInfo->ArtToolInfo == NULL)
+			{
+				_grn_file->GrannyFileInfo->ArtToolInfo = new granny_art_tool_info();
+			}
 
+			_grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName).ToPointer();
+			_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Major;
+			_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Minor;
+			_grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter;
 
-		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.z;
 
-		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.z;
+			_grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.x;
+			_grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.y;
+			_grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.z;
 
-		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.z;
+			_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.x;
+			_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.y;
+			_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.z;
 
-		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.z;
+			_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.x;
+			_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.y;
+			_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.z;
 
-		_grn_file->GrannyFileInfo->ArtToolInfo->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->ArtToolInfo->ExtendedData,_grn_file->GrannyFileInfo->ArtToolInfo->ExtendedData);
+			_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.x;
+			_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.y;
+			_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.z;
 
+			_grn_file->GrannyFileInfo->ArtToolInfo->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->ArtToolInfo->ExtendedData,_grn_file->GrannyFileInfo->ArtToolInfo->ExtendedData);
+		}
 	}
 #pragma endregion
 #pragma region ExporterInfo_ToNative
 	void ExporterInfo_ToNative()
 	{
-		if (_grn_file->GrannyFileInfo->ExporterInfo == NULL)
+		if (GR2LibPropertyWrapper->ExporterInfo != nullptr)
 		{
-			_grn_file->GrannyFileInfo->ExporterInfo = new granny_exporter_info();
+			if (_grn_file->GrannyFileInfo->ExporterInfo == NULL)
+			{
+				_grn_file->GrannyFileInfo->ExporterInfo = new granny_exporter_info();
+			}
+			_grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ExporterInfo->ExporterName).ToPointer();
+			_grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->major;
+			_grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->minor;
+			_grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = GR2LibPropertyWrapper->ExporterInfo->Version->customization;
+			_grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = GR2LibPropertyWrapper->ExporterInfo->Version->build;
+			_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->ExporterInfo->ExtendedData,_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData);
 		}
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ExporterInfo->ExporterName).ToPointer();
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->major;
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->minor;
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = GR2LibPropertyWrapper->ExporterInfo->Version->customization;
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = GR2LibPropertyWrapper->ExporterInfo->Version->build;
-		_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->ExporterInfo->ExtendedData,_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData);
 	}
 #pragma endregion
 #pragma region Textures_ToNative
 	void Textures_ToNative()
 	{
-		//_grn_file->GrannyFileInfo->Textures = (granny_texture**)malloc(GR2LibPropertyWrapper->Textures->Count);
-		//for(int i=0;i<GR2LibPropertyWrapper->Textures->Count;i++) { _grn_file->GrannyFileInfo->Textures[i] = new granny_texture(); }
-
-		_grn_file->GrannyFileInfo->TextureCount = GR2LibPropertyWrapper->Textures->Count;
-		for(int i=0;i<_grn_file->GrannyFileInfo->TextureCount;i++)
+		if (GR2LibPropertyWrapper->Textures != nullptr)
 		{
-			_grn_file->GrannyFileInfo->Textures[i]->FromFileName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Textures[i]->FromFileName->FullPath).ToPointer();
-			_grn_file->GrannyFileInfo->Textures[i]->TextureType = (granny_int32)GR2LibPropertyWrapper->Textures[i]->TextureType->Value;
-			_grn_file->GrannyFileInfo->Textures[i]->Width = GR2LibPropertyWrapper->Textures[i]->Width;
-			_grn_file->GrannyFileInfo->Textures[i]->Height = GR2LibPropertyWrapper->Textures[i]->Height;
-			_grn_file->GrannyFileInfo->Textures[i]->Encoding = (granny_int32)GR2LibPropertyWrapper->Textures[i]->Encoding->Value;
-			_grn_file->GrannyFileInfo->Textures[i]->SubFormat = (granny_int32)GR2LibPropertyWrapper->Textures[i]->SubFormat->Value;
-
-			_grn_file->GrannyFileInfo->Textures[i]->Layout.BytesPerPixel =  (granny_int32)GR2LibPropertyWrapper->Textures[i]->Layout->BytesPerPixel;
-			for(int j=0;j<granny_pixel_layout_bitshift_size;j++)
+			_grn_file->GrannyFileInfo->TextureCount = GR2LibPropertyWrapper->Textures->Count;
+			for(int i=0;i<_grn_file->GrannyFileInfo->TextureCount;i++)
 			{
-				_grn_file->GrannyFileInfo->Textures[i]->Layout.ShiftForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->ShiftForComponent[j];
-				_grn_file->GrannyFileInfo->Textures[i]->Layout.BitsForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->BitsForComponent[j];
-			}
+				_grn_file->GrannyFileInfo->Textures[i]->FromFileName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Textures[i]->FromFileName->FullPath).ToPointer();
+				_grn_file->GrannyFileInfo->Textures[i]->TextureType = (granny_int32)GR2LibPropertyWrapper->Textures[i]->TextureType->Value;
+				_grn_file->GrannyFileInfo->Textures[i]->Width = GR2LibPropertyWrapper->Textures[i]->Width;
+				_grn_file->GrannyFileInfo->Textures[i]->Height = GR2LibPropertyWrapper->Textures[i]->Height;
+				_grn_file->GrannyFileInfo->Textures[i]->Encoding = (granny_int32)GR2LibPropertyWrapper->Textures[i]->Encoding->Value;
+				_grn_file->GrannyFileInfo->Textures[i]->SubFormat = (granny_int32)GR2LibPropertyWrapper->Textures[i]->SubFormat->Value;
 
-			_grn_file->GrannyFileInfo->Textures[i]->ImageCount = GR2LibPropertyWrapper->Textures[i]->Images->Count;
-			_grn_file->GrannyFileInfo->Textures[i]->Images = (granny_texture_image*)malloc(_grn_file->GrannyFileInfo->Textures[i]->ImageCount);
-			for(int j=0;j<_grn_file->GrannyFileInfo->Textures[i]->ImageCount;j++)
-			{
-				_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels->Count;
-				_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels = (granny_texture_mip_level*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount);
-				for(int k=0;k<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount;k++) 
+				_grn_file->GrannyFileInfo->Textures[i]->Layout.BytesPerPixel =  (granny_int32)GR2LibPropertyWrapper->Textures[i]->Layout->BytesPerPixel;
+				for(int j=0;j<granny_pixel_layout_bitshift_size;j++)
 				{
-					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].Stride =  GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Stride;
-					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes->Count;
-					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes = (unsigned char*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount);
-
+					_grn_file->GrannyFileInfo->Textures[i]->Layout.ShiftForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->ShiftForComponent[j];
+					_grn_file->GrannyFileInfo->Textures[i]->Layout.BitsForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->BitsForComponent[j];
+				}
 
-					for (int l=0;l<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount;l++)
+				_grn_file->GrannyFileInfo->Textures[i]->ImageCount = GR2LibPropertyWrapper->Textures[i]->Images->Count;
+				_grn_file->GrannyFileInfo->Textures[i]->Images = (granny_texture_image*)malloc(_grn_file->GrannyFileInfo->Textures[i]->ImageCount);
+				for(int j=0;j<_grn_file->GrannyFileInfo->Textures[i]->ImageCount;j++)
+				{
+					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels->Count;
+					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels = (granny_texture_mip_level*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount);
+					for(int k=0;k<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount;k++) 
 					{
-						_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes[l] = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes[l];
+						_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].Stride =  GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Stride;
+						_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes->Count;
+						_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes = (unsigned char*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount);
+
+
+						for (int l=0;l<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount;l++)
+						{
+							_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes[l] = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes[l];
+						}
 					}
 				}
+				_grn_file->GrannyFileInfo->Textures[i]->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->Textures[i]->ExtendedData,_grn_file->GrannyFileInfo->Textures[i]->ExtendedData);
 			}
-			_grn_file->GrannyFileInfo->Textures[i]->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->Textures[i]->ExtendedData,_grn_file->GrannyFileInfo->Textures[i]->ExtendedData);
 		}
 
 	}
@@ -680,69 +688,74 @@
 #pragma region Materials_ToNative
 	void Materials_ToNative()
 	{
-		_grn_file->GrannyFileInfo->MaterialCount = GR2LibPropertyWrapper->Materials->Count;
-		for(int i=0;i<_grn_file->GrannyFileInfo->MaterialCount;i++)
+		if (GR2LibPropertyWrapper->Materials != nullptr)
 		{
-			_grn_file->GrannyFileInfo->Materials[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Materials[i]->Name).ToPointer();
-			// update extended data
-			_grn_file->GrannyFileInfo->Materials[i]->ExtendedData = ExtendedData_ToNative( GR2LibPropertyWrapper->Materials[i]->ExtendedData, _grn_file->GrannyFileInfo->Materials[i]->ExtendedData);
-
+			_grn_file->GrannyFileInfo->MaterialCount = GR2LibPropertyWrapper->Materials->Count;
+			for(int i=0;i<_grn_file->GrannyFileInfo->MaterialCount;i++)
+			{
+				_grn_file->GrannyFileInfo->Materials[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Materials[i]->Name).ToPointer();
+				// update extended data
+				_grn_file->GrannyFileInfo->Materials[i]->ExtendedData = ExtendedData_ToNative( GR2LibPropertyWrapper->Materials[i]->ExtendedData, _grn_file->GrannyFileInfo->Materials[i]->ExtendedData);
+			}
 		}
 	}
 #pragma endregion
 #pragma region Skeletons_ToNative
 	void Skeletons_ToNative()
 	{
-		_grn_file->GrannyFileInfo->SkeletonCount = GR2LibPropertyWrapper->Skeletons->Count;
-		for(int i=0;i<_grn_file->GrannyFileInfo->SkeletonCount;i++)
+		if (GR2LibPropertyWrapper->Skeletons != nullptr)
 		{
-			_grn_file->GrannyFileInfo->Skeletons[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Name).ToPointer();
-			_grn_file->GrannyFileInfo->Skeletons[i]->LODType = GR2LibPropertyWrapper->Skeletons[i]->LODType;
-			_grn_file->GrannyFileInfo->Skeletons[i]->BoneCount = GR2LibPropertyWrapper->Skeletons[i]->Bones->Count;
-			for(int j=0;j<_grn_file->GrannyFileInfo->Skeletons[i]->BoneCount;j++)
+			_grn_file->GrannyFileInfo->SkeletonCount = GR2LibPropertyWrapper->Skeletons->Count;
+			for(int i=0;i<_grn_file->GrannyFileInfo->SkeletonCount;i++)
 			{
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->Name).ToPointer();
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ParentIndex = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->ParentIndex;
-				
-				// Update LocalTransform
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Flags = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Dimensions;
+				_grn_file->GrannyFileInfo->Skeletons[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Name).ToPointer();
+				_grn_file->GrannyFileInfo->Skeletons[i]->LODType = GR2LibPropertyWrapper->Skeletons[i]->LODType;
+				_grn_file->GrannyFileInfo->Skeletons[i]->BoneCount = GR2LibPropertyWrapper->Skeletons[i]->Bones->Count;
+				for(int j=0;j<_grn_file->GrannyFileInfo->Skeletons[i]->BoneCount;j++)
+				{
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->Name).ToPointer();
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ParentIndex = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->ParentIndex;
 
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.z;				
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.z;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.n;				
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.z;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.z;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.z;
-				// Update InverseWorld4x4
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.z;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.w;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.z;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.w;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.z;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.w;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.x;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.y;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.z;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.w;
+					// Update LocalTransform
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Flags = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Dimensions;
 
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LODError =  GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LODError;
-				_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ExtendedData = ExtendedData_ToNative( GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->ExtendedData,_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ExtendedData);
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.z;				
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.z;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.n;				
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.z;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.z;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.z;
+					// Update InverseWorld4x4
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.z;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.w;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.z;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.w;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.z;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.w;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.x;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.y;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.z;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.w;
+
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LODError =  GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LODError;
+					_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ExtendedData = ExtendedData_ToNative( GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->ExtendedData,_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ExtendedData);
+				}
 			}
 		}
 	}
@@ -832,7 +845,7 @@
 #pragma endregion
 
 private: System::Void mnuItemExit_Click(System::Object^  sender, System::EventArgs^  e) 
-		 {
+		 {			
 			 ConvertToNative();
 			 this->Close();
 		 }
@@ -857,6 +870,7 @@
 			 this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
 			 ConvertToManaged();
 			 propgrid->SelectedObject = this->GR2LibPropertyWrapper;
+			 this->GR2LibPropertyWrapper->HideNonSelectableObjects(this->propgrid);
 		 }
 private: System::Void gr2lib_rigeditor_frm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e) 
 		 {

 

  ViewVC Help
Powered by ViewVC 1.1.22