コード例 #1
0
        public MeshFlagEditor(GcmfMesh mesh)
        {
            InitializeComponent();
            this.mesh = mesh;

            this.renderFlagsTextBox.Text = string.Format("{0:X8}", (uint)mesh.RenderFlags);
            this.layerTextBox.Text       = "" + (int)mesh.Layer;
            this.unknown4TextBox.Text    = String.Format("{0:X8}", mesh.Unk4);
            this.unknown8TextBox.Text    = String.Format("{0:X8}", mesh.Unk8);
            this.unknownCTextBox.Text    = String.Format("{0:X8}", mesh.UnkC);
            this.unknown10TextBox.Text   = String.Format("{0:X4}", mesh.Unk10);
            //this.sectionFlagsTextBox.Text = String.Format("{0:X}", mesh.);
            this.unknown14TextBox.Text = String.Format("{0:X4}", mesh.Unk14);
            //this.vertexFlagsTextBox.Text = String.Format("{0:X}", mesh.);
            this.matrixId1TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[0];
            this.matrixId2TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[1];
            this.matrixId3TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[2];
            this.matrixId4TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[3];
            this.matrixId5TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[4];
            this.matrixId6TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[5];
            this.matrixId7TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[6];
            this.matrixId8TextBox.Text = "" + mesh.TransformMatrixSpecificIdxsObj1[7];
            // Second set of specific ids (To be implemented/normally don't exist)
            this.boundingSphereCenterXTextBox.Text = "" + mesh.BoundingSphereCenter.X;
            this.boundingSphereCenterYTextBox.Text = "" + mesh.BoundingSphereCenter.Y;
            this.boundingSphereCenterZTextBox.Text = "" + mesh.BoundingSphereCenter.Z;
            this.unknown3CTextBox.Text             = "" + mesh.Unk3C;
            this.unknown40TextBox.Text             = String.Format("{0:X8}", mesh.Unk40);
        }
コード例 #2
0
ファイル: OldWindow.cs プロジェクト: trashbyte/Potassium
        private void SetVisibleModelMeshes(bool showLayer1, bool showLayer2)
        {
            foreach (TreeNode modelItem in treeModel.Nodes)
            {
                if (modelItem.Nodes.Count > 0)
                {
                    // Set model meshes check state
                    foreach (TreeNode meshItem in modelItem.Nodes)
                    {
                        ModelMeshReference meshData = (ModelMeshReference)meshItem.Tag;
                        GcmfMesh           mesh     = gma[meshData.ModelIdx].ModelObject.Meshes[meshData.MeshIdx];
                        if (mesh.Layer == GcmfMesh.MeshLayer.Layer1)
                        {
                            treeModel.SetCheckState(meshItem, showLayer1 ? CheckState.Checked : CheckState.Unchecked);
                        }
                        else if (mesh.Layer == GcmfMesh.MeshLayer.Layer2)
                        {
                            treeModel.SetCheckState(meshItem, showLayer2 ? CheckState.Checked : CheckState.Unchecked);
                        }
                    }
                }
                else
                {
                    // For the orphan nodes (models with no meshes, mostly GMA null entries),
                    // unselect them unless we're choosing to show both types of layers
                    treeModel.SetCheckState(modelItem, (showLayer1 && showLayer2) ? CheckState.Checked : CheckState.Unchecked);
                }
            }

            // The model will be updated due to the AfterCheckState event on treeModel
        }
コード例 #3
0
        private void treeModel_AfterSelect(object sender, TreeViewEventArgs e)
        {
            mainWindow.paneMaterials.UpdateTrees();

            // If no item is selected in the list, hide the display completely
            if (mainWindow.paneModels.SelectedNode == null)
            {
                modelTable.Visible = false;
                meshTable.Visible  = false;
                return;
            }

            // Otherwise, extract the ModelTreeItem structure to get the selected model/mesh
            ModelMeshReference modelMeshReference = (ModelMeshReference)mainWindow.paneModels.SelectedNode.Tag;

            if (mainWindow.Gma[modelMeshReference.ModelIdx] == null)
            {
                modelTable.Visible = false;
                meshTable.Visible  = false;
                return;
            }

            Gcmf model = mainWindow.Gma[modelMeshReference.ModelIdx].ModelObject;

            // Show information about the selected model / mesh
            if (modelMeshReference.MeshIdx == -1)
            {
                modelTable.Visible = true;
                meshTable.Visible  = false;

                lblModelSectionFlags.Text = string.Format("0x{0:X8}", model.SectionFlags);
                lblModelCenter.Text       = model.BoundingSphereCenter.ToString();
                lblModelRadius.Text       = model.BoundingSphereRadius.ToString();
                lblModelTransformMatrixDefaultReferences.Text = string.Join(",",
                                                                            Array.ConvertAll(model.TransformMatrixDefaultIdxs, b => string.Format("0x{0:X2}", b)));
                lblModelNumTransformMatrices.Text = model.TransformMatrices.Count.ToString();
            }
            else
            {
                GcmfMesh mesh = model.Meshes[modelMeshReference.MeshIdx];

                modelTable.Visible = true;
                meshTable.Visible  = true;

                lblMeshRenderFlags.Text          = string.Format("0x{0:X8} ({1})", (uint)mesh.RenderFlags, EnumUtils.GetEnumFlagsString(mesh.RenderFlags));
                lblMeshUnk4.Text                 = string.Format("0x{0:X8}", mesh.Unk4);
                lblMeshUnk8.Text                 = string.Format("0x{0:X8}", mesh.Unk8);
                lblMeshUnkC.Text                 = string.Format("0x{0:X8}", mesh.UnkC);
                lblMeshUnk10.Text                = string.Format("0x{0:X4}", mesh.Unk10);
                lblMeshUnk14.Text                = string.Format("0x{0:X4}", mesh.Unk14);
                lblMeshPrimaryMaterialIdx.Text   = mesh.PrimaryMaterialIdx.ToString();
                lblMeshSecondaryMaterialIdx.Text = mesh.SecondaryMaterialIdx.ToString();
                lblMeshTertiaryMaterialIdx.Text  = mesh.TertiaryMaterialIdx.ToString();
                lblMeshTransformMatrixSpecificReferences.Text = string.Join(",",
                                                                            Array.ConvertAll(mesh.TransformMatrixSpecificIdxsObj1, b => string.Format("0x{0:X2}", b)));
                lblMeshCenter.Text = mesh.BoundingSphereCenter.ToString();
                lblMeshUnk3C.Text  = mesh.Unk3C.ToString();
                lblMeshUnk40.Text  = string.Format("0x{0:X8}", mesh.Unk40);
            }
        }