mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Add getters/setters for bmd materials
This commit is contained in:
parent
134eff9401
commit
3c3ab5fc32
9 changed files with 23 additions and 1 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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);
|
||||
|
|
|
@ -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.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue