mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-24 22:04:56 +00:00
GameModelImporter - Rename 'ModelTextureLocations' -> 'ModelMetaData'
This commit is contained in:
@@ -34,7 +34,7 @@ namespace PckStudio.Internal
|
||||
{
|
||||
public static GameModelImporter Default { get; } = new GameModelImporter();
|
||||
|
||||
internal static ReadOnlyDictionary<string, JsonModelMetaData> ModelTextureLocations { get; } = JsonConvert.DeserializeObject<ReadOnlyDictionary<string, JsonModelMetaData>>(Resources.modelMetaData);
|
||||
internal static ReadOnlyDictionary<string, JsonModelMetaData> ModelMetaData { get; } = JsonConvert.DeserializeObject<ReadOnlyDictionary<string, JsonModelMetaData>>(Resources.modelMetaData);
|
||||
|
||||
private GameModelImporter()
|
||||
{
|
||||
@@ -72,7 +72,7 @@ namespace PckStudio.Internal
|
||||
outliners.Add(part.Name, outline);
|
||||
}
|
||||
|
||||
if (!ModelTextureLocations.TryGetValue(modelInfo.Model.Name, out JsonModelMetaData modelMetaData))
|
||||
if (!ModelMetaData.TryGetValue(modelInfo.Model.Name, out JsonModelMetaData modelMetaData))
|
||||
{
|
||||
Trace.TraceError($"[{nameof(GameModelImporter)}:{nameof(ExportBlockBenchModel)}] Failed to get model meta data for '{modelInfo.Model.Name}'.");
|
||||
return;
|
||||
|
||||
@@ -632,10 +632,10 @@ namespace PckStudio
|
||||
|
||||
IEnumerable<NamedTexture> GetModelTextures(string modelName)
|
||||
{
|
||||
if (!GameModelImporter.ModelTextureLocations.ContainsKey(modelName) || GameModelImporter.ModelTextureLocations[modelName]?.TextureLocations?.Length <= 0)
|
||||
if (!GameModelImporter.ModelMetaData.ContainsKey(modelName) || GameModelImporter.ModelMetaData[modelName]?.TextureLocations?.Length <= 0)
|
||||
return Enumerable.Empty<NamedTexture>();
|
||||
|
||||
return GameModelImporter.ModelTextureLocations[modelName].TextureLocations.Select(texturePath =>
|
||||
return GameModelImporter.ModelMetaData[modelName].TextureLocations.Select(texturePath =>
|
||||
{
|
||||
if (currentPCK.TryGetAsset(texturePath + ".png", PckAssetType.TextureFile, out PckAsset modelTextureAsset) ||
|
||||
currentPCK.TryGetAsset(texturePath + ".tga", PckAssetType.TextureFile, out modelTextureAsset))
|
||||
|
||||
Reference in New Issue
Block a user