1
0
mirror of synced 2024-09-24 03:28:21 +02:00

Add getters/setters for bmd materials

This commit is contained in:
KillzXGaming 2019-07-11 20:46:45 -04:00
parent 134eff9401
commit 3c3ab5fc32
9 changed files with 23 additions and 1 deletions

Binary file not shown.

View File

@ -123,7 +123,6 @@ namespace FirstPlugin
for (int i = 0; i < BMDFile.Shapes.Shapes.Count; i++)
{
var mat = new BMDMaterialWrapper(BMDFile.Materials.m_Materials[i], BMDFile);
mat.Text = $"Material {i}";
MaterialFolder.Nodes.Add(mat);
var shpWrapper = new BMDShapeWrapper(BMDFile.Shapes.Shapes[i], BMDFile, mat);

View File

@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library;
using Switch_Toolbox.Library.Forms;
using SuperBMDLib.Materials;
namespace FirstPlugin
@ -18,6 +20,8 @@ namespace FirstPlugin
Material = mat;
ParentModel = model;
Text = mat.Name;
int textureUnit = 1;
if (mat.TextureIndices[0] != -1)
{
@ -31,6 +35,12 @@ namespace FirstPlugin
matTexture.wrapModeT = ConvertWrapMode(ParentModel.Textures[texIndex].WrapT);
TextureMaps.Add(matTexture);
foreach (var textureIndex in mat.TextureIndices)
{
if (textureIndex != -1)
Nodes.Add(ParentModel.Textures[textureIndex].Name);
}
}
}
@ -48,5 +58,18 @@ namespace FirstPlugin
throw new Exception($"Unknown WrapMode {WrapMode}");
}
}
public override void OnClick(TreeView treeView)
{
STPropertyGrid editor = (STPropertyGrid)LibraryGUI.GetActiveContent(typeof(STPropertyGrid));
if (editor == null)
{
editor = new STPropertyGrid();
LibraryGUI.LoadEditor(editor);
}
editor.Text = Text;
editor.Dock = DockStyle.Fill;
editor.LoadProperty(Material, null);
}
}
}

Binary file not shown.

Binary file not shown.