diff --git a/FModel/ViewModels/Commands/TabCommand.cs b/FModel/ViewModels/Commands/TabCommand.cs index 5a62a2f2..94a1feea 100644 --- a/FModel/ViewModels/Commands/TabCommand.cs +++ b/FModel/ViewModels/Commands/TabCommand.cs @@ -17,7 +17,6 @@ public class TabCommand : ViewModelCommand public override async void Execute(TabItem contextViewModel, object parameter) { - var fullPath = contextViewModel.Directory + "/" + contextViewModel.Header; switch (parameter) { case TabItem mdlClick: @@ -33,32 +32,32 @@ public class TabCommand : ViewModelCommand _applicationView.CUE4Parse.TabControl.RemoveOtherTabs(contextViewModel); break; case "Asset_Export_Data": - await _threadWorkerView.Begin(_ => _applicationView.CUE4Parse.ExportData(fullPath)); + await _threadWorkerView.Begin(_ => _applicationView.CUE4Parse.ExportData(contextViewModel.FullPath)); break; case "Asset_Save_Properties": await _threadWorkerView.Begin(cancellationToken => { - _applicationView.CUE4Parse.Extract(cancellationToken, fullPath, false, EBulkType.Properties); + _applicationView.CUE4Parse.Extract(cancellationToken, contextViewModel.FullPath, false, EBulkType.Properties); _applicationView.CUE4Parse.TabControl.SelectedTab.SaveProperty(false); }); break; case "Asset_Save_Textures": await _threadWorkerView.Begin(cancellationToken => { - _applicationView.CUE4Parse.Extract(cancellationToken, fullPath, false, EBulkType.Textures); + _applicationView.CUE4Parse.Extract(cancellationToken, contextViewModel.FullPath, false, EBulkType.Textures); _applicationView.CUE4Parse.TabControl.SelectedTab.SaveImages(false); }); break; case "Asset_Save_Models": await _threadWorkerView.Begin(cancellationToken => { - _applicationView.CUE4Parse.Extract(cancellationToken, fullPath, false, EBulkType.Meshes); + _applicationView.CUE4Parse.Extract(cancellationToken, contextViewModel.FullPath, false, EBulkType.Meshes); }); break; case "Asset_Save_Animations": await _threadWorkerView.Begin(cancellationToken => { - _applicationView.CUE4Parse.Extract(cancellationToken, fullPath, false, EBulkType.Animations); + _applicationView.CUE4Parse.Extract(cancellationToken, contextViewModel.FullPath, false, EBulkType.Animations); }); break; case "Open_Properties": @@ -71,8 +70,8 @@ public class TabCommand : ViewModelCommand }.Show(); }); break; - case "Copy_Asset_Name": - Clipboard.SetText(contextViewModel.Header); + case "Copy_Asset_Path": + Clipboard.SetText(contextViewModel.FullPath); break; } } diff --git a/FModel/ViewModels/TabControlViewModel.cs b/FModel/ViewModels/TabControlViewModel.cs index 03aabb5a..f768d4e1 100644 --- a/FModel/ViewModels/TabControlViewModel.cs +++ b/FModel/ViewModels/TabControlViewModel.cs @@ -102,6 +102,8 @@ public class TabItem : ViewModel set => SetProperty(ref _directory, value); } + public string FullPath => this.Directory + "/" + this.Header; + private bool _hasSearchOpen; public bool HasSearchOpen { diff --git a/FModel/Views/Resources/Resources.xaml b/FModel/Views/Resources/Resources.xaml index fefe46ae..dd28d869 100644 --- a/FModel/Views/Resources/Resources.xaml +++ b/FModel/Views/Resources/Resources.xaml @@ -919,7 +919,7 @@ - + diff --git a/FModel/Views/Snooper/Material.cs b/FModel/Views/Snooper/Material.cs index 4211357e..2d8d321f 100644 --- a/FModel/Views/Snooper/Material.cs +++ b/FModel/Views/Snooper/Material.cs @@ -241,25 +241,26 @@ public class Material : IDisposable { if (ImGui.BeginTable("parameters", 2)) { - SnimGui.Layout("Specular");ImGui.PushID(1); + var id = 1; + SnimGui.Layout("Specular");ImGui.PushID(id++); ImGui.DragFloat("", ref Specular, _step, _zero, 1.0f, _mult, _clamp); - ImGui.PopID();SnimGui.Layout("Roughness");ImGui.PushID(2); + ImGui.PopID();SnimGui.Layout("Roughness");ImGui.PushID(id++); ImGui.DragFloat("", ref Roughness, _step, _zero, 1.0f, _mult, _clamp); - ImGui.PopID();SnimGui.Layout("Emissive Multiplier");ImGui.PushID(3); + ImGui.PopID();SnimGui.Layout("Emissive Multiplier");ImGui.PushID(id++); ImGui.DragFloat("", ref EmissiveMult, _step, _zero, _infinite, _mult, _clamp); - ImGui.PopID();SnimGui.Layout("UV Scale");ImGui.PushID(4); + ImGui.PopID();SnimGui.Layout("UV Scale");ImGui.PushID(id++); ImGui.DragFloat("", ref UVScale, _step, _zero, _infinite, _mult, _clamp); ImGui.PopID(); if (HasAo) { - SnimGui.Layout("Ambient Occlusion");ImGui.PushID(5); + SnimGui.Layout("Ambient Occlusion");ImGui.PushID(id++); ImGui.DragFloat("", ref Ao.AmbientOcclusion, _step, _zero, 1.0f, _mult, _clamp);ImGui.PopID(); if (Ao.HasColorBoost) { - SnimGui.Layout("Color Boost");ImGui.PushID(6); + SnimGui.Layout("Color Boost");ImGui.PushID(id++); ImGui.ColorEdit3("", ref Ao.ColorBoost.Color);ImGui.PopID(); - SnimGui.Layout("Color Boost Exponent");ImGui.PushID(7); + SnimGui.Layout("Color Boost Exponent");ImGui.PushID(id++); ImGui.DragFloat("", ref Ao.ColorBoost.Exponent, _step, _zero, _infinite, _mult, _clamp); ImGui.PopID(); } diff --git a/FModel/Views/Snooper/Shader.cs b/FModel/Views/Snooper/Shader.cs index 51660b11..aca4fd37 100644 --- a/FModel/Views/Snooper/Shader.cs +++ b/FModel/Views/Snooper/Shader.cs @@ -40,7 +40,12 @@ public class Shader : IDisposable using var stream = executingAssembly.GetManifestResourceStream($"{executingAssembly.GetName().Name}.Resources.{file}"); using var reader = new StreamReader(stream); var handle = GL.CreateShader(type); - GL.ShaderSource(handle, reader.ReadToEnd()); + + var content = reader.ReadToEnd(); + if (file.Equals("default.frag") && GL.GetInteger(GetPName.MaxTextureUnits) == 0) + content = content.Replace("#define MAX_UV_COUNT 8", "#define MAX_UV_COUNT 1"); + + GL.ShaderSource(handle, content); GL.CompileShader(handle); string infoLog = GL.GetShaderInfoLog(handle); if (!string.IsNullOrWhiteSpace(infoLog))