mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-02-02 23:33:25 +00:00
GFBMDL : Add a quick fix for swapping json materials.
This commit is contained in:
parent
209653402a
commit
c134a24765
1 changed files with 11 additions and 3 deletions
|
@ -22,7 +22,7 @@ namespace FirstPlugin
|
|||
|
||||
public STSkeleton Skeleton = new STSkeleton();
|
||||
|
||||
public Model Model;
|
||||
public Model Model { get; set; }
|
||||
|
||||
public IList<string> Textures
|
||||
{
|
||||
|
@ -240,11 +240,15 @@ namespace FirstPlugin
|
|||
|
||||
public void ConvertFromJson(string text)
|
||||
{
|
||||
int index = ParentModel.Model.Materials.IndexOf(Material);
|
||||
Material = JsonConvert.DeserializeObject<Material>(text);
|
||||
ParentModel.Model.Materials[index] = Material;
|
||||
|
||||
ReloadMaterial();
|
||||
|
||||
var editor = ParentModel.LoadEditor<GFLXMaterialEditor>();
|
||||
editor.LoadMaterial(this);
|
||||
var editor = ParentModel.LoadEditor<GFLXMaterialEditor>();
|
||||
editor.LoadMaterial(this);
|
||||
|
||||
}
|
||||
|
||||
public ToolStripItem[] GetContextMenuItems()
|
||||
|
@ -273,9 +277,13 @@ namespace FirstPlugin
|
|||
ofd.Filter = "Supported Formats|*.json;";
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
int index = ParentModel.Model.Materials.IndexOf(Material);
|
||||
|
||||
Material = JsonConvert.DeserializeObject<Material>(
|
||||
System.IO.File.ReadAllText(ofd.FileName));
|
||||
|
||||
ParentModel.Model.Materials[index] = Material;
|
||||
|
||||
ReloadMaterial();
|
||||
|
||||
var editor = ParentModel.LoadEditor<GFLXMaterialEditor>();
|
||||
|
|
Loading…
Reference in a new issue