From 9b0fcd995cdd5132cc20a562fd679380f9f7b3f3 Mon Sep 17 00:00:00 2001 From: Lunaretic Date: Mon, 22 Jul 2024 19:32:06 -0400 Subject: [PATCH 01/11] Tangent/Binormal calculation fixes, + Bubbling up various model flags. --- .../ViewModels/ImportModelEditViewModel.cs | 161 ++++++++++++- .../ModPack/Wizard/WizardPageControl.xaml.cs | 1 + .../Views/Models/ImportModelEditView.xaml | 227 +++++++++++++----- 3 files changed, 328 insertions(+), 61 deletions(-) diff --git a/FFXIV_TexTools/ViewModels/ImportModelEditViewModel.cs b/FFXIV_TexTools/ViewModels/ImportModelEditViewModel.cs index 223112ca..505f6ede 100644 --- a/FFXIV_TexTools/ViewModels/ImportModelEditViewModel.cs +++ b/FFXIV_TexTools/ViewModels/ImportModelEditViewModel.cs @@ -27,7 +27,7 @@ namespace FFXIV_TexTools.ViewModels { - public class ImportModelEditViewModel + public class ImportModelEditViewModel : INotifyPropertyChanged { @@ -60,6 +60,163 @@ public class ImportModelEditViewModel private XivDependencyRoot _root; + + public bool DisableShadows + { + get { + return (_newModel.Flags & EMeshFlags1.ShadowDisabled) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.ShadowDisabled; + } else + { + _newModel.Flags &= ~EMeshFlags1.ShadowDisabled; + } + } + } + public bool DisableLightShadow + { + get + { + return (_newModel.Flags & EMeshFlags1.LightShadowDisabled) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.LightShadowDisabled; + } + else + { + _newModel.Flags &= ~EMeshFlags1.LightShadowDisabled; + } + } + } + public bool EnableAnisotropy + { + get + { + return _newModel.AnisotropicLightingEnabled; + } + set + { + + _newModel.AnisotropicLightingEnabled = value; + } + } + public bool DisableWavingAnimation + { + get + { + return (_newModel.Flags & EMeshFlags1.WavingAnimationDisabled) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.WavingAnimationDisabled; + } + else + { + _newModel.Flags &= ~EMeshFlags1.WavingAnimationDisabled; + } + } + } + public bool EnableLightingReflection + { + get + { + return (_newModel.Flags & EMeshFlags1.LightingReflectionEnabled) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.LightingReflectionEnabled; + } + else + { + _newModel.Flags &= ~EMeshFlags1.LightingReflectionEnabled; + } + } + } + public bool UnknownFlag + { + get + { + return (_newModel.Flags & EMeshFlags1.Unknown10) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.Unknown10; + } + else + { + _newModel.Flags &= ~EMeshFlags1.Unknown10; + } + } + } + public bool OccludeRain + { + get + { + return (_newModel.Flags & EMeshFlags1.RainOcclusionEnabled) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.RainOcclusionEnabled; + } + else + { + _newModel.Flags &= ~EMeshFlags1.RainOcclusionEnabled; + } + } + } + public bool OccludeSnow + { + get + { + return (_newModel.Flags & EMeshFlags1.SnowOcclusionEnabled) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.SnowOcclusionEnabled; + } + else + { + _newModel.Flags &= ~EMeshFlags1.SnowOcclusionEnabled; + } + } + } + public bool OccludeDust + { + get + { + return (_newModel.Flags & EMeshFlags1.DustOcclusionEnabled) != 0; + } + set + { + if (value) + { + _newModel.Flags |= EMeshFlags1.DustOcclusionEnabled; + } + else + { + _newModel.Flags &= ~EMeshFlags1.DustOcclusionEnabled; + } + } + } + + private TTMeshGroup GetGroup() { if (_view.MeshNumberBox.SelectedValue == null) @@ -1009,5 +1166,7 @@ private void MaterialPathTextBox_KeyDown(object sender, System.Windows.Input.Key { "shp_nse_d", "Nose d" }, { "shp_nse_e", "Nose e" }, }; + + public event PropertyChangedEventHandler PropertyChanged; } } diff --git a/FFXIV_TexTools/Views/ModPack/Wizard/WizardPageControl.xaml.cs b/FFXIV_TexTools/Views/ModPack/Wizard/WizardPageControl.xaml.cs index 6b81e646..66bfd045 100644 --- a/FFXIV_TexTools/Views/ModPack/Wizard/WizardPageControl.xaml.cs +++ b/FFXIV_TexTools/Views/ModPack/Wizard/WizardPageControl.xaml.cs @@ -111,6 +111,7 @@ private void SetupUi() var options = new List(); foreach (var g in Data.Groups) { + if (g == null) continue; options.AddRange(g.Options); } OptionsList.ItemsSource = options; diff --git a/FFXIV_TexTools/Views/Models/ImportModelEditView.xaml b/FFXIV_TexTools/Views/Models/ImportModelEditView.xaml index dc4142c7..2768b43a 100644 --- a/FFXIV_TexTools/Views/Models/ImportModelEditView.xaml +++ b/FFXIV_TexTools/Views/Models/ImportModelEditView.xaml @@ -8,14 +8,15 @@ resx:Localization.Enabled="True" mc:Ignorable="d" Title="Model Editor" IsMinButtonEnabled="False" IsMaxRestoreButtonEnabled="False" WindowStartupLocation="CenterOwner" FontSize="14" ResizeMode="NoResize" - Width="640" - Height="680"> + Width="860" + Height="610"> + @@ -24,40 +25,181 @@ - - - - - + - - + + + + - + - + + + - + + + + + + + + + + + + @@ -70,7 +212,7 @@ - + - + - + @@ -129,6 +271,8 @@ + + @@ -138,47 +282,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -138,7 +143,7 @@ - + @@ -179,12 +184,14 @@ + + @@ -198,8 +205,7 @@ - - + @@ -212,7 +218,8 @@ - + + - +