Skip to content

Commit

Permalink
Release 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
donkeyProgramming committed May 23, 2021
1 parent 65001f2 commit d09430c
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 106 deletions.
68 changes: 20 additions & 48 deletions ActiveTodoList.txt
Original file line number Diff line number Diff line change
@@ -1,66 +1,38 @@
Feature list:
Kitbash editor:
Tools:
[DONE]Convert face selection to vertex
[DONE]Duplicate selected faces
[DONE]Extract selected faces to new object

[DONE]Generate lods
Ui ratio setting values

[DONE]Remapping skeleton does not update the skeleton getting names from, causing crashes in some cases
[DONE]Change animation skeleton
Undo for animation mapping

[DONE]Handle large models with n lods
Validate logic before save
Validate tool
[DONE]Change animation vertex type (downgrade, make sure it works in validation)
Combining all items in a group should remove the group
[DONE]Rename group ui
Combining all items in a group should remove the group

Pivot:
Edit
Display

General:
[DONE]Open from file
[DONE]Small popup when undoing stuff
set all not ediable to readonly ui
[DONE]Lock for edit
Waiting mouse when doing command
Profile grow selection
Remove animation invert by fixing veiw matrix
Delete undo history
Select vertex with mouse click
Make sure textures actually work
Skelton with good descriptive names
[DONE]Make sure texture stuff works
Save packfile cleanup edited
Save packfile handle refs to open editors and memory streams?
All uis should spawn at the center
[DONE]Test with empty settings
[DONE]Create "developer" settings

[DONE]Default to warhammer 2 for game
[DONE]How to handle assets for single publiush
[DONE]New packfile -> Set as main editable file
[DONE]Option->OPen log folder
[DONE]Pack file extention on save
Closing packfile need to close all open windoes
Open material files
Directory copy name
Bounding box calculations
Changing animation for duplicate goes boom. Undo for mapping needed

UI:
Fix attachement points buttons
Fix skeleton buttons

General:
TreeView:
[DONE]Dont always rebuild treeview! Save, new file
[DONE]save as dialog (create folder)
[DONE]duplicate file
Create new file => VMD, XML, TXT
Right click rmv2 model files => Edit

Expand All @@ -71,10 +43,6 @@ Feature list:

3d Preview tool:
Make one...

Text editor:

Axis size

Known bugs:
[DONE]Select face, then swap to vertex mode, need to call update before draw error
Expand Down Expand Up @@ -134,7 +102,6 @@ Known bugs:

Ensure all components is removed when exiting
* When looking for files, search ca last -> textures, meshes
* Undo for mapping
* Loading advance vmds
* Bondingbox display
* boundingbox recalc
Expand All @@ -148,11 +115,9 @@ Ensure all components is removed when exiting
* Sometimes undo for vertex movement does not work
* splitting repanse removes parts
* Quality of life changes for skeleton remapping tool
- Undo
- Save thingy actually working
- Duplicate mesh teaking stuff from, so skeleton names does not change for duplicated meshes
* Unsaved changes, do you want to exit?
* Bounding box recalc
* When playing, attach items to props
* Saving mapping does not work when loading it back in
* Converte to weighted 4 vertex type
Expand All @@ -161,11 +126,8 @@ Ensure all components is removed when exiting

Quality of life:
Flip mesh
Remove slots and slot folders
Hotkey names
Skeleton information view
Snap mesh to skeleteon when mapping
Undo mapping
Improved ws model generation (Facncy mode)
about box - Dont break eula
Save taxturepaths with slash other way
Expand Down Expand Up @@ -201,38 +163,48 @@ Animation tool:
// ---------------------


BmiToolCommand

Attach to vertex


Extract new mesh from selection

Enter works on prompts
Dropdown for search
Mouse focus on search for browser
Skeletonbone highligerr
Hotkey descriptions


Remapping vmd tool?
Generic viewer

bone mapper:
Show bones?
Fit skeleton auto scale?
Always show breath first
// ----------------------------------------------

WsModel auto generate when possible
Wsmodel make editable context menu

auto merge meshes that can be merged

[DONE]Key to only view selected
[DONE]Shift to add to selection
[DONE]Extract mesh from group context menu
[DONE]Remove from refslot context menu
[DONE]Wsmodel view toggle not working
[DONE]Escape to close open file browser
[DONE]Allow undo of mapping
[Done]Hotkey descriptions

[Done-ish]Fatness slider
[Done-ish]Fit skeleton on remapping
try names with _0 at when -1
[Done]increase size of view
Confirme text with mappings with -1
[Done]Make auto move more visible and actiate the checkbox
-> Mapping from self to self warning -> error at the bottow

add a way to multiselect items on model/vmd import
=> rigkt click context menu import


Fit to skeleton -> allows for -1 in mapping better



Expand Down
2 changes: 1 addition & 1 deletion 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.6</AssemblyName>
<AssemblyName>AssetEditor v0.7</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
4 changes: 2 additions & 2 deletions AssetEditor/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public MainViewModel(MenuBarViewModel menuViewModel, IServiceProvider servicePro
//var packFile = packfileService.FindFile(@"variantmeshes\wh_variantmodels\hu17\skv\skv_clan_rats\head\skv_clan_rats_head_04.rigid_model_v2");


//MountAnimationCreatorViewModel_Debug.CreateLionAndHu01b(this, toolFactory, packfileService);
KitbashEditor_Debug.CreateSlayerHead(this, toolFactory, packfileService);
MountAnimationCreatorViewModel_Debug.CreateLionAndHu01b(this, toolFactory, packfileService);
//KitbashEditor_Debug.CreateSlayerHead(this, toolFactory, packfileService);


//var editorView = toolFactory.CreateEditorViewModel<MountAnimationCreatorViewModel>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:KitbasherEditor.Views.EditorViews"
mc:Ignorable="d"
Title="AnimatedBlendIndexRemappingWindow" Height="450" Width="800">
Title="AnimatedBlendIndexRemappingWindow" Height="600" Width="1200">
<DockPanel LastChildFill="True">

<DockPanel DockPanel.Dock="Bottom" LastChildFill="False">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public AnimatedBlendIndexRemappingWindow()
private void OkButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = true;



Close();
}

Expand Down
7 changes: 7 additions & 0 deletions KitbasherEditor/Views/EditorViews/BmiWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ public partial class BmiWindow : Window
public BmiWindow()
{
InitializeComponent();
this.Deactivated += Window_Deactivated;
}

private void Window_Deactivated(object sender, EventArgs e)
{
Window window = (Window)sender;
window.Topmost = true;
}
}
}
86 changes: 32 additions & 54 deletions View3D/Commands/Object/RemapBoneIndexesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,86 +64,64 @@ protected override void ExecuteCommand()
_originalGeometry = _meshOwner.Geometry.Clone();
_originalSkeletonName = _meshOwner.MeshModel.ParentSkeletonName;

if (_moveMeshToFit)
FitMeshToSkeleton();

_meshOwner.Geometry.UpdateAnimationIndecies(_mapping);
_meshOwner.MeshModel.ParentSkeletonName = _newSkeletonName;
}

AnimationClip c = new AnimationClip();
c.DynamicFrames.Add(new AnimationClip.KeyFrame());

void FitMeshToSkeleton()
{
AnimationClip animationClip = new AnimationClip();
animationClip.DynamicFrames.Add(new AnimationClip.KeyFrame());

for (int i = 0; i < _currentSkeleton.BoneCount; i++)
{
c.DynamicFrames[0].Rotation.Add(Quaternion.Identity);
c.DynamicFrames[0].Position.Add(Vector3.Zero);
//animationClip.DynamicFrames[0].Rotation.Add(Quaternion.Identity);
//animationClip.DynamicFrames[0].Position.Add(Vector3.Zero);

c.RotationMappings.Add(new Filetypes.RigidModel.AnimationFile.AnimationBoneMapping(i));
c.TranslationMappings.Add(new Filetypes.RigidModel.AnimationFile.AnimationBoneMapping(i));
}

// for (int i = 0; i < _currentSkeleton.BoneCount; i++)
// _currentSkeleton.SetBoneTransform(i, Quaternion.Identity, Vector3.Zero, false);


for (int i = 0; i < _currentSkeleton.BoneCount; i++)
{

animationClip.DynamicFrames[0].Rotation.Add(_currentSkeleton.Rotation[i]);
animationClip.DynamicFrames[0].Position.Add(_currentSkeleton.Translation[i]);

animationClip.RotationMappings.Add(new Filetypes.RigidModel.AnimationFile.AnimationBoneMapping(i));
animationClip.TranslationMappings.Add(new Filetypes.RigidModel.AnimationFile.AnimationBoneMapping(i));
}

for (int i = 0; i < _currentSkeleton.BoneCount; i++)
{
var mappedIndex = _mapping.FirstOrDefault(x => x.OriginalValue == i);
if (mappedIndex != null)
{
var parentBoneId = _currentSkeleton.GetParentBone(i);
var parentBoneMapping = _mapping.FirstOrDefault(x => x.OriginalValue == parentBoneId);
if (parentBoneMapping == null && false)
{
var targetBoneWorldMatrix = _targetSkeleton.GetWorldTransform(mappedIndex.NewValue);
targetBoneWorldMatrix.Decompose(out var _, out var rot, out var trans);
//_currentSkeleton.SetBoneTransform(i, rot, trans, false);

c.DynamicFrames[0].Position[i] = trans;
c.DynamicFrames[0].Rotation[i] = rot;
}
else
{
c.DynamicFrames[0].Position[i] = _targetSkeleton.Translation[mappedIndex.NewValue];
c.DynamicFrames[0].Rotation[i] = _targetSkeleton.Rotation[mappedIndex.NewValue];

//_currentSkeleton.SetBoneTransform(i, _targetSkeleton.Rotation[mappedIndex.NewValue], _targetSkeleton.Translation[mappedIndex.NewValue], false);
//_currentSkeleton.SetBoneTransform(i, Quaternion.Identity, _targetSkeleton.Translation[mappedIndex.NewValue], false);
}
}
}

_currentSkeleton.RebuildSkeletonMatrix();



if (mappedIndex != null)
{
var parentBoneId = _currentSkeleton.GetParentBone(i);
var parentBoneMapping = _mapping.FirstOrDefault(x => x.OriginalValue == parentBoneId);
animationClip.DynamicFrames[0].Position[i] = _targetSkeleton.Translation[mappedIndex.NewValue];
animationClip.DynamicFrames[0].Rotation[i] = _targetSkeleton.Rotation[mappedIndex.NewValue];
}
}

MeshAnimationHelper meshAnimationHelper = new MeshAnimationHelper(_meshOwner, Matrix.Identity);
var animationFrame = _currentSkeleton.CreateAnimationFrame();
animationFrame = AnimationSampler.Sample(0, 0, _currentSkeleton, c);
_currentSkeleton.RebuildSkeletonMatrix();

MeshAnimationHelper meshAnimationHelper = new MeshAnimationHelper(_meshOwner, Matrix.Identity);
var animationFrame = AnimationSampler.Sample(0, 0, _currentSkeleton, animationClip);
_currentSkeleton.SetAnimationFrame(animationFrame);
//_scene.RootNode.AddObject(new SkeletonNode(_rl.Content, new TempSkelProv() { Skeleton = _currentSkeleton }, "NewSkelly"));

int vertexCount = _meshOwner.Geometry.VertexCount();
for (int i = 0; i < vertexCount; i++)
{

var vertTransform = meshAnimationHelper.GetVertexTransform(animationFrame, i);
_meshOwner.Geometry.TransformVertex(i, (vertTransform));
}

_meshOwner.Geometry.RebuildVertexBuffer();
_meshOwner.Geometry.UpdateAnimationIndecies(_mapping);
_meshOwner.MeshModel.ParentSkeletonName = _newSkeletonName;

}



protected override void UndoCommand()
{
_meshOwner.Geometry = _originalGeometry;
_meshOwner.MeshModel.ParentSkeletonName = _originalSkeletonName;
}
}
}
}

0 comments on commit d09430c

Please sign in to comment.