mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
better solution
This commit is contained in:
parent
ad9eb89654
commit
992f9c2f01
1 changed files with 11 additions and 6 deletions
|
|
@ -19,6 +19,7 @@ using SharpGLTF.Scenes;
|
||||||
using SixLabors.ImageSharp;
|
using SixLabors.ImageSharp;
|
||||||
using SixLabors.ImageSharp.PixelFormats;
|
using SixLabors.ImageSharp.PixelFormats;
|
||||||
|
|
||||||
|
|
||||||
namespace Penumbra.Import.Models;
|
namespace Penumbra.Import.Models;
|
||||||
|
|
||||||
using Schema2 = SharpGLTF.Schema2;
|
using Schema2 = SharpGLTF.Schema2;
|
||||||
|
|
@ -33,6 +34,7 @@ public sealed class ModelManager(IFramework framework, MetaFileManager metaFileM
|
||||||
|
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
|
|
@ -116,12 +118,15 @@ public sealed class ModelManager(IFramework framework, MetaFileManager metaFileM
|
||||||
|
|
||||||
//Lumina expects strings to be at least 15 chars, we assume it's not a vanilla material if its less than that as a temporary fix
|
//Lumina expects strings to be at least 15 chars, we assume it's not a vanilla material if its less than that as a temporary fix
|
||||||
string? absolutePath = null;
|
string? absolutePath = null;
|
||||||
if (rawPath.Length > 14)
|
|
||||||
{
|
|
||||||
// Get standardised paths
|
// Get standardised paths
|
||||||
absolutePath = rawPath.StartsWith('/')
|
if (Regex.IsMatch(rawPath, @"/mt_[cdmw]\d{4}[abefhtze]\d{4}_(?:\w{3}(?:_\w)|(?:\w))\.mtrl"))
|
||||||
? LuminaMaterial.ResolveRelativeMaterialPath(rawPath, variantId)
|
{
|
||||||
: rawPath;
|
absolutePath = LuminaMaterial.ResolveRelativeMaterialPath(rawPath, variantId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
absolutePath = rawPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
var relativePath = rawPath.StartsWith('/')
|
var relativePath = rawPath.StartsWith('/')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue