/[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

revision 81 by william, Sat Aug 14 12:49:25 2010 UTC revision 84 by william, Sat Aug 14 20:21:40 2010 UTC
# Line 108  public: Line 108  public:
108                  this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();                  this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
109                  ConvertToManaged();                  ConvertToManaged();
110                  propgrid->SelectedObject = this->GR2LibPropertyWrapper;                  propgrid->SelectedObject = this->GR2LibPropertyWrapper;
111                    this->GR2LibPropertyWrapper->HideNonSelectableObjects(this->propgrid);
112          }          }
113    
114  protected:  protected:
# Line 349  private: Line 349  private:
349                  //GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();                  //GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();
350                  if (toolinfo != NULL)                  if (toolinfo != NULL)
351                  {                  {
352                            GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();
353                          GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));                          GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));
354    
355                          // Tool Vector                          // Tool Vector
# Line 385  private: Line 386  private:
386                  //GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();                  //GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();
387                  if (toolinfo != NULL)                  if (toolinfo != NULL)
388                  {                  {
389                            GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();
390                          GR2LibPropertyWrapper->ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));                          GR2LibPropertyWrapper->ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));
391                          GR2LibPropertyWrapper->ExporterInfo->Version = gcnew versiontype(                          GR2LibPropertyWrapper->ExporterInfo->Version = gcnew versiontype(
392                                  toolinfo->ExporterMajorRevision,                                  toolinfo->ExporterMajorRevision,
393                                  toolinfo->ExporterMinorRevision,                                  toolinfo->ExporterMinorRevision,
394                                  toolinfo->ExporterCustomization,                                  toolinfo->ExporterCustomization,
395                                  toolinfo->ExporterBuildNumber);                                  toolinfo->ExporterBuildNumber);
396                            GR2LibPropertyWrapper->ExporterInfo->ExtendedData = ExtendedData_ToManaged(toolinfo->ExtendedData);
397                  }                  }
398                  GR2LibPropertyWrapper->ExporterInfo->ExtendedData = ExtendedData_ToManaged(toolinfo->ExtendedData);  
399          }          }
400  #pragma endregion  #pragma endregion
401  #pragma region Textures_ToManaged  #pragma region Textures_ToManaged
# Line 584  private: Line 587  private:
587  #pragma region ArtToolInfo_ToNative  #pragma region ArtToolInfo_ToNative
588          void ArtToolInfo_ToNative()          void ArtToolInfo_ToNative()
589          {          {
590                  if (_grn_file->GrannyFileInfo->ArtToolInfo == NULL)                  if (GR2LibPropertyWrapper->ArtToolInfo != nullptr)
591                  {                  {
592                          _grn_file->GrannyFileInfo->ArtToolInfo = new granny_art_tool_info();                          if (_grn_file->GrannyFileInfo->ArtToolInfo == NULL)
593                  }                          {
594                                    _grn_file->GrannyFileInfo->ArtToolInfo = new granny_art_tool_info();
595                  _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;  
596    
597                            _grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName).ToPointer();
598                            _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Major;
599                            _grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Minor;
600                            _grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter;
601    
                 _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;  
602    
603                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.x;                          _grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.x;
604                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.y;                          _grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.y;
605                  _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.z;                          _grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.z;
606    
607                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.x;                          _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.x;
608                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.y;                          _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.y;
609                  _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.z;                          _grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.z;
610    
611                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.x;                          _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.x;
612                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.y;                          _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.y;
613                  _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.z;                          _grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.z;
614    
615                  _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;
616                            _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.y;
617                            _grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.z;
618    
619                            _grn_file->GrannyFileInfo->ArtToolInfo->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->ArtToolInfo->ExtendedData,_grn_file->GrannyFileInfo->ArtToolInfo->ExtendedData);
620                    }
621          }          }
622  #pragma endregion  #pragma endregion
623  #pragma region ExporterInfo_ToNative  #pragma region ExporterInfo_ToNative
624          void ExporterInfo_ToNative()          void ExporterInfo_ToNative()
625          {          {
626                  if (_grn_file->GrannyFileInfo->ExporterInfo == NULL)                  if (GR2LibPropertyWrapper->ExporterInfo != nullptr)
627                  {                  {
628                          _grn_file->GrannyFileInfo->ExporterInfo = new granny_exporter_info();                          if (_grn_file->GrannyFileInfo->ExporterInfo == NULL)
629                            {
630                                    _grn_file->GrannyFileInfo->ExporterInfo = new granny_exporter_info();
631                            }
632                            _grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ExporterInfo->ExporterName).ToPointer();
633                            _grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->major;
634                            _grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->minor;
635                            _grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = GR2LibPropertyWrapper->ExporterInfo->Version->customization;
636                            _grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = GR2LibPropertyWrapper->ExporterInfo->Version->build;
637                            _grn_file->GrannyFileInfo->ExporterInfo->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->ExporterInfo->ExtendedData,_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData);
638                  }                  }
                 _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);  
639          }          }
640  #pragma endregion  #pragma endregion
641  #pragma region Textures_ToNative  #pragma region Textures_ToNative
642          void Textures_ToNative()          void Textures_ToNative()
643          {          {
644                  //_grn_file->GrannyFileInfo->Textures = (granny_texture**)malloc(GR2LibPropertyWrapper->Textures->Count);                  if (GR2LibPropertyWrapper->Textures != nullptr)
                 //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++)  
645                  {                  {
646                          _grn_file->GrannyFileInfo->Textures[i]->FromFileName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Textures[i]->FromFileName->FullPath).ToPointer();                          _grn_file->GrannyFileInfo->TextureCount = GR2LibPropertyWrapper->Textures->Count;
647                          _grn_file->GrannyFileInfo->Textures[i]->TextureType = (granny_int32)GR2LibPropertyWrapper->Textures[i]->TextureType->Value;                          for(int i=0;i<_grn_file->GrannyFileInfo->TextureCount;i++)
                         _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++)  
648                          {                          {
649                                  _grn_file->GrannyFileInfo->Textures[i]->Layout.ShiftForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->ShiftForComponent[j];                                  _grn_file->GrannyFileInfo->Textures[i]->FromFileName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Textures[i]->FromFileName->FullPath).ToPointer();
650                                  _grn_file->GrannyFileInfo->Textures[i]->Layout.BitsForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->BitsForComponent[j];                                  _grn_file->GrannyFileInfo->Textures[i]->TextureType = (granny_int32)GR2LibPropertyWrapper->Textures[i]->TextureType->Value;
651                          }                                  _grn_file->GrannyFileInfo->Textures[i]->Width = GR2LibPropertyWrapper->Textures[i]->Width;
652                                    _grn_file->GrannyFileInfo->Textures[i]->Height = GR2LibPropertyWrapper->Textures[i]->Height;
653                                    _grn_file->GrannyFileInfo->Textures[i]->Encoding = (granny_int32)GR2LibPropertyWrapper->Textures[i]->Encoding->Value;
654                                    _grn_file->GrannyFileInfo->Textures[i]->SubFormat = (granny_int32)GR2LibPropertyWrapper->Textures[i]->SubFormat->Value;
655    
656                          _grn_file->GrannyFileInfo->Textures[i]->ImageCount = GR2LibPropertyWrapper->Textures[i]->Images->Count;                                  _grn_file->GrannyFileInfo->Textures[i]->Layout.BytesPerPixel =  (granny_int32)GR2LibPropertyWrapper->Textures[i]->Layout->BytesPerPixel;
657                          _grn_file->GrannyFileInfo->Textures[i]->Images = (granny_texture_image*)malloc(_grn_file->GrannyFileInfo->Textures[i]->ImageCount);                                  for(int j=0;j<granny_pixel_layout_bitshift_size;j++)
                         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++)  
658                                  {                                  {
659                                          _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].Stride =  GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Stride;                                          _grn_file->GrannyFileInfo->Textures[i]->Layout.ShiftForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->ShiftForComponent[j];
660                                          _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]->Layout.BitsForComponent[j] = GR2LibPropertyWrapper->Textures[i]->Layout->BitsForComponent[j];
661                                          _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes = (unsigned char*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount);                                  }
   
662    
663                                          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;
664                                    _grn_file->GrannyFileInfo->Textures[i]->Images = (granny_texture_image*)malloc(_grn_file->GrannyFileInfo->Textures[i]->ImageCount);
665                                    for(int j=0;j<_grn_file->GrannyFileInfo->Textures[i]->ImageCount;j++)
666                                    {
667                                            _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels->Count;
668                                            _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels = (granny_texture_mip_level*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount);
669                                            for(int k=0;k<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount;k++)
670                                          {                                          {
671                                                  _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;
672                                                    _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes->Count;
673                                                    _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes = (unsigned char*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount);
674    
675    
676                                                    for (int l=0;l<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount;l++)
677                                                    {
678                                                            _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes[l] = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes[l];
679                                                    }
680                                          }                                          }
681                                  }                                  }
682                                    _grn_file->GrannyFileInfo->Textures[i]->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->Textures[i]->ExtendedData,_grn_file->GrannyFileInfo->Textures[i]->ExtendedData);
683                          }                          }
                         _grn_file->GrannyFileInfo->Textures[i]->ExtendedData = ExtendedData_ToNative(GR2LibPropertyWrapper->Textures[i]->ExtendedData,_grn_file->GrannyFileInfo->Textures[i]->ExtendedData);  
684                  }                  }
685    
686          }          }
# Line 680  private: Line 688  private:
688  #pragma region Materials_ToNative  #pragma region Materials_ToNative
689          void Materials_ToNative()          void Materials_ToNative()
690          {          {
691                  _grn_file->GrannyFileInfo->MaterialCount = GR2LibPropertyWrapper->Materials->Count;                  if (GR2LibPropertyWrapper->Materials != nullptr)
                 for(int i=0;i<_grn_file->GrannyFileInfo->MaterialCount;i++)  
692                  {                  {
693                          _grn_file->GrannyFileInfo->Materials[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Materials[i]->Name).ToPointer();                          _grn_file->GrannyFileInfo->MaterialCount = GR2LibPropertyWrapper->Materials->Count;
694                          // update extended data                          for(int i=0;i<_grn_file->GrannyFileInfo->MaterialCount;i++)
695                          _grn_file->GrannyFileInfo->Materials[i]->ExtendedData = ExtendedData_ToNative( GR2LibPropertyWrapper->Materials[i]->ExtendedData, _grn_file->GrannyFileInfo->Materials[i]->ExtendedData);                          {
696                                    _grn_file->GrannyFileInfo->Materials[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Materials[i]->Name).ToPointer();
697                                    // update extended data
698                                    _grn_file->GrannyFileInfo->Materials[i]->ExtendedData = ExtendedData_ToNative( GR2LibPropertyWrapper->Materials[i]->ExtendedData, _grn_file->GrannyFileInfo->Materials[i]->ExtendedData);
699                            }
700                  }                  }
701          }          }
702  #pragma endregion  #pragma endregion
703  #pragma region Skeletons_ToNative  #pragma region Skeletons_ToNative
704          void Skeletons_ToNative()          void Skeletons_ToNative()
705          {          {
706                  _grn_file->GrannyFileInfo->SkeletonCount = GR2LibPropertyWrapper->Skeletons->Count;                  if (GR2LibPropertyWrapper->Skeletons != nullptr)
                 for(int i=0;i<_grn_file->GrannyFileInfo->SkeletonCount;i++)  
707                  {                  {
708                          _grn_file->GrannyFileInfo->Skeletons[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Name).ToPointer();                          _grn_file->GrannyFileInfo->SkeletonCount = GR2LibPropertyWrapper->Skeletons->Count;
709                          _grn_file->GrannyFileInfo->Skeletons[i]->LODType = GR2LibPropertyWrapper->Skeletons[i]->LODType;                          for(int i=0;i<_grn_file->GrannyFileInfo->SkeletonCount;i++)
                         _grn_file->GrannyFileInfo->Skeletons[i]->BoneCount = GR2LibPropertyWrapper->Skeletons[i]->Bones->Count;  
                         for(int j=0;j<_grn_file->GrannyFileInfo->Skeletons[i]->BoneCount;j++)  
710                          {                          {
711                                  _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->Name).ToPointer();                                  _grn_file->GrannyFileInfo->Skeletons[i]->Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Name).ToPointer();
712                                  _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ParentIndex = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->ParentIndex;                                  _grn_file->GrannyFileInfo->Skeletons[i]->LODType = GR2LibPropertyWrapper->Skeletons[i]->LODType;
713                                                                    _grn_file->GrannyFileInfo->Skeletons[i]->BoneCount = GR2LibPropertyWrapper->Skeletons[i]->Bones->Count;
714                                  // Update LocalTransform                                  for(int j=0;j<_grn_file->GrannyFileInfo->Skeletons[i]->BoneCount;j++)
715                                  _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Flags = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Dimensions;                                  {
716                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].Name = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->Name).ToPointer();
717                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ParentIndex = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->ParentIndex;
718    
719                                  _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.x;                                          // Update LocalTransform
720                                  _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.Flags = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Dimensions;
                                 _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;  
721    
722                                  _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LODError =  GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LODError;                                          _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.x;
723                                  _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[1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.y;
724                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Position[2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Origin.z;                        
725                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.x;
726                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.y;
727                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.v.z;
728                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.Orientation[3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Rotation.n;                            
729                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.x;
730                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.y;
731                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[0][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.right.z;
732                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.x;
733                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.y;
734                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[1][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.up.z;
735                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.x;
736                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.y;
737                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LocalTransform.ScaleShear[2][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LocalTransform->Scale.at.z;
738                                            // Update InverseWorld4x4
739                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.x;
740                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.y;
741                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.z;
742                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[0][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.right.w;
743                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.x;
744                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.y;
745                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.z;
746                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[1][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.up.w;
747                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.x;
748                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.y;
749                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.z;
750                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[2][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.at.w;
751                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][0] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.x;
752                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][1] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.y;
753                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][2] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.z;
754                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].InverseWorld4x4[3][3] = GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->InverseWorld4x4.pos.w;
755    
756                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].LODError =  GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->LODError;
757                                            _grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ExtendedData = ExtendedData_ToNative( GR2LibPropertyWrapper->Skeletons[i]->Bones[j]->ExtendedData,_grn_file->GrannyFileInfo->Skeletons[i]->Bones[j].ExtendedData);
758                                    }
759                          }                          }
760                  }                  }
761          }          }
# Line 832  private: Line 845  private:
845  #pragma endregion  #pragma endregion
846    
847  private: System::Void mnuItemExit_Click(System::Object^  sender, System::EventArgs^  e)  private: System::Void mnuItemExit_Click(System::Object^  sender, System::EventArgs^  e)
848                   {                   {                      
849                           ConvertToNative();                           ConvertToNative();
850                           this->Close();                           this->Close();
851                   }                   }
# Line 857  private: System::Void mnuItemOpen_Click( Line 870  private: System::Void mnuItemOpen_Click(
870                           this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();                           this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
871                           ConvertToManaged();                           ConvertToManaged();
872                           propgrid->SelectedObject = this->GR2LibPropertyWrapper;                           propgrid->SelectedObject = this->GR2LibPropertyWrapper;
873                             this->GR2LibPropertyWrapper->HideNonSelectableObjects(this->propgrid);
874                   }                   }
875  private: System::Void gr2lib_rigeditor_frm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e)  private: System::Void gr2lib_rigeditor_frm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e)
876                   {                   {

Legend:
Removed from v.81  
changed lines
  Added in v.84

  ViewVC Help
Powered by ViewVC 1.1.22