- Fixed a bug which would cause keyframes to be pasted incorrectly in the later stages of an animation after loading an existing file
This commit is contained in:
AbstractConcept 2023-01-12 22:55:47 -06:00
parent ab53ed284f
commit 648acb325f
57 changed files with 74 additions and 68 deletions

View file

@ -175,8 +175,7 @@ namespace RimWorldAnimationStudio
public void OnPostLoad()
{
foreach (PawnAnimationClip clip in AnimationClips)
{ clip.OnPostLoad(); }
}
}
}

View file

@ -195,9 +195,17 @@ namespace RimWorldAnimationStudio
public int GetOwningActorID()
{
if (Workspace.animationDef == null) return -1;
if (Workspace.animationDef == null)
{ Debug.Log("Cannot get actor ID - the AnimationDef is invalid"); return -1; }
return Workspace.GetCurrentAnimationStage().AnimationClips.IndexOf(this);
foreach (AnimationStage stage in Workspace.animationDef.animationStages)
{
if (stage.AnimationClips.Contains(this))
{ return stage.AnimationClips.IndexOf(this); }
}
Debug.Log("Cannot get actor ID - animation clip has been orphaned");
return -1;
}
public void AddPawnKeyframe()