Skip to content

Commit

Permalink
Resolved merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainSticky committed Sep 13, 2024
2 parents 066273f + 01c21fd commit 275858f
Show file tree
Hide file tree
Showing 46 changed files with 305 additions and 842 deletions.
29 changes: 29 additions & 0 deletions Anamnesis/Actor/Converters/ExtendedWeaponToSubModelConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// © Anamnesis.
// Licensed under the MIT license.

namespace Anamnesis.Actor.Converters;

using Anamnesis.Memory;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

[ValueConversion(typeof(ExtendedWeaponMemory), typeof(WeaponSubModelMemory))]
public class ExtendedWeaponToSubModelConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is ExtendedWeaponMemory extendedWeaponMemory)
{
return extendedWeaponMemory.SubModel;
}

return DependencyProperty.UnsetValue;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
5 changes: 3 additions & 2 deletions Anamnesis/Actor/DefaultCharacterFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Anamnesis.Actor;

using Anamnesis.Files;
using Anamnesis.Memory;
using System.Numerics;

public static class DefaultCharacterFile
{
Expand Down Expand Up @@ -42,7 +43,7 @@ public static class DefaultCharacterFile
MainHand = new CharacterFile.WeaponSave()
{
Color = Color.Black,
Scale = Vector.One,
Scale = Vector3.One,
ModelSet = 301,
ModelBase = 31,
ModelVariant = 1,
Expand All @@ -51,7 +52,7 @@ public static class DefaultCharacterFile
OffHand = new CharacterFile.WeaponSave()
{
Color = Color.Black,
Scale = Vector.One,
Scale = Vector3.One,
ModelSet = 301,
ModelBase = 31,
ModelVariant = 1,
Expand Down
5 changes: 3 additions & 2 deletions Anamnesis/Actor/Extensions/INpcBaseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

namespace Anamnesis.Actor;

using System;
using Anamnesis.Files;
using Anamnesis.GameData;
using Anamnesis.GameData.Excel;
using Anamnesis.Memory;
using Anamnesis.Services;
using System;
using System.Numerics;

public static class INpcBaseExtensions
{
Expand Down Expand Up @@ -182,7 +183,7 @@ private static CharacterFile ToFile(this INpcAppearance appearance)
CharacterFile.WeaponSave save = new CharacterFile.WeaponSave();

save.Color = Color.White;
save.Scale = Vector.One;
save.Scale = Vector3.One;
save.ModelSet = item.ModelSet;
save.ModelBase = item.ModelBase;
save.ModelVariant = item.ModelVariant;
Expand Down
8 changes: 3 additions & 5 deletions Anamnesis/Actor/Pages/ActionPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
</Grid>


<Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Click="OnBlendAnimation" IsEnabled="{Binding AnimationService.BlendLocked, Converter={StaticResource NotConverter}}" Style="{StaticResource TransparentButton}">
<Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Click="OnBlendAnimation" IsEnabled="{Binding Actor.Animation.BlendLocked, Converter={StaticResource NotConverter}}" Style="{StaticResource TransparentButton}">
<XivToolsWpf:TextBlock Key="Character_Action_AnimationBlend"/>
</Button>

Expand Down Expand Up @@ -409,8 +409,7 @@
Grid.Column="0"
Style="{StaticResource Label}" />

<ToggleButton Grid.Row="0" Grid.Column="1" Height="20" Style="{StaticResource TransparentIconToggleButton}" IsEnabled="{Binding GposeService.IsGpose}" IsChecked="{Binding PoseService.FreezeWorldPosition}" BorderThickness="1" Padding="0" Margin="0"
Visibility="{Binding IsValidWeapon, Converter={StaticResource B2V}}">
<ToggleButton Grid.Row="0" Grid.Column="1" Height="20" Style="{StaticResource TransparentIconToggleButton}" IsEnabled="{Binding GposeService.IsGpose}" IsChecked="{Binding PoseService.FreezeWorldPosition}" BorderThickness="1" Padding="0" Margin="0">

<ToggleButton.ToolTip>
<XivToolsWpf:TextBlock Key="Character_Action_GlobalFreezeWorldPositionsTooltip"/>
Expand All @@ -424,8 +423,7 @@
Grid.Column="0"
Style="{StaticResource Label}" />

<ToggleButton Grid.Row="1" Grid.Column="1" Height="20" Style="{StaticResource TransparentIconToggleButton}" IsEnabled="{Binding GposeService.IsGpose}" IsChecked="{Binding AnimationService.SpeedControlEnabled}" BorderThickness="1" Padding="0" Margin="0"
Visibility="{Binding IsValidWeapon, Converter={StaticResource B2V}}">
<ToggleButton Grid.Row="1" Grid.Column="1" Height="20" Style="{StaticResource TransparentIconToggleButton}" IsEnabled="{Binding GposeService.IsGpose}" IsChecked="{Binding AnimationService.SpeedControlEnabled}" BorderThickness="1" Padding="0" Margin="0">
<fa:IconBlock Icon="Stopwatch" FontSize="10"/>
</ToggleButton>

Expand Down
3 changes: 1 addition & 2 deletions Anamnesis/Actor/Pages/PosePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@

<CheckBox Margin="3,0,6,0"
IsEnabled="{Binding GposeService.IsGpose}"
IsChecked="{Binding PoseService.FreezeWorldPosition}"
Visibility="{Binding IsValidWeapon, Converter={StaticResource B2V}}">
IsChecked="{Binding PoseService.FreezeWorldPosition}">

<ToggleButton.ToolTip>
<XivToolsWpf:TextBlock Key="Character_Action_GlobalFreezeWorldPositionsTooltip"/>
Expand Down
11 changes: 10 additions & 1 deletion Anamnesis/Actor/Pages/PosePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace Anamnesis.Actor.Pages;
using System.Windows.Input;
using System.Windows.Media.Media3D;
using XivToolsWpf;
using CmQuaternion = Anamnesis.Memory.Quaternion;
using XivToolsWpf.Math3D.Extensions;
using CmQuaternion = System.Numerics.Quaternion;

/// <summary>
/// Interaction logic for CharacterPoseView.xaml.
Expand Down Expand Up @@ -367,17 +368,25 @@ private async Task ImportPose(bool selectionOnly, PoseFile.Mode mode, bool doFac

if (poseFile.IsPreDTPoseFile() && !this.Skeleton.HasPreDTFace)
{
// Old pose, and new face. Warn, load as EW expression if OK.
doPreDtExpressionPoseModeOnOK = true;
}
else if (!poseFile.IsPreDTPoseFile() && this.Skeleton.HasPreDTFace)
{
// New pose and old face. Warn, load as DT expression if OK.
dialogMsgKey = "Pose_WarningExpresionNewOnOld";
}
else if (poseFile.IsPreDTPoseFile() && this.Skeleton.HasPreDTFace)
{
// Old pose and old face. Don't warn, load as EW expression.
showDialog = false;
doPreDtExpressionPoseModeOnOK = true;
}
else
{
// New pose and new face. Don't warn. Everything is OK.
showDialog = false;
}

if(showDialog)
{
Expand Down
21 changes: 0 additions & 21 deletions Anamnesis/Actor/Posing/Extensions/PointExtensions.cs

This file was deleted.

42 changes: 0 additions & 42 deletions Anamnesis/Actor/Posing/Extensions/QuaternionExtensions.cs

This file was deleted.

41 changes: 0 additions & 41 deletions Anamnesis/Actor/Posing/Extensions/VectorExtensions.cs

This file was deleted.

9 changes: 5 additions & 4 deletions Anamnesis/Actor/Posing/Views/Pose3DView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

namespace Anamnesis.Actor.Views;

using PropertyChanged;
using Serilog;
using System;
using System.ComponentModel;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Media3D;
using PropertyChanged;
using Serilog;
using XivToolsWpf;
using XivToolsWpf.Math3D.Extensions;
using Colors = System.Windows.Media.Colors;

/// <summary>
Expand All @@ -36,7 +37,7 @@ public Pose3DView()

this.CameraRotaion = new RotateTransform3D();
QuaternionRotation3D camRot = new QuaternionRotation3D();
camRot.Quaternion = CameraService.Instance.Camera?.Rotation3d ?? Quaternion.Identity;
camRot.Quaternion = CameraService.Instance.Camera?.Rotation3d.ToMedia3DQuaternion() ?? Quaternion.Identity;
this.CameraRotaion.Rotation = camRot;
this.CameraPosition = new TranslateTransform3D();
Transform3DGroup transformGroup = new Transform3DGroup();
Expand Down Expand Up @@ -184,7 +185,7 @@ private async Task UpdateCamera()
this.Skeleton.ReadTranforms();

// TODO: allow the user to rotate camera with the mouse instead
this.CameraRotation = CameraService.Instance.Camera.Rotation3d;
this.CameraRotation = CameraService.Instance.Camera.Rotation3d.ToMedia3DQuaternion();

// Apply camera rotation
QuaternionRotation3D rot = (QuaternionRotation3D)this.CameraRotaion.Rotation;
Expand Down
25 changes: 5 additions & 20 deletions Anamnesis/Actor/Posing/Views/PoseMatrixView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,7 @@
ItemsSource="{Binding HairBones}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" />
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

Expand Down Expand Up @@ -943,10 +940,7 @@
ItemsSource="{Binding MetBones}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" />
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

Expand All @@ -968,10 +962,7 @@
<ItemsControl Grid.Column="1" ItemsSource="{Binding TopBones}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" />
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

Expand Down Expand Up @@ -1014,10 +1005,7 @@
ItemsSource="{Binding MainHandBones}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" />
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

Expand All @@ -1039,10 +1027,7 @@
<ItemsControl Grid.Column="1" ItemsSource="{Binding OffHandBones}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" />
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

Expand Down
6 changes: 3 additions & 3 deletions Anamnesis/Actor/Posing/Visuals/BoneTargetVisual3d.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

namespace Anamnesis.Posing.Visuals;

using Anamnesis.Actor;
using Anamnesis.Actor.Views;
using System;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using Anamnesis.Actor;
using Anamnesis.Actor.Views;
using XivToolsWpf.Meida3D;
using XivToolsWpf.Math3D;

public class BoneTargetVisual3d : ModelVisual3D, IDisposable
{
Expand Down
Loading

0 comments on commit 275858f

Please sign in to comment.