resolve material issues
This commit is contained in:
@@ -121,7 +121,7 @@ public class CharacterDataFactory
|
||||
Logger.Warn("Could not get model data for " + objectKind);
|
||||
return;
|
||||
}
|
||||
//Logger.Verbose("Adding File Replacement for Model " + mdlPath);
|
||||
//Logger.Verbose("Checking File Replacement for Model " + mdlPath);
|
||||
|
||||
FileReplacement mdlFileReplacement = CreateFileReplacement(mdlPath);
|
||||
DebugPrint(mdlFileReplacement, objectKind, "Model", inheritanceLevel);
|
||||
@@ -151,6 +151,7 @@ public class CharacterDataFactory
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Verbose("Check File Replacement for Material " + fileName);
|
||||
var mtrlPath = fileName.Split("|")[2];
|
||||
|
||||
if (cache.FileReplacements.ContainsKey(objectKind))
|
||||
@@ -181,6 +182,8 @@ public class CharacterDataFactory
|
||||
|
||||
if (string.IsNullOrEmpty(texPath)) continue;
|
||||
|
||||
Logger.Verbose("Check File Replacement for Texture " + texPath);
|
||||
|
||||
AddReplacementsFromTexture(texPath, objectKind, cache, inheritanceLevel + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace MareSynchronos.Managers
|
||||
|
||||
public event TransientResourceLoadedEvent? TransientResourceLoaded;
|
||||
public IntPtr[] PlayerRelatedPointers = Array.Empty<IntPtr>();
|
||||
private readonly string[] FileTypesToHandle = new[] { "tmb", "pap", "avfx", "atex", "sklb", "eid", "phyb", "scd", "skp" };
|
||||
|
||||
private ConcurrentDictionary<IntPtr, HashSet<string>> TransientResources { get; } = new();
|
||||
private ConcurrentDictionary<ObjectKind, HashSet<FileReplacement>> SemiTransientResources { get; } = new();
|
||||
@@ -81,6 +82,10 @@ namespace MareSynchronos.Managers
|
||||
|
||||
private void Manager_PenumbraResourceLoadEvent(IntPtr gameObject, string gamePath, string filePath)
|
||||
{
|
||||
if (!FileTypesToHandle.Any(type => gamePath.ToLowerInvariant().EndsWith(type)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!PlayerRelatedPointers.Contains(gameObject))
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.4.3</Version>
|
||||
<Version>0.4.4</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace MareSynchronos.Models
|
||||
|
||||
public void SetResolvedPath(string path)
|
||||
{
|
||||
ResolvedPath = path.ToLowerInvariant();//.Replace('/', '\\').Replace(_penumbraDirectory, "").Replace('\\', '/');
|
||||
ResolvedPath = path.ToLowerInvariant().Replace('\\', '/');//.Replace('/', '\\').Replace(_penumbraDirectory, "").Replace('\\', '/');
|
||||
if (!HasFileReplacement || IsFileSwap) return;
|
||||
|
||||
_ = Task.Run(() =>
|
||||
@@ -43,7 +43,7 @@ namespace MareSynchronos.Models
|
||||
FileCache? fileCache;
|
||||
using (FileCacheContext db = new())
|
||||
{
|
||||
fileCache = db.FileCaches.FirstOrDefault(f => f.Filepath == path.ToLowerInvariant());
|
||||
fileCache = db.FileCaches.FirstOrDefault(f => f.Filepath == path.Replace('/', '\\').ToLowerInvariant());
|
||||
}
|
||||
|
||||
if (fileCache != null)
|
||||
@@ -57,7 +57,7 @@ namespace MareSynchronos.Models
|
||||
{
|
||||
Hash = ComputeHash(fi);
|
||||
using var db = new FileCacheContext();
|
||||
var newTempCache = db.FileCaches.Single(f => f.Filepath == path.ToLowerInvariant());
|
||||
var newTempCache = db.FileCaches.Single(f => f.Filepath == path.Replace('/', '\\').ToLowerInvariant());
|
||||
newTempCache.Hash = Hash;
|
||||
db.Update(newTempCache);
|
||||
db.SaveChanges();
|
||||
@@ -65,7 +65,7 @@ namespace MareSynchronos.Models
|
||||
}
|
||||
else
|
||||
{
|
||||
Hash = ComputeHash(new FileInfo(path));
|
||||
Hash = ComputeHash(new FileInfo(path.Replace('/', '\\').ToLowerInvariant()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user