From 293d4d21006d594c9a5b4c22bbd38efa3593b79c Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 30 Jul 2024 22:06:42 +0200 Subject: [PATCH] ModelImporter - Add block bench export for models inside models.bin --- PCK-Studio/External/Format/BlockBenchModel.cs | 100 ++++- PCK-Studio/Internal/Json/JsonModelMetaData.cs | 19 + PCK-Studio/Internal/ModelImporter.cs | 121 ++++-- PCK-Studio/Internal/NamedTexture.cs | 17 + PCK-Studio/MainForm.cs | 56 ++- PCK-Studio/PckStudio.csproj | 3 + PCK-Studio/Properties/Resources.Designer.cs | 30 +- PCK-Studio/Properties/Resources.resx | 72 +--- .../model/modelTextureLocations.json | 404 ++++++++++++++++++ 9 files changed, 705 insertions(+), 117 deletions(-) create mode 100644 PCK-Studio/Internal/Json/JsonModelMetaData.cs create mode 100644 PCK-Studio/Internal/NamedTexture.cs create mode 100644 PCK-Studio/Resources/model/modelTextureLocations.json diff --git a/PCK-Studio/External/Format/BlockBenchModel.cs b/PCK-Studio/External/Format/BlockBenchModel.cs index 5b49b8da..b1a86096 100644 --- a/PCK-Studio/External/Format/BlockBenchModel.cs +++ b/PCK-Studio/External/Format/BlockBenchModel.cs @@ -2,6 +2,7 @@ using System.Buffers.Text; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; using System.IO; @@ -11,6 +12,7 @@ using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using PckStudio.Internal; namespace PckStudio.External.Format { @@ -49,7 +51,7 @@ namespace PckStudio.External.Format [JsonProperty("inflate")] internal float Inflate; - [JsonProperty("origin")] + [JsonProperty("origin", NullValueHandling = NullValueHandling.Ignore)] private float[] origin; [JsonProperty("from")] @@ -61,6 +63,9 @@ namespace PckStudio.External.Format [JsonProperty("uv_offset")] private int[] uv_offset; + [JsonProperty("rotation", NullValueHandling = NullValueHandling.Ignore)] + private float[] rotation; + [JsonIgnore()] internal Vector3 Origin { @@ -128,6 +133,23 @@ namespace PckStudio.External.Format } } + [JsonIgnore()] + internal Vector3 Rotation + { + get + { + return new Vector3(rotation?[0] ?? 0, rotation?[1] ?? 0, rotation?[2] ?? 0); + } + set + { + if (rotation is null || rotation.Length < 3) + rotation = new float[3]; + rotation[0] = value.X; + rotation[1] = value.Y; + rotation[2] = value.Z; + } + } + [JsonProperty("type")] internal string Type; @@ -137,38 +159,52 @@ namespace PckStudio.External.Format internal class Texture { - public static implicit operator Texture(Image image) => new Texture(image); public static implicit operator Image(Texture texture) => texture.GetImage(); + public static implicit operator Texture(Image image) => new Texture(image); + public static implicit operator Texture(NamedTexture namedTexture) => new Texture(namedTexture.Name, namedTexture.Texture); - private Texture() { } + private const string _TEXTUREDATAHEAD = "data:image/png;base64,"; + + internal Texture(string name, Image image) + : this(image) + { + Name = name; + } internal Texture(Image image) { - var ms = new MemoryStream(); - image.Save(ms, ImageFormat.Png); - TextureSource = "data:image/png;base64," + Convert.ToBase64String(ms.ToArray()); + if (image is not null) + { + SetImage(image); + return; + } + Debug.WriteLine($"param: {nameof(image)} is null"); } [JsonProperty("name")] - internal string Name; + internal string Name { get; } [JsonProperty("source")] - internal string TextureSource; + internal string TextureSource { get; private set; } private Image GetImage() { string data = TextureSource; - const string dataHead = "data:image/png;base64,"; - if (data.StartsWith(dataHead)) + if (data.StartsWith(_TEXTUREDATAHEAD)) { - byte[] encodedData = Convert.FromBase64String(data.Substring(dataHead.Length)); - using (var ms = new MemoryStream(encodedData)) - { - return Image.FromStream(ms); - } + byte[] encodedData = Convert.FromBase64String(data.Substring(_TEXTUREDATAHEAD.Length)); + using var ms = new MemoryStream(encodedData); + return Image.FromStream(ms); } return null; } + + private void SetImage(Image image) + { + var ms = new MemoryStream(); + image.Save(ms, ImageFormat.Png); + TextureSource = _TEXTUREDATAHEAD + Convert.ToBase64String(ms.ToArray()); + } } internal class Outline @@ -193,6 +229,40 @@ namespace PckStudio.External.Format } } + [JsonProperty("rotation")] + private float[] rotation; + + [JsonIgnore] + public Vector3 Rotation + { + get => new Vector3(rotation?[0] ?? 0, rotation?[1] ?? 0, rotation?[2] ?? 0); + set + { + if (rotation is null || rotation.Length < 3) + rotation = new float[3]; + rotation[0] = value.X; + rotation[1] = value.Y; + rotation[2] = value.Z; + } + } + + [JsonProperty("pivot")] + private float[] pivot; + + [JsonIgnore] + public Vector3 Pivot + { + get => new Vector3(pivot?[0] ?? 0, pivot?[1] ?? 0, pivot?[2] ?? 0); + set + { + if (pivot is null || pivot.Length < 3) + pivot = new float[3]; + pivot[0] = value.X; + pivot[1] = value.Y; + pivot[2] = value.Z; + } + } + [JsonProperty("uuid")] internal Guid Uuid; diff --git a/PCK-Studio/Internal/Json/JsonModelMetaData.cs b/PCK-Studio/Internal/Json/JsonModelMetaData.cs new file mode 100644 index 00000000..e6b60d2c --- /dev/null +++ b/PCK-Studio/Internal/Json/JsonModelMetaData.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace PckStudio.Internal.Json +{ + internal class JsonModelMetaData + { + [JsonProperty("textureLocations", Required = Required.Always)] + public string[] TextureLocations { get; set; } + + //[JsonProperty("parents", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Populate)] + //public Dictionary ParentBones { get; set; } + } +} diff --git a/PCK-Studio/Internal/ModelImporter.cs b/PCK-Studio/Internal/ModelImporter.cs index bdc4ccfe..301bd338 100644 --- a/PCK-Studio/Internal/ModelImporter.cs +++ b/PCK-Studio/Internal/ModelImporter.cs @@ -26,7 +26,6 @@ using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using PckStudio.Rendering; using PckStudio.Extensions; using PckStudio.External.Format; using PckStudio.Internal.IO.PSM; @@ -34,6 +33,10 @@ using PckStudio.Internal.FileFormats; using PckStudio.Forms.Additional_Popups; using System.Drawing; using PckStudio.Internal.Skin; +using OMI.Formats.Model; +using PckStudio.Internal.Json; +using System.Collections.ObjectModel; +using PckStudio.Properties; namespace PckStudio.Internal { @@ -48,6 +51,13 @@ namespace PckStudio.Internal internal static string SupportedModelFileFormatsFilter { get; } = string.Join("|", SupportedModelFormts); + internal static ReadOnlyDictionary ModelTextureLocations { get; private set; } + + static ModelImporter() + { + ModelTextureLocations = JsonConvert.DeserializeObject>(Resources.modelTextureLocations); + } + internal static SkinModelInfo Import(string fileName) { string fileExtension = Path.GetExtension(fileName); @@ -185,7 +195,7 @@ namespace PckStudio.Internal if (!element.UseBoxUv || !element.IsVisibile) return; - BoundingBox boundingBox = new BoundingBox(element.From, element.To); + var boundingBox = new Rendering.BoundingBox(element.From, element.To); Vector3 pos = boundingBox.Start; Vector3 size = boundingBox.Volume; Vector2 uv = element.UvOffset; @@ -202,19 +212,7 @@ namespace PckStudio.Internal internal static void ExportBlockBenchModel(string fileName, SkinModelInfo modelInfo) { Image exportTexture = FixTexture(modelInfo); - BlockBenchModel blockBenchModel = new BlockBenchModel() - { - Name = Path.GetFileNameWithoutExtension(fileName), - Textures = [exportTexture], - TextureResolution = new TextureRes(64, exportTexture.Width == exportTexture.Height ? 64 : 32), - ModelIdentifier = "", - Metadata = new Meta() - { - FormatVersion = "4.5", - ModelFormat = "free", - UseBoxUv = true, - } - }; + BlockBenchModel blockBenchModel = CreateBlockBenchModel(Path.GetFileNameWithoutExtension(fileName), new Size(64, exportTexture.Width == exportTexture.Height ? 64 : 32), [exportTexture]); Dictionary outliners = new Dictionary(5); List elements = new List(modelInfo.AdditionalBoxes.Count); @@ -254,26 +252,97 @@ namespace PckStudio.Internal File.WriteAllText(fileName, content); } + internal static void ExportBlockBenchModel(string fileName, Model model, IEnumerable textures) + { + BlockBenchModel blockBenchModel = CreateBlockBenchModel(Path.GetFileNameWithoutExtension(fileName), model.TextureSize, textures.Select(nt => (Texture)nt)); + + List outliners = new List(5); + List elements = new List(model.Parts.Count); + + Vector3 transformAxis = new Vector3(1, 1, 0); + + foreach (ModelPart part in model.Parts.Values) + { + var outline = new Outline(part.Name); + + Vector3 partTranslation = new Vector3(part.TranslationX, part.TranslationY, part.TranslationZ); + outline.Origin = TranslateToInternalPosition("", partTranslation, Vector3.Zero, transformAxis); + + Vector3 rotation = new Vector3(part.UnknownFloat, part.TextureOffsetX, part.TextureOffsetY) + new Vector3(part.RotationX, part.RotationY, part.RotationZ); + outline.Rotation = rotation * TransformSpace(Vector3.One, Vector3.Zero, transformAxis); + + foreach (ModelBox box in part.Boxes) + { + Element element = CreateElement(box, partTranslation, part.Name); + element.Origin = outline.Origin; + elements.Add(element); + outline.Children.Add(element.Uuid); + } + outliners.Add(outline); + } + + blockBenchModel.Elements = elements.ToArray(); + blockBenchModel.Outliner = JArray.FromObject(outliners); + + string content = JsonConvert.SerializeObject(blockBenchModel); + File.WriteAllText(fileName, content); + } + + private static BlockBenchModel CreateBlockBenchModel(string name, Size textureResolution, IEnumerable textures) + { + return new BlockBenchModel() + { + Name = name, + Textures = textures.ToArray(), + TextureResolution = textureResolution, + ModelIdentifier = "", + Metadata = new Meta() + { + FormatVersion = "4.5", + ModelFormat = "free", + UseBoxUv = true, + } + }; + } + private static Element CreateElement(SkinBOX box) { - Element element = new Element + Vector3 transformPos = TranslateFromInternalPosistion(box, new Vector3(1, 1, 0)); + Element element = CreateElement(box.UV, transformPos, box.Size, box.Scale, box.Mirror); + if (box.IsOverlayPart()) + element.Inflate = box.Type == "HEADWEAR" ? 0.5f : 0.25f; + return element; + } + + private static Element CreateElement(ModelBox box, Vector3 origin, string name) { - Name = "cube", + Vector3 pos = new Vector3(box.PositionX, box.PositionY, box.PositionZ); + Vector3 size = new Vector3(box.Length, box.Height, box.Width); + Vector3 transformPos = TranslateToInternalPosition("", pos + origin, size, new Vector3(1, 1, 0)); + return CreateElement(name, new Vector2(box.UvX, box.UvY), transformPos, size, box.Scale, box.Mirror); + } + + private static Element CreateElement(Vector2 uvOffset, Vector3 pos, Vector3 size, float inflate, bool mirror) + { + return CreateElement("cube", uvOffset, pos, size, inflate, mirror); + } + + private static Element CreateElement(string name, Vector2 uvOffset, Vector3 pos, Vector3 size, float inflate, bool mirror) + { + return new Element + { + Name = name, UseBoxUv = true, Locked = false, Rescale = false, Type = "cube", Uuid = Guid.NewGuid(), - UvOffset = box.UV, - MirrorUv = box.Mirror + UvOffset = uvOffset, + MirrorUv = mirror, + Inflate = inflate, + From = pos, + To = pos + size }; - Vector3 transformPos = TranslateFromInternalPosistion(box, new Vector3(1, 1, 0)); - - element.From = transformPos; - element.To = transformPos + box.Size; - if (box.IsOverlayPart()) - element.Inflate = box.Type == "HEADWEAR" ? 0.5f : 0.25f; - return element; } internal static SkinModelInfo ImportBedrockJson(string fileName) diff --git a/PCK-Studio/Internal/NamedTexture.cs b/PCK-Studio/Internal/NamedTexture.cs new file mode 100644 index 00000000..8e178589 --- /dev/null +++ b/PCK-Studio/Internal/NamedTexture.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +namespace PckStudio.Internal +{ + internal readonly struct NamedTexture + { + public readonly string Name; + public readonly Image Texture; + + public NamedTexture(string name, Image texture) + { + Name = name; + Texture = texture; + } + } +} diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index ac107b3e..0ab4b908 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -109,7 +109,7 @@ namespace PckStudio [PckAssetType.ColourTableFile] = HandleColourFile, [PckAssetType.GameRulesHeader] = HandleGameRuleFile, [PckAssetType.SkinDataFile] = null, // HandleInnerPckFile, - [PckAssetType.ModelsFile] = null, //HandleModelsFile, // Note: Uncomment when implemented + [PckAssetType.ModelsFile] = HandleModelsFile, // Note: Uncomment when implemented [PckAssetType.BehavioursFile] = HandleBehavioursFile, [PckAssetType.MaterialFile] = HandleMaterialFile, }; @@ -598,7 +598,59 @@ namespace PckStudio public void HandleModelsFile(PckAsset file) { - MessageBox.Show(this, "Models.bin support has not been implemented. You can use the Spark Editor for the time being to edit these files.", "Not implemented yet."); + ModelContainer modelContainer = file.GetData(new ModelFileReader()); + if (modelContainer.Models.Count == 0) + { + MessageBox.Show("No models found.", "Empty Model file", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + +#if false + Dictionary modelMetaData = new(); + foreach (Model model in modelContainer.Models.Values) + { + bool hasMetaData = ModelImporter.ModelTextureLocations.ContainsKey(model.Name); + if (!hasMetaData) + { + Debug.WriteLine("No meta data found for: " + model.Name); + modelMetaData.Add(model.Name, new JsonModelMetaData() { TextureLocations = new string[1] }); + } + } + Debug.WriteLineIf(modelMetaData.Count > 0, JsonConvert.SerializeObject(modelMetaData, Formatting.Indented)); +#endif + + using ItemSelectionPopUp itemSelection = new ItemSelectionPopUp(modelContainer.Models.Keys.ToArray()); + if (itemSelection.ShowDialog() == DialogResult.OK && modelContainer.Models.ContainsKey(itemSelection.SelectedItem)) + { + Model model = modelContainer.Models[itemSelection.SelectedItem]; + Debug.WriteLine(model.Name + "; "); + Debug.WriteLine(model.TextureSize + "; "); + + using SaveFileDialog openFileDialog = new SaveFileDialog(); + openFileDialog.FileName = model.Name; + openFileDialog.Filter = "Block bench model(*.bbmodel)|*.bbmodel"; + + IEnumerable GetModelTextures(string modelName) + { + if (!ModelImporter.ModelTextureLocations.ContainsKey(modelName) || ModelImporter.ModelTextureLocations[modelName]?.TextureLocations?.Length <= 0) + return Array.Empty(); + + return ModelImporter.ModelTextureLocations[modelName].TextureLocations.Select(texturePath => + { + if (currentPCK.TryGetAsset(texturePath + ".png", PckAssetType.TextureFile, out PckAsset modelTextureAsset) || + currentPCK.TryGetAsset(texturePath + ".tga", PckAssetType.TextureFile, out modelTextureAsset)) + return new NamedTexture(Path.GetFileName(texturePath), modelTextureAsset.GetTexture()); + return default!; + }); + } + + IEnumerable textures = GetModelTextures(model.Name); + + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + ModelImporter.ExportBlockBenchModel(openFileDialog.FileName, model, textures); + } + } } public void HandleBehavioursFile(PckAsset asset) diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index ceeba42f..435e8ec6 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -169,6 +169,8 @@ + + @@ -627,6 +629,7 @@ + diff --git a/PCK-Studio/Properties/Resources.Designer.cs b/PCK-Studio/Properties/Resources.Designer.cs index 6eb441de..d96b6785 100644 --- a/PCK-Studio/Properties/Resources.Designer.cs +++ b/PCK-Studio/Properties/Resources.Designer.cs @@ -245,9 +245,8 @@ namespace PckStudio.Properties { } /// - /// Looks up a localized string similar to 7.0 (IN DEVELOPMENT) + /// Looks up a localized string similar to 7.0.0.0 ///==================== - ///Some features may be completely missing or incomplete at this point in time! /// ///-Added .3dst (3DS Texture) support ///-Semi-added Sub-Pck editing @@ -258,7 +257,8 @@ namespace PckStudio.Properties { ///-Massive codebase overhaul and optimization lead by miku-666 (aka NessieHax)!!! ///-Some UI redesigned by yaboiFoxx ///-Improved the changelog! - ///-New icons for each o [rest of string was truncated]";. + ///-New icons for each of the file types, with unique image icons for skin, texture, and cape files + ///-Added the abili [rest of string was truncated]";. /// public static string CHANGELOG { get { @@ -727,9 +727,9 @@ namespace PckStudio.Properties { /// { /// "internalName": "helmetCloth", /// "displayName": "Leather Cap", + /// "allowCustomColour": true, /// "hasColourEntry": true, /// "colourEntry": { - /// "hasCustomColour": true, /// "defaultName": "Armour_Default_Leather_Colour", /// "variants": [ "Armour_Default_Leather_Colour" ] /// } @@ -739,7 +739,7 @@ namespace PckStudio.Properties { /// "displayName": "Chain Helmet" /// }, /// { - /// "internalName": " [rest of string was truncated]";. + /// "internalName": [rest of string was truncated]";. /// public static string itemData { get { @@ -824,6 +824,26 @@ namespace PckStudio.Properties { } } + /// + /// Looks up a localized string similar to { + /// "bat": [ "res/mob/bat" ], + /// "bed": [ "res/item/bed" ], + /// "blaze": [ "res/mob/fire" ], + /// "boat": [ "res/item/boat/boat_acacia", "res/item/boat/boat_birch", "res/item/boat/boat_darkoak", "res/item/boat/boat_jungle", "res/item/boat/boat_oak", "res/item/boat/boat_spruce" ], + /// "chicken": [ "res/mob/chicken" ], + /// "cow": [ "res/mob/cow" ], + /// "creeper": [ "res/mob/creeper" ], + /// "creeper_head": [ "res/mob/creeper" ], + /// "dolphin": [ "res/mob/dolphin" ], + /// "dragon": [ "res/mob/enderdragon/ender" ], + /// "d [rest of string was truncated]";. + /// + public static string modelTextureLocations { + get { + return ResourceManager.GetString("modelTextureLocations", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/PCK-Studio/Properties/Resources.resx b/PCK-Studio/Properties/Resources.resx index c9ad906e..f4da87e9 100644 --- a/PCK-Studio/Properties/Resources.resx +++ b/PCK-Studio/Properties/Resources.resx @@ -379,69 +379,6 @@ ..\Resources\icons\Replace.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons\file_export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons\file_import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons\ranch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\..\ProjectLogo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\moon_phases.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\additional_mapicons.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\map_icons.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\experience_orbs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\blockData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\experienceOrbData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\explosionData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\explosion.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\itemData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\mapIconData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\moonPhaseData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\particleData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\particles.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\bannerData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\atlases\banners.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\paintingData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - - - ..\Resources\atlases\paintings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\shader\skinVertexShader.glsl;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 @@ -475,12 +412,6 @@ ..\Resources\armor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\external\trello.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\atlases\entityBehavioursData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - ..\Resources\anim_editor\slim_template.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -490,4 +421,7 @@ ..\Resources\icons\file_restore.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\model\modelTextureLocations.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + \ No newline at end of file diff --git a/PCK-Studio/Resources/model/modelTextureLocations.json b/PCK-Studio/Resources/model/modelTextureLocations.json new file mode 100644 index 00000000..2b526359 --- /dev/null +++ b/PCK-Studio/Resources/model/modelTextureLocations.json @@ -0,0 +1,404 @@ +{ + "bat": { + "textureLocations": [ + "res/mob/bat" + ], + "parents": { + "rightEar": "head", + "leftEar": "head" + } + }, + "bed": { + "textureLocations": [ + "res/item/bed" + ] + }, + "blaze": { + "textureLocations": [ + "res/mob/fire" + ] + + }, + "boat": { + "textureLocations": [ + "res/item/boat/boat_acacia", + "res/item/boat/boat_birch", + "res/item/boat/boat_darkoak", + "res/item/boat/boat_jungle", + "res/item/boat/boat_oak", + "res/item/boat/boat_spruce" + ] + }, + "chicken": { + "textureLocations": [ + "res/mob/chicken" + ], + "parents": { + "comb": "head", + "beak": "head" + } + }, + "cow": { + "textureLocations": [ + "res/mob/cow" + ] + }, + "creeper": { + "textureLocations": [ + "res/mob/creeper" + ] + }, + "creeper_head": { + "textureLocations": [ + "res/mob/creeper" + ] + }, + "dolphin": { + "textureLocations": [ + "res/mob/dolphin" + ] + }, + "dragon": { + "textureLocations": [ + "res/mob/enderdragon/ender" + ] + }, + "dragon_head": { + "textureLocations": [ + "res/mob/enderdragon/ender" + ] + }, + "enderman": { + "textureLocations": [ + "res/mob/enderman" + ] + }, + "evoker": { + "textureLocations": [ + "res/mob/illager/evoker" + ] + }, + "ghast": { + "textureLocations": [ + "res/mob/ghast", + "res/mob/ghast_fire" + ] + }, + "guardian": { + "textureLocations": [ + "res/mob/guardian", + "res/mob/guardian_elder" + ] + }, + "irongolem": { + "textureLocations": [ + "res/mob/villager_golem" + ] + }, + "lavaslime": { + "textureLocations": [ + "res/mob/lava" + ] + }, + "llama": { + "textureLocations": [ + "res/mob/llama/llama", + "res/mob/llama/llama_brown", + "res/mob/llama/llama_creamy", + "res/mob/llama/llama_gray", + "res/mob/llama/llama_white" + ] + }, + "minecart": { + "textureLocations": [ + "res/item/cart" + ] + }, + "ocelot": { + "textureLocations": [ + "res/mob/ozelot" + ] + }, + "parrot": { + "textureLocations": [ + "res/mob/parrot/parrot_blue", + "res/mob/parrot/parrot_green", + "res/mob/parrot/parrot_grey", + "res/mob/parrot/parrot_red_blue", + "res/mob/parrot/parrot_yellow_blue" + ] + }, + "phantom": { + "textureLocations": [ + "res/mob/phantom" + ] + }, + "pig": { + "textureLocations": [ + "res/mob/pig", + "res/mob/saddle" + ] + }, + "pigzombie": { + "textureLocations": [ + "res/mob/pigzombie" + ] + }, + "polarbear": { + "textureLocations": [ + "res/mob/bear/polarbear" + ] + }, + "rabbit": { + "textureLocations": [ + "res/mob/rabbit/black", + "res/mob/rabbit/brown", + "res/mob/rabbit/caerbannog", + "res/mob/rabbit/gold", + "res/mob/rabbit/salt", + "res/mob/rabbit/toast", + "res/mob/rabbit/white", + "res/mob/rabbit/white_splotched" + ] + }, + "sheep": { + "textureLocations": [ + "res/mob/sheep" + ] + }, + "sheep.sheared": { + "textureLocations": [ + "" + ] + }, + "shulker": { + "textureLocations": [ + "res/mob/shulker/endergolem", + "res/mob/shulker/spark" + ] + }, + "silverfish": { + "textureLocations": [ + "res/mob/silverfish" + ] + }, + "skeleton": { + "textureLocations": [ + "res/mob/skeleton" + ] + }, + "skeleton.stray": { + "textureLocations": [ + "res/mob/skeleton/stray" + ] + }, + "skeleton.wither": { + "textureLocations": [ + "res/mob/skeleton_wither" + ] + }, + "slime": { + "textureLocations": [ + "res/mob/slime" + ] + }, + "slime.armor": { + "textureLocations": [ + "" + ] + }, + "snowgolem": { + "textureLocations": [ + "res/mob/snowman" + ] + }, + "spider": { + "textureLocations": [ + "res/mob/spider" + ] + }, + "squid": { + "textureLocations": [ + "res/mob/squid" + ] + }, + "trident": { + "textureLocations": [ + "res/item/trident" + ] + }, + "turtle": { + "textureLocations": [ + "res/mob/sea_turtle" + ] + }, + "vex": { + "textureLocations": [ + "res/mob/illager/vex", + "res/mob/illager/vex_charging" + ] + }, + "villager": { + "textureLocations": [ + "res/mob/villager/villager", + "res/mob/villager/butcher", + "res/mob/villager/farmer", + "res/mob/villager/librarian", + "res/mob/villager/priest", + "res/mob/villager/smith" + ] + }, + "villager.witch": { + "textureLocations": [ + "res/mob/witch" + ] + }, + "vindicator": { + "textureLocations": [ + "res/mob/illager/vindicator" + ] + }, + "witherBoss": { + "textureLocations": [ + "res/mob/wither/wither", + "res/mob/wither/wither_invulnerable" + ] + }, + "wolf": { + "textureLocations": [ + "res/mob/wolf", + "res/mob/wolf_angry", + "res/mob/wolf_tame" + ] + }, + "zombie": { + "textureLocations": [ + "res/mob/zombie" + ] + }, + "zombie.husk": { + "textureLocations": [ + "res/mob/zombie/husk" + ] + }, + "zombie.villager": { + "textureLocations": [ + "res/mob/zombie_villager/zombie_villager", + "res/mob/zombie_villager/zombie_butcher", + "res/mob/zombie_villager/zombie_farmer", + "res/mob/zombie_villager/zombie_librarian", + "res/mob/zombie_villager/zombie_priest", + "res/mob/zombie_villager/zombie_smith" + ] + }, + "horse.v2": { + // markings and armor no included + "textureLocations": [ + "res/mob/horse/donkey", + "res/mob/horse/horse_black", + "res/mob/horse/horse_brown", + "res/mob/horse/horse_chestnut", + "res/mob/horse/horse_creamy", + "res/mob/horse/horse_darkbrown", + "res/mob/horse/horse_gray", + "res/mob/horse/horse_skeleton", + "res/mob/horse/horse_white", + "res/mob/horse/horse_zombie", + "res/mob/horse/mule" + ] + }, + "cat": { + "textureLocations": [ + "res/mob/cat_black", + "res/mob/cat_red", + "res/mob/cat_siamese" + ] + }, + "cod": { + "textureLocations": [ + "res/mob/fish/cod" + ] + }, + "zombie.drowned": { + "textureLocations": [ + "res/mob/zombie/drowned" + ] + }, + "endermite": { + "textureLocations": [ + "res/mob/endermite" + ] + }, + "panda": { + "textureLocations": [ + null + ] + }, + "pufferfish.large": { + "textureLocations": [ + "res/mob/fish/pufferfish" + ] + }, + "pufferfish.mid": { + "textureLocations": [ + "res/mob/fish/pufferfish" + ] + }, + "pufferfish.small": { + "textureLocations": [ + "res/mob/fish/pufferfish" + ] + }, + "salmon": { + "textureLocations": [ + "res/mob/fish/salmon" + ] + }, + "skeleton_head": { + "textureLocations": [ + "res/mob/skeleton" + ] + }, + "skeleton_wither_head": { + "textureLocations": [ + "res/mob/skeleton_wither" + ] + }, + "stray.armor": { + "textureLocations": [ + "res/mob/skeleton/stray_overlay" + ] + }, + "stray_armor": { + "textureLocations": [ + "res/mob/skeleton/stray_overlay" + ] + }, + "tropicalfish_a": { + // not including patterns 1-6 + "textureLocations": [ + "res/mob/fish/tropical_a" + ] + }, + "tropicalfish_b": { + // not including patterns 1-6 + "textureLocations": [ + "res/mob/fish/tropical_b" + ] + }, + "zombie_head": { + "textureLocations": [ + "res/mob/zombie" + ] + }, + "mooshroom": { + "textureLocations": [ + "res/mob/redcow" + ] + }, + "witherBoss.armor": { + "textureLocations": [ + "res/mob/wither/wither_armor" + ] + } +}