Fixed a bug where 64x32 skins were incorrectly set as 64x64

This commit is contained in:
MattNL
2023-11-11 15:13:10 -05:00
parent 70e04069d1
commit abbb99cc60
2 changed files with 13 additions and 0 deletions

View File

@@ -343,6 +343,12 @@ namespace PckStudio.Conversion.Bedrock
new GeometryBone("leftBootArmorOffset", "leftLeg", new Vector3(-2f, 12f - TryGetOffsetValue("BOOT1", offsets), 0f), null, "armor_offset")
);
var ANIM = SkinANIM.FromString(file.Properties.Find(o => o.Key == "ANIM").Value) ?? SkinANIM.Empty;
bool IsClassicRes = !(ANIM.GetFlag(ANIM_EFFECTS.RESOLUTION_64x64) || ANIM.GetFlag(ANIM_EFFECTS.SLIM_MODEL));
geometry.TextureWidth = 64;
geometry.TextureHeight = IsClassicRes ? 32 : 64;
string capepath = file.Properties.Find(o => o.Key == "CAPEPATH").Value;
JToken geo = JToken.FromObject(geometry);

View File

@@ -92,6 +92,13 @@ namespace PckStudio.Conversion.Common.JsonDefinitions
visibleBounds.Offset.CopyTo(VisibleBoundsOffset);
}
// yeah the property name has no space, it's annoying - Matt
[JsonProperty("texturewidth")]
public int TextureWidth { get; set; }
[JsonProperty("textureheight")]
public int TextureHeight { get; set; }
[JsonProperty("visible_bounds_width")]
public int VisibleBoundsWidth { get; set; }