/[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/15 01:12:18	89
+++ trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/19 11:15:19	93
@@ -110,7 +110,7 @@
 
 		this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
 		ConvertToManaged();
-		propgrid->SelectedObject = this->GR2LibPropertyWrapper->GetPropertiesValidForThisInstance();
+		propgrid->SelectedObject = this->GR2LibPropertyWrapper;
 	}
 
 protected:
@@ -330,6 +330,8 @@
 		Materials_ToManaged(_grn_file->GrannyFileInfo->Materials,_grn_file->GrannyFileInfo->MaterialCount);
 		// Skeleton List
 		Skeletons_ToManaged(_grn_file->GrannyFileInfo->Skeletons, _grn_file->GrannyFileInfo->SkeletonCount);
+		// Model List
+		Models_ToManaged(_grn_file->GrannyFileInfo->Models,_grn_file->GrannyFileInfo->ModelCount);
 	}
 	void ConvertToNative()
 	{
@@ -343,6 +345,8 @@
 		Materials_ToNative();
 		// Skeleton List
 		Skeletons_ToNative();
+		// Model List
+		Models_ToNative();
 	}
 #pragma endregion
 #pragma region MarshalToMananaged
@@ -588,6 +592,53 @@
 		}
 	}
 #pragma endregion
+#pragma region  Models_ToManaged
+	void Models_ToManaged(granny_model** toolinfo, granny_int32 ModelCount)
+	{
+		if (toolinfo != NULL)
+		{
+			GR2LibPropertyWrapper->Models = gcnew List<Model^>();
+			for(int i=0;i<ModelCount;i++)
+			{
+				Model^ m = gcnew Model();
+				m->Name = gcnew String(reinterpret_cast<const char*>(toolinfo[i]->Name));
+
+				Transform^ _transform = gcnew Transform();		
+				_transform->Dimensions = toolinfo[i]->InitialPlacement.Flags;
+				_transform->Origin = *gcnew Vector3(
+					toolinfo[i]->InitialPlacement.Position[0],
+					toolinfo[i]->InitialPlacement.Position[1],
+					toolinfo[i]->InitialPlacement.Position[2]
+				);
+
+				_transform->Rotation = *gcnew Quaternion(
+					toolinfo[i]->InitialPlacement.Orientation[0],
+					toolinfo[i]->InitialPlacement.Orientation[1],
+					toolinfo[i]->InitialPlacement.Orientation[2],
+					toolinfo[i]->InitialPlacement.Orientation[3]
+				);
+				_transform->Scale = *gcnew Matrix33
+					(
+					*gcnew Vector3(
+					toolinfo[i]->InitialPlacement.ScaleShear[0][0],
+					toolinfo[i]->InitialPlacement.ScaleShear[0][1],
+					toolinfo[i]->InitialPlacement.ScaleShear[0][2]),
+					*gcnew Vector3(
+					toolinfo[i]->InitialPlacement.ScaleShear[1][0],
+					toolinfo[i]->InitialPlacement.ScaleShear[1][1],
+					toolinfo[i]->InitialPlacement.ScaleShear[1][2]),
+					*gcnew Vector3(
+					toolinfo[i]->InitialPlacement.ScaleShear[2][0],
+					toolinfo[i]->InitialPlacement.ScaleShear[2][1],
+					toolinfo[i]->InitialPlacement.ScaleShear[2][2])
+					);		
+				m->InitialPlacement = _transform;
+				//m->ExtendedData = ExtendedData_ToManaged(toolinfo[i]->ExtendedData);
+				GR2LibPropertyWrapper->Models->Add(m);
+			}
+		}
+	}
+#pragma endregion
 #pragma endregion
 #pragma region MarshalToNative
 #pragma region ArtToolInfo_ToNative
@@ -765,6 +816,13 @@
 		}
 	}
 #pragma endregion
+#pragma region Models_ToNative
+	void Models_ToNative()
+	{
+		if (GR2LibPropertyWrapper->Models != nullptr)
+		{
+		}
+	}
 #pragma endregion
 #pragma region ExtendedDataToManagedNative
 #pragma region ExtendedData_ToManaged
@@ -883,7 +941,7 @@
 
 			 this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
 			 ConvertToManaged();
-			 propgrid->SelectedObject = this->GR2LibPropertyWrapper->GetPropertiesValidForThisInstance();
+			 propgrid->SelectedObject = this->GR2LibPropertyWrapper;
 			 this->IsRigLoaded = true;
 			  this->RigContainsUnsavedChanges = false;
 		 }

 

  ViewVC Help
Powered by ViewVC 1.1.22