Skip to content

Commit

Permalink
V0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
donkeyProgramming committed Jul 3, 2022
1 parent c91d09b commit 5c6bec8
Show file tree
Hide file tree
Showing 17 changed files with 250 additions and 54 deletions.
8 changes: 4 additions & 4 deletions AssetEditor/AssetEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationIcon>hnet.com-image (1).ico</ApplicationIcon>
<AssemblyName>AssetEditor v0.37</AssemblyName>
<AssemblyName>AssetEditor v0.38</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down Expand Up @@ -46,9 +46,9 @@
<PackageProjectUrl>https://github.com/olekristianhomelien/TheAssetEditor</PackageProjectUrl>
<RepositoryUrl>https://github.com/olekristianhomelien/TheAssetEditor</RepositoryUrl>
<RepositoryType>GIT</RepositoryType>
<AssemblyVersion>0.37.0.0</AssemblyVersion>
<FileVersion>0.37.0.0</FileVersion>
<PackageId>AssetEditor v0.37</PackageId>
<AssemblyVersion>0.38.0.0</AssemblyVersion>
<FileVersion>0.38.0.0</FileVersion>
<PackageId>AssetEditor v0.38</PackageId>
</PropertyGroup>

</Project>
13 changes: 7 additions & 6 deletions AssetEditor/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public MainViewModel(MenuBarViewModel menuViewModel, IServiceProvider servicePro

if (settingsService.CurrentSettings.LoadCaPacksByDefault)
{
//settingsService.CurrentSettings.CurrentGame = GameTypeEnum.Warhammer3;
//settingsService.CurrentSettings.SkipLoadingWemFiles = false;
settingsService.CurrentSettings.CurrentGame = GameTypeEnum.Warhammer3;
settingsService.CurrentSettings.SkipLoadingWemFiles = false;
var gamePath = settingsService.GetGamePathForCurrentGame();
if (gamePath != null)
{
Expand All @@ -113,9 +113,10 @@ public MainViewModel(MenuBarViewModel menuViewModel, IServiceProvider servicePro

//DefaultAnimationSlotTypeHelper.ExportAnimationDebugList(packfileService);

//var reportService = new FileListReportGenerator(packfileService, settingsService);
//var reportService = new Report.FileListReportGenerator(packfileService, settingsService);
//var comparePath = reportService.Create();
//reportService.CompareFiles(@"C:\Users\ole_k\AssetEditor\Reports\FileList\Warhammer III 1.1.0.0 PackFiles.csv", @"C:\Users\ole_k\AssetEditor\Reports\FileList\Warhammer III 1.2.0.0 Packfiles.csv");
//
//reportService.CompareFiles(@"C:\Users\ole_k\AssetEditor\Reports\FileList\Warhammer III 1.2.0.0 PackFiles.csv", @"C:\Users\ole_k\AssetEditor\Reports\FileList\Warhammer III 1.3.0.0 Packfiles.csv");

//;
//AnimationEditor.AnimationTransferTool.AnimationTransferTool_Debug.CreateFlyingSquig(this, toolFactory, packfileService);
Expand Down Expand Up @@ -164,7 +165,7 @@ public MainViewModel(MenuBarViewModel menuViewModel, IServiceProvider servicePro
//AnimMetaBatchProcessor processor = new AnimMetaBatchProcessor();
//processor.BatchProcess(_packfileService, schemaManager, "Warhammer");

AnimationEditor.SuperView.SuperViewViewModel_Debug.CreatePlaguebearer(this, toolFactory, packfileService);
//AnimationEditor.SuperView.SuperViewViewModel_Debug.CreatePlaguebearer(this, toolFactory, packfileService);
//CampaignAnimationCreator_Debug.CreateDamselEditor(this, toolFactory, packfileService);


Expand Down Expand Up @@ -199,7 +200,7 @@ public MainViewModel(MenuBarViewModel menuViewModel, IServiceProvider servicePro

//OpenFile(packfileService.FindFile(@"animations\database\battle\bin\animation_tables.animpack"));
//OpenFile(packfileService.FindFile(@"variantmeshes\wh_variantmodels\hu1\ksl\ksl_katarin\ksl_katarin_cloth_cloak_01.rigid_model_v2"));
//OpenFile(packfileService.FindFile(@"variantmeshes\wh_variantmodels\hu1\ksl\ksl_katarin\ksl_katarin_01.rigid_model_v2"));
OpenFile(packfileService.FindFile(@"variantmeshes\wh_variantmodels\hu1\ksl\ksl_katarin\ksl_katarin_01.rigid_model_v2"));
//OpenFile(packfileService.FindFile(@"variantmeshes\wh_variantmodels\hq3\nor\nor_war_mammoth\nor_war_mammoth_warshrine_01.rigid_model_v2"));

//OpenFile(packfileService.FindFile(@"variantmeshes\wh_variantmodels\bc1\tmb\tmb_warsphinx\tex\tmb_warsphinx_armour_01_base_colour.dds"));
Expand Down
6 changes: 6 additions & 0 deletions AssetEditor/ViewModels/MenuBarViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public class MenuBarViewModel
public ICommand GenerateFileListReportCommand { get; set; }
public ICommand CreateAnimPackWarhammer3Command { get; set; }
public ICommand CreateAnimPack3kCommand { get; set; }
public ICommand OpenAnimatedPropTutorialCommand { get; set; }
public ICommand OpenAnimPackTutorialCommand { get; set; }

public ObservableCollection<RecentPackFileItem> RecentPackFiles { get; set; } = new ObservableCollection<RecentPackFileItem>();

Expand Down Expand Up @@ -126,6 +128,10 @@ public MenuBarViewModel(IServiceProvider provider, PackFileService packfileServi
OpenWarhammer3PacksCommand = new RelayCommand(() => OpenGamePacks(GameTypeEnum.Warhammer3));
OpenTroyPacksCommand = new RelayCommand(() => OpenGamePacks(GameTypeEnum.Troy));


OpenAnimatedPropTutorialCommand = new RelayCommand(() => Process.Start(new ProcessStartInfo("cmd", $"/c start https://www.youtube.com/watch?v=b68hSHZ5raY") { CreateNoWindow = true }));
OpenAnimPackTutorialCommand = new RelayCommand(() => Process.Start(new ProcessStartInfo("cmd", $"/c start https://www.youtube.com/watch?v=b68hSHZ5raY&t=1904s") { CreateNoWindow = true }));

OpenHelpCommand = new RelayCommand(() => Process.Start(new ProcessStartInfo("cmd", $"/c start https://tw-modding.com/index.php/Tutorial:AssetEditor") { CreateNoWindow = true }));
OpenPatreonCommand = new RelayCommand(() => Process.Start(new ProcessStartInfo("cmd", $"/c start https://www.patreon.com/TheAssetEditor") { CreateNoWindow = true }));
OpenDiscordCommand = new RelayCommand(() => Process.Start(new ProcessStartInfo("cmd", $"/c start https://discord.gg/6Djf2sCczC") { CreateNoWindow = true }));
Expand Down
7 changes: 7 additions & 0 deletions AssetEditor/Views/MenuBarView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@
<MenuItem Header="Pose Creator" Command="{Binding MenuBar.OpenPropCreatorCommand}" IsEnabled="False" Visibility="Collapsed"/>
</MenuItem>

<MenuItem Header="Tutorials">
<MenuItem Header="[YT]Animated Prop" Command="{Binding MenuBar.OpenAnimatedPropTutorialCommand}"/>
<MenuItem Header="[YT]Custom Animation Pack" Command="{Binding MenuBar.OpenAnimPackTutorialCommand}"/>
<MenuItem Header="Manual" Command="{Binding MenuBar.OpenHelpCommand}"/>
<MenuItem Header="Discord" Command="{Binding MenuBar.OpenDiscordCommand}"/>
</MenuItem>

<MenuItem Header="About">
<MenuItem Header="Manual" Command="{Binding MenuBar.OpenHelpCommand}"/>
<MenuItem Header="Discord" Command="{Binding MenuBar.OpenDiscordCommand}"/>
Expand Down
4 changes: 3 additions & 1 deletion CommonControls/Services/PackFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ public void DeleteFolder(PackFileContainer pf, string folder)
throw new Exception("Can not delete folder inside CA pack file");

var folderLower = folder.ToLower();
var itemsToDelete = pf.FileList.Where(x => x.Key.StartsWith(folderLower));
var itemsToDelete = pf.FileList
.Where(x => string.Equals(Path.GetDirectoryName(x.Key), folder, StringComparison.InvariantCultureIgnoreCase))
.ToList();

Database.TriggerPackFileFolderRemoved(pf, folder);

Expand Down
8 changes: 7 additions & 1 deletion KitbasherEditor/ViewModels/MenuBarViews/ToolActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ public void ReduceMesh()
public void CreateLods()
{
var rootNode = _editableMeshResolver.GeEditableMeshRootNode();
var lodGenerationService = new LodGenerationService(_objectEditor);
lodGenerationService.CreateLodsForRootNode(rootNode);

return;


var lods = rootNode.GetLodNodes();

var firtLod = lods.First();
Expand All @@ -141,7 +147,7 @@ public void CreateLods()
for (int lodIndex = 0; lodIndex < lodsToGenerate.Count(); lodIndex++)
{
var deductionRatio = lodsToGenerate[lodIndex].LodReductionFactor;
var optimize = lodsToGenerate[lodIndex].OptimizeLod;
var optimize = lodsToGenerate[lodIndex].OptimizeLod_Alpha;

// We want to work on a clone of all the meshes
var clonedMeshes = meshList.Select(x => SceneNodeHelper.CloneNode(x)).ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public float LodReductionFactor
}

public int LodIndex { get => _node.LodValue; }
public bool OptimizeLod { get => _node.OptimizeLod; set => _node.OptimizeLod = value; }
public bool OptimizeLod_Alpha { get => _node.OptimizeLod_Alpha; set => _node.OptimizeLod_Alpha = value; }
public bool OptimizeLod_Vertex { get => _node.OptimizeLod_Vertex; set => _node.OptimizeLod_Vertex = value; }
public int PolygonCount { get => _node.GetAllModels(false).Sum(x=>x.Geometry.VertexCount() / 3); }
public int TextureCount { get => _node.GetAllModels(false).SelectMany(x => x.Material.GetAllTextures().Select(x => x.Path)).Distinct().Count(); }
public int MeshCount { get => _node.GetAllModels(false).Count(); }
Expand Down
5 changes: 3 additions & 2 deletions KitbasherEditor/Views/EditorViews/MainEditableNodeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@
<common:DataGridNumericColumn Header="Distance" Binding="{Binding CameraDistance, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
<common:DataGridNumericColumn Header="Qlt Level" Binding="{Binding QualityLvl, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
<common:DataGridNumericColumn Header="Reduction Factor" Binding="{Binding LodReductionFactor, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<DataGridCheckBoxColumn Header="Optimize" Binding="{Binding OptimizeLod, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />

<DataGridCheckBoxColumn Header="Merge Alpha" Binding="{Binding OptimizeLod_Alpha, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
<DataGridCheckBoxColumn Header="Merge Vertex" Binding="{Binding OptimizeLod_Vertex, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>

<common:DataGridNumericColumn Header="Polygons" Binding="{Binding PolygonCount}" IsReadOnly="True" />
<common:DataGridNumericColumn Header="Meshes" Binding="{Binding MeshCount}" IsReadOnly="True" />
<common:DataGridNumericColumn Header="Textures" Binding="{Binding TextureCount}" IsReadOnly="True" />
Expand Down
58 changes: 52 additions & 6 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ Planned V0.35:
Kill schama manager code
Check for lod count when loading textures -> Warning for textures missing lods
Icon for which attributes in a metatag that the superview uses
SoundMeta_v2

' ,SoundMeta_v2
98kkkkkk

Fix Mount Editor Editor for wh2
Frags from more games
Expand Down Expand Up @@ -150,8 +150,10 @@ V0.37
Start making unit tests...

Meta file issue = https://discord.com/channels/373745291289034763/795235087352201226/982699359550443530

Matched combat for wh3

8atched combat for wh3


Show warnig when openin CA animpack, about not datacoring this file!
Make it eaiser to understand, animpack editor
frg extention when making wh3 animpack bin
Expand All @@ -160,10 +162,54 @@ V0.37
Creaet Shortcut files!
multiple editors
open vmd in kitbasher - all referebces
UV tools
Improve lod - remove all tiny meshes

Lod - split into two vertex and alpha. Only convert animated4 => 2!

V0.38
----------------------------
Improve the update / welcome screen
Welcome screen
Update screen
Open vmd and ws in kitbash editor
Shortcut files
SuperView
AnimationTransfer
KitbashEditor
Shotcuts for kitbash tools
Fix button for timeline
Compute texture usage
AnimPack fixes

Match combat decoding for wh3
Fix the "." bug in mesh reduction view
Deleting folders does not work. Generate ws model, delete material folder. Files not added back

Filter animations in anim transfer tool
When saving animmeta, make it all pop into anim where is and remove saving question
* Tutorial toolbar
* ws model generation
* Lod issue
Hide skeleton for animated props
Different colours for animated prop skeletons
Redo scale functionalty for animated prop
Effect_v11 and transform in metadatafactory. SHould use interface

V0.38
----------------------------
Features:
* Added "tutorial" toolbar

BugFixes:
* Animated prop scale issue - still bugs related to this. Imitating the game is hard!
* Generate ws model bug - Much better at reusing and fixed a few minor bugs
* Generte Lod bug - Added two flags instead of just one. Combine alpha and combine mesh
* Generte Lod bug - Fixed bug related to static meshes
* Fixed bug related to deleting folders

V0.36
----
V0.37
----------------------------
Features:
* Lod Generation now follow CA optimization rules
* Improved mesh overview found under the "Editable model" node in the kitbash editor. The information is read only in the LOD node now
Expand Down
8 changes: 6 additions & 2 deletions View3D/Animation/MetaData/MetaDataFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ IMetaDataInstance CreateAnimatedProp(IAnimatedPropMeta animatedPropMeta)
var skeleton = new GameSkeleton(skeletonFile, propPlayer);
var animFile = AnimationFile.Create(animationPath);
var clip = new AnimationClip(animFile, skeleton);
loadedNode.ForeachNodeRecursive((node) =>
{
if (node is SceneNode selectable)
selectable.ScaleMult = animatedPropMeta.Scale;
});
loadedNode.ScaleMult = animatedPropMeta.Scale;
//clip.ScaleAnimation(animatedPropMeta.Scale);

var animationRule = new CopyRootTransform(_rootSkeleton, animatedPropMeta.BoneId, animatedPropMeta.Position, new Quaternion(animatedPropMeta.Orientation));

Expand All @@ -171,7 +175,7 @@ IMetaDataInstance CreateAnimatedProp(IAnimatedPropMeta animatedPropMeta)

var skeletonSceneNode = new SkeletonNode(_componentManager, new SimpleSkeletonProvider(skeleton));
skeletonSceneNode.NodeColour = Color.Yellow;

skeletonSceneNode.ScaleMult = animatedPropMeta.Scale;
loadedNode.AddObject(skeletonSceneNode);

return new AnimatedPropInstance(loadedNode, propPlayer);
Expand Down
2 changes: 1 addition & 1 deletion View3D/Commands/Object/ReduceMeshCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override void ExecuteCommand()

foreach (var meshNode in _meshList)
{
var originalMesh = meshNode.Geometry as MeshObject;
var originalMesh = meshNode.Geometry;
var reducedMesh = MeshOptimizerService.CreatedReducedCopy(originalMesh, _factor);
meshNode.Geometry = reducedMesh;
_originalGeometry.Add(originalMesh);
Expand Down
8 changes: 6 additions & 2 deletions View3D/SceneNodes/Rmv2LodNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public class Rmv2LodNode : GroupNode
public float LodReductionFactor { get; set; } = -1;
public bool AllowCombiningOfModelsForLodGeneration { get; set; } = false;
public int LodValue { get; set; }
public bool OptimizeLod { get; set; } = false;
public bool OptimizeLod_Alpha { get; set; } = false;
public bool OptimizeLod_Vertex { get; set; } = false;

public Rmv2LodNode(string name, int lodIndex, float? cameraDistance=null) : base(name)
{
Expand All @@ -20,7 +21,10 @@ public Rmv2LodNode(string name, int lodIndex, float? cameraDistance=null) : base
AllowCombiningOfModelsForLodGeneration = false;

if (lodIndex >= 2)
OptimizeLod = true;
{
OptimizeLod_Alpha = true;
OptimizeLod_Vertex = true;
}
}

public List<Rmv2MeshNode> GetAllModels(bool onlyVisible)
Expand Down
10 changes: 5 additions & 5 deletions View3D/SceneNodes/SkeletonNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public void Render(RenderEngineComponent renderEngine, Matrix parentWorld)

if (IsVisible && skeleton != null/* && _animationProvider.IsActive*/)
{
_lineRenderer.Clear();

_lineRenderer.Clear();
for (int i = 0; i < skeleton.BoneCount; i++)
{
float scale = SkeletonScale;
Expand All @@ -72,13 +71,14 @@ public void Render(RenderEngineComponent renderEngine, Matrix parentWorld)
}

var boneMatrix = skeleton.GetAnimatedWorldTranform(i);
_lineRenderer.AddCube(Matrix.CreateScale(scale) * Matrix.CreateScale(0.05f) * boneMatrix * parentWorld, drawColour);
_lineRenderer.AddCube(Matrix.CreateScale(scale) * Matrix.CreateScale(0.05f) * boneMatrix * Matrix.CreateScale(ScaleMult) * parentWorld, drawColour);

var parentIndex = skeleton.GetParentBoneIndex(i);
if (parentIndex != -1)
{
var parentBoneMatrix = skeleton.GetAnimatedWorldTranform(parentIndex);
_lineRenderer.AddLine(Vector3.Transform(boneMatrix.Translation, parentWorld), Vector3.Transform(parentBoneMatrix.Translation, parentWorld));
var currentBoneMatrix = boneMatrix * Matrix.CreateScale(ScaleMult);
var parentBoneMatrix = skeleton.GetAnimatedWorldTranform(parentIndex) * Matrix.CreateScale(ScaleMult);
_lineRenderer.AddLine(Vector3.Transform(currentBoneMatrix.Translation, parentWorld), Vector3.Transform(parentBoneMatrix.Translation, parentWorld));
}
}

Expand Down
Loading

0 comments on commit 5c6bec8

Please sign in to comment.