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