mirror of
https://github.com/4sval/FModel.git
synced 2026-09-12 19:46:47 -05:00
full fix #344
This commit is contained in:
@@ -17,7 +17,6 @@ public class TabCommand : ViewModelCommand<TabItem>
|
||||
|
||||
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<TabItem>
|
||||
_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<TabItem>
|
||||
}.Show();
|
||||
});
|
||||
break;
|
||||
case "Copy_Asset_Name":
|
||||
Clipboard.SetText(contextViewModel.Header);
|
||||
case "Copy_Asset_Path":
|
||||
Clipboard.SetText(contextViewModel.FullPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -919,7 +919,7 @@
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Copy Package Name" Command="{Binding TabCommand}" CommandParameter="Copy_Asset_Name">
|
||||
<MenuItem Header="Copy Package Path" Command="{Binding TabCommand}" CommandParameter="Copy_Asset_Path">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
<Canvas Width="24" Height="24">
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user