mirror of
https://github.com/4sval/FModel.git
synced 2026-04-15 05:56:19 -05:00
usable again
This commit is contained in:
parent
35a804cbc8
commit
79399e5db2
|
|
@ -1 +1 @@
|
|||
Subproject commit c1d74305a2ea139fea16abe31edd559645f96548
|
||||
Subproject commit 3b74a52bb943ffd3365b94d1fcadb05550ebfdaa
|
||||
|
|
@ -107,6 +107,7 @@ public class CreatorPackage : IDisposable
|
|||
case "FortChallengeBundleScheduleDefinition":
|
||||
case "FortWeaponMeleeDualWieldItemDefinition":
|
||||
case "FortDailyRewardScheduleTokenDefinition":
|
||||
case "FortCreativeWeaponRangedItemDefinition":
|
||||
case "FortCreativeRealEstatePlotItemDefinition":
|
||||
case "AthenaDanceItemDefinition_AdHocSquadsJoin_C":
|
||||
creator = _style switch
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@
|
|||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Export Folder's Packages Raw Data (.uasset)" Click="OnFolderExportClick">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
|
|
@ -494,6 +495,7 @@
|
|||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Export Raw Data (.uasset)" Command="{Binding DataContext.RightClickMenuCommand}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
|
|
|
|||
|
|
@ -84,14 +84,6 @@ public partial class MainWindow
|
|||
// await _threadWorkerView.Begin(cancellationToken =>
|
||||
// _applicationView.CUE4Parse.Extract(cancellationToken,
|
||||
// "FortniteGame/Content/Animation/Game/MainPlayer/Emotes/Acrobatic_Superhero/Emote_AcrobaticSuperhero_CMM.uasset"));
|
||||
#endif
|
||||
#if DEBUG
|
||||
// await _threadWorkerView.Begin(cancellationToken =>
|
||||
// _applicationView.CUE4Parse.Extract(cancellationToken,
|
||||
// "Hk_project/Content/Character/Drone/Mesh/SKM_Drone.uasset"));
|
||||
// await _threadWorkerView.Begin(cancellationToken =>
|
||||
// _applicationView.CUE4Parse.Extract(cancellationToken,
|
||||
// "Hk_project/Content/Animation/DRONE/B12_TestSpin360.uasset"));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ out vec2 fTexCoords;
|
|||
|
||||
void main()
|
||||
{
|
||||
float scale = 0.0075;
|
||||
float scale = 0.075;
|
||||
mat4 result;
|
||||
result[0] = vec4(scale, 0.0, 0.0, 0.0);
|
||||
result[1] = vec4(0.0, scale, 0.0, 0.0);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<ListBox x:Name="ImagesListBox" Grid.Row="0" SelectionMode="Extended" />
|
||||
<Separator Grid.Row="1" Style="{StaticResource CustomSeparator}" Tag="COMMANDS" />
|
||||
<Grid Grid.Row="2" Margin="0 0 0 10">
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="Images Per Row" VerticalAlignment="Center" Margin="0 0 10 0" />
|
||||
<Slider x:Name="SizeSlider" Grid.Row="0" Grid.Column="1" TickPlacement="None" AutoToolTipPlacement="BottomRight"
|
||||
IsMoveToPointEnabled="True" Minimum="2" Maximum="20" TickFrequency="1" MouseUp="Click_DrawPreview" Thumb.DragCompleted="DrawPreview"/>
|
||||
IsMoveToPointEnabled="True" Minimum="1" Maximum="20" TickFrequency="1" MouseUp="Click_DrawPreview" Thumb.DragCompleted="DrawPreview"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="Margin Between Images" VerticalAlignment="Center" Margin="0 0 10 0" />
|
||||
<Slider Grid.Row="2" Grid.Column="1" Value="{Binding ImageMergerMargin, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}"
|
||||
TickPlacement="None" AutoToolTipPlacement="BottomRight" IsMoveToPointEnabled="True" Minimum="0" Maximum="50" TickFrequency="1"
|
||||
|
|
@ -106,4 +106,4 @@
|
|||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</adonisControls:AdonisWindow>
|
||||
</adonisControls:AdonisWindow>
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ public partial class ImageMerger
|
|||
{
|
||||
maxWidth = curW + image.Width + margin;
|
||||
curH += lineMaxHeight + margin;
|
||||
if (curH > maxHeight)
|
||||
maxHeight = curH;
|
||||
|
||||
curW = 0;
|
||||
lineMaxHeight = 0;
|
||||
|
|
|
|||
|
|
@ -155,6 +155,82 @@
|
|||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Export Raw Data (.uasset)" Command="{Binding DataContext.RightClickMenuCommand}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Assets_Export_Data" />
|
||||
<Binding Path="SelectedItems" />
|
||||
</MultiBinding>
|
||||
</MenuItem.CommandParameter>
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource ExportIcon}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Save Properties (.json)" Command="{Binding DataContext.RightClickMenuCommand}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Assets_Save_Properties" />
|
||||
<Binding Path="SelectedItems" />
|
||||
</MultiBinding>
|
||||
</MenuItem.CommandParameter>
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource SaveIcon}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Save Texture (.png)" Command="{Binding DataContext.RightClickMenuCommand}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Assets_Save_Textures" />
|
||||
<Binding Path="SelectedItems" />
|
||||
</MultiBinding>
|
||||
</MenuItem.CommandParameter>
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource TextureIcon}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Save Model (.psk)" Command="{Binding DataContext.RightClickMenuCommand}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Assets_Save_Models" />
|
||||
<Binding Path="SelectedItems" />
|
||||
</MultiBinding>
|
||||
</MenuItem.CommandParameter>
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource ModelIcon}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Save Animation (.psa)" Command="{Binding DataContext.RightClickMenuCommand}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Assets_Save_Animations" />
|
||||
<Binding Path="SelectedItems" />
|
||||
</MultiBinding>
|
||||
</MenuItem.CommandParameter>
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource AnimationIcon}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Copy">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16" Height="16">
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ public abstract class Light : IDisposable
|
|||
1f, 1f, 0f,
|
||||
1f, -1f, 0
|
||||
};
|
||||
public string Name;
|
||||
public readonly FGuid Model;
|
||||
public readonly Texture Icon;
|
||||
public Transform Transform;
|
||||
|
|
@ -100,7 +99,6 @@ public abstract class Light : IDisposable
|
|||
|
||||
public void Render(Shader shader)
|
||||
{
|
||||
GL.Disable(EnableCap.DepthTest);
|
||||
GL.Disable(EnableCap.CullFace);
|
||||
|
||||
_vao.Bind();
|
||||
|
|
@ -112,7 +110,6 @@ public abstract class Light : IDisposable
|
|||
GL.DrawArrays(PrimitiveType.Triangles, 0, Indices.Length);
|
||||
|
||||
GL.Enable(EnableCap.CullFace);
|
||||
GL.Enable(EnableCap.DepthTest);
|
||||
}
|
||||
|
||||
public virtual void Render(int i, Shader shader)
|
||||
|
|
@ -124,7 +121,6 @@ public abstract class Light : IDisposable
|
|||
|
||||
public virtual void ImGuiLight()
|
||||
{
|
||||
SnimGui.Layout("Position");SnimGui.TooltipCopy(Transform.Matrix.Translation.ToString());
|
||||
SnimGui.Layout("Color");ImGui.PushID(1);
|
||||
ImGui.ColorEdit4("", ref Color, ImGuiColorEditFlags.NoAlpha);
|
||||
ImGui.PopID();SnimGui.Layout("Intensity");ImGui.PushID(2);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class PointLight : Light
|
|||
|
||||
public PointLight(FGuid model, Texture icon, UObject parent, UObject point, Transform transform) : base(model, icon, parent, point, transform)
|
||||
{
|
||||
if (!point.TryGetValue(out float radius, "SourceRadius", "AttenuationRadius"))
|
||||
if (!point.TryGetValue(out float radius, "AttenuationRadius", "SourceRadius"))
|
||||
radius = 1.0f;
|
||||
|
||||
radius *= Constants.SCALE_DOWN_RATIO;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class SpotLight : Light
|
|||
|
||||
public SpotLight(FGuid model, Texture icon, UObject parent, UObject spot, Transform transform) : base(model, icon, parent, spot, transform)
|
||||
{
|
||||
if (!spot.TryGetValue(out Attenuation, "SourceRadius", "AttenuationRadius"))
|
||||
if (!spot.TryGetValue(out Attenuation, "AttenuationRadius", "SourceRadius"))
|
||||
Attenuation = 1.0f;
|
||||
|
||||
Attenuation *= Constants.SCALE_DOWN_RATIO;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using CUE4Parse_Conversion.Animations;
|
||||
using CUE4Parse.UE4.Objects.Core.Math;
|
||||
|
||||
namespace FModel.Views.Snooper.Models.Animations;
|
||||
|
||||
|
|
|
|||
|
|
@ -230,15 +230,6 @@ public class Model : IDisposable
|
|||
public void UpdateMatrices(Options options)
|
||||
{
|
||||
UpdateMatrices();
|
||||
if (HasSkeleton && Skeleton.Anim != null)
|
||||
{
|
||||
for (int i = 0; i < options.Lights.Count; i++)
|
||||
{
|
||||
options.Lights[i].Transform = Skeleton.Anim.BoneTransforms[i][Skeleton.Anim.CurrentTime];
|
||||
options.Lights[i].UpdateMatrices();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var socket in Sockets)
|
||||
{
|
||||
foreach (var attached in socket.AttachedModels)
|
||||
|
|
@ -371,7 +362,6 @@ public class Model : IDisposable
|
|||
shader.SetUniform("uMorphTime", MorphTime);
|
||||
if (!outline)
|
||||
{
|
||||
if (HasSkeleton) Skeleton.SetUniform(shader);
|
||||
shader.SetUniform("uUvCount", UvCount);
|
||||
shader.SetUniform("uHasVertexColors", HasVertexColors);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public class Renderer : IDisposable
|
|||
}
|
||||
|
||||
{ // light pass
|
||||
var uNumLights = Math.Min(Options.Lights.Count, 150);
|
||||
var uNumLights = Math.Min(Options.Lights.Count, 100);
|
||||
_shader.SetUniform("uNumLights", ShowLights ? uNumLights : 0);
|
||||
|
||||
if (ShowLights)
|
||||
|
|
@ -178,13 +178,6 @@ public class Renderer : IDisposable
|
|||
if (Options.Models.ContainsKey(guid) || !original.TryConvert(out var mesh)) return;
|
||||
|
||||
Options.Models[guid] = new Model(original, mesh);
|
||||
foreach ((var name, var index) in Options.Models[guid].Skeleton.BonesIndexByName)
|
||||
{
|
||||
if (!Options.Models[guid].Skeleton.BonesTransformByIndex.TryGetValue(index, out var transform)) continue;
|
||||
|
||||
Options.Lights.Add(
|
||||
new PointLight(guid, Options.Icons["pointlight"], original, original, transform) { Name = name});
|
||||
}
|
||||
Options.SelectModel(guid);
|
||||
SetupCamera(Options.Models[guid].Box);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public class Shader : IDisposable
|
|||
_uniformsLocation.Add(name, location);
|
||||
if (location == -1)
|
||||
{
|
||||
// throw new Exception($"{name} uniform not found on shader.");
|
||||
throw new Exception($"{name} uniform not found on shader.");
|
||||
}
|
||||
}
|
||||
return location;
|
||||
|
|
|
|||
|
|
@ -159,7 +159,9 @@ public class SnimGui
|
|||
for (int i = 0; i < s.Renderer.Options.Lights.Count; i++)
|
||||
{
|
||||
var light = s.Renderer.Options.Lights[i];
|
||||
var id = $"{light.Name}##{i}";
|
||||
var id = s.Renderer.Options.TryGetModel(light.Model, out var lightModel) ? lightModel.Name : "None";
|
||||
|
||||
id += $"##{i}";
|
||||
if (ImGui.TreeNode(id) && ImGui.BeginTable(id, 2))
|
||||
{
|
||||
s.Renderer.Options.SelectModel(light.Model);
|
||||
|
|
@ -342,7 +344,8 @@ Snooper aims to give an accurate preview of models, materials, skeletal animatio
|
|||
_saver.Value = model.TrySave(out _saver.Label, out _saver.Path);
|
||||
s.WindowShouldFreeze(false);
|
||||
}
|
||||
ImGui.BeginDisabled(!model.HasSkeleton);
|
||||
ImGui.BeginDisabled(true);
|
||||
// ImGui.BeginDisabled(!model.HasSkeleton);
|
||||
if (ImGui.Selectable("Animate"))
|
||||
{
|
||||
s.Renderer.Options.AnimateMesh(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user