mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Ghost frames fix plus undo redo system
This commit is contained in:
parent
591b176924
commit
b0a965e0b2
163 changed files with 948 additions and 214 deletions
|
@ -46,11 +46,15 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void LoadAnimation(AnimationDef animationDef)
|
||||
{
|
||||
animationDef.RunPostLoadOperations();
|
||||
Debug.Log("Loaded AnimationDef: " + animationDef.defName);
|
||||
|
||||
|
||||
Workspace.animationDef = animationDef;
|
||||
animationDef.Initialize();
|
||||
Workspace.isDirty = true;
|
||||
|
||||
Workspace.Instance.ClearHistory();
|
||||
Workspace.Instance.MakeDirty();
|
||||
AnimationController.Instance.MakeDirty();
|
||||
|
||||
var animationDefCards = Resources.FindObjectsOfTypeAll(typeof(AnimationDefCard)) as AnimationDefCard[];
|
||||
|
||||
|
@ -78,16 +82,8 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
Debug.Log("Saving AnimationDef: " + Workspace.animationDef.defName);
|
||||
|
||||
AnimationDef animationDef = Workspace.animationDef;
|
||||
|
||||
foreach (AnimationStage stage in animationDef.animationStages)
|
||||
{
|
||||
foreach (PawnAnimationClip clip in stage.animationClips)
|
||||
{
|
||||
clip.keyframes = clip.keyframes.OrderBy(x => x.atTick).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
AnimationDef animationDef = Workspace.animationDef.Copy();
|
||||
animationDef.RunPreSaveOperations();
|
||||
|
||||
Defs defs = new Defs();
|
||||
defs.animationDefs.Add(animationDef);
|
||||
|
@ -104,7 +100,7 @@ namespace RimWorldAnimationStudio
|
|||
// Add one stage, add one actor, add one clip, add one frame
|
||||
|
||||
Workspace.animationDef = new AnimationDef();
|
||||
Workspace.isDirty = true;
|
||||
Workspace.Instance.MakeDirty();
|
||||
|
||||
var animationDefCards = Resources.FindObjectsOfTypeAll(typeof(AnimationDefCard)) as GameObject[];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue