- [Core] fix bug with export part for Materials.

This commit is contained in:
Razmoth
2024-01-30 20:53:12 +04:00
parent 92d7470082
commit 87e87cf0ab
3 changed files with 11 additions and 6 deletions

View File

@@ -374,7 +374,7 @@ namespace AssetStudio.GUI
: new ModelConverter(m_Animator, options);
if (options.exportMaterials)
{
var materialExportPath = Path.Combine(exportFullPath, "Materials");
var materialExportPath = Path.Combine(Path.GetDirectoryName(exportFullPath), "Materials");
Directory.CreateDirectory(materialExportPath);
foreach (var material in options.materials)
{
@@ -404,8 +404,8 @@ namespace AssetStudio.GUI
collectAnimations = Properties.Settings.Default.collectAnimations,
exportMaterials = Properties.Settings.Default.exportMaterials,
materials = new HashSet<Material>(),
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs, new JsonSerializerSettings() { DefaultValueHandling = DefaultValueHandling.Populate }),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs, new JsonSerializerSettings() { DefaultValueHandling = DefaultValueHandling.Populate }),
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
};
var convert = animationList != null
? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
@@ -449,7 +449,7 @@ namespace AssetStudio.GUI
: new ModelConverter(rootName, gameObject, options);
if (options.exportMaterials)
{
var materialExportPath = Path.Combine(exportPath, "Materials");
var materialExportPath = Path.Combine(Path.GetDirectoryName(exportPath), "Materials");
Directory.CreateDirectory(materialExportPath);
foreach (var material in options.materials)
{