Bug fixes

This commit is contained in:
AbstractConcept 2022-09-26 00:50:26 -05:00
parent 7e1680a7fb
commit 73f7e32e0c
69 changed files with 107 additions and 91 deletions

View file

@ -221,7 +221,7 @@ MonoBehaviour:
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 0
m_Interactable: 1
m_TargetGraphic: {fileID: 0}
m_FillRect: {fileID: 0}
m_HandleRect: {fileID: 4629009613275671144}

View file

@ -12899,7 +12899,7 @@ MonoBehaviour:
currentMessage: {fileID: 1308919825}
logMessagePrefab: {fileID: 7082774796440540818, guid: a29caea8e4b276d4c861e9eb083562fc,
type: 3}
maxMessages: 100
maxMessages: 500
--- !u!222 &1059017488
CanvasRenderer:
m_ObjectHideFlags: 0

View file

@ -41,6 +41,8 @@ namespace RimWorldAnimationStudio
int keyframePosition = 0;
keyframes[keyframes.Count - 1].tickDuration = 1;
for (int i = 0; i < keyframes.Count; i++)
{
PawnKeyframe keyframe = keyframes[i];
@ -84,8 +86,6 @@ namespace RimWorldAnimationStudio
keyframePosition += keyframe.tickDuration;
}
}
keyframes[keyframes.Count - 1].tickDuration = 1;
}
public override void ValidateData() { }

View file

@ -34,11 +34,6 @@ namespace RimWorldAnimationStudio
// Sort keyframes by atTick
foreach (PawnAnimationClip clip in animationClips)
{ clip.keyframes = clip.keyframes.OrderBy(x => x.atTick).ToList(); }
// Check if looping
stageWindowSize = stageWindowSize > 0 ? stageWindowSize : animationClips.Select(x => x.duration).Max();
int cycles = Mathf.CeilToInt(playTimeTicks / stageWindowSize);
isLooping = cycles > 1;
}
public bool MakeNew()

View file

@ -91,6 +91,7 @@ namespace RimWorldAnimationStudio
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
ActorBody actorBody = AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>()[Workspace.actorID];
PawnAnimationClip clip = Workspace.Instance.GetCurrentPawnAnimationClip();
string bodyType = actorBody.bodyType;
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
@ -110,6 +111,21 @@ namespace RimWorldAnimationStudio
{ raceOffsetZField.text = actor.GetAlienRaceOffset().z.ToString(); }
initiatorToggle.isOn = actor.initiator;
if (actor.requiredGender.Contains("Female"))
{ genderDropdown.SetValueWithoutNotify(0); }
else if (actor.requiredGender.Contains("Male"))
{ genderDropdown.SetValueWithoutNotify(2); }
else
{ genderDropdown.SetValueWithoutNotify(1); }
for (int i = 0; i < selectActorLayerDropdown.options.Count; i++)
{
if (selectActorLayerDropdown.options[i].text == clip.layer)
{ selectActorLayerDropdown.SetValueWithoutNotify(i); }
}
}
}
}

View file

@ -107,15 +107,13 @@ namespace RimWorldAnimationStudio
AnimationController.Instance.stageTick = keyframe.atTick.Value;
Workspace.actorID = actorID;
Workspace.keyframeID = keyframeID;
if (keyframe.atTick == 1)
{ return; }
interactable = true;
}
public override void OnDrag(PointerEventData eventData)
{
if (keyframe.atTick == 1)
{ value = 1; return; }
base.OnDrag(eventData);
AnimationController.Instance.stageTick = keyframe.atTick.Value;
@ -124,7 +122,8 @@ namespace RimWorldAnimationStudio
public void OnEndDrag(PointerEventData eventData)
{
interactable = false;
if (keyframe.atTick == 1)
{ value = 1; return; }
Workspace.Instance.RecordEvent("Keyframe tick");
}

View file

@ -361,21 +361,23 @@ namespace RimWorldAnimationStudio
public void RemovePawnKeyframe(int actorID, int keyframeID)
{
PawnKeyframe keyframe = Workspace.Instance.GetPawnKeyframe(actorID, keyframeID);
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[actorID];
if (keyframe != null && keyframe.atTick == 1)
{ Debug.LogWarning("Cannot delete key frame - the first key frame of an animation cannot be deleted"); return; }
if (keyframe == null || clip == null) return;
if (keyframe.atTick == 1)
{ Debug.LogWarning("Cannot delete key frame - the first key frame of an animation clip cannot be deleted"); return; }
if (clip.keyframes.Count <= 2)
{ Debug.LogWarning("Cannot delete key frame - an animation clip must have two or more keyframes"); return; }
if (keyframe != null)
{
animationTimelines.GetComponentsInChildren<AnimationTimeline>()[Workspace.actorID].RemovePawnKeyFrame(keyframe.keyframeID);
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[actorID];
clip.keyframes.Remove(keyframe);
clip.BuildSimpleCurves();
Workspace.Instance.RecordEvent("Keyframe deletion");
}
}
public void ToggleAnimation()
{
@ -453,8 +455,6 @@ namespace RimWorldAnimationStudio
{
foreach (PawnKeyframe keyframe in clip.keyframes)
{
if (keyframe.atTick == 1) continue;
keyframe.tickDuration = Mathf.RoundToInt(keyframe.tickDuration * scale);
keyframe.atTick = null;
}
@ -468,7 +468,13 @@ namespace RimWorldAnimationStudio
if (Workspace.animationDef == null) return;
if (int.TryParse(cyclesNormalField.text, out int cycles))
{ Workspace.animationDef.animationStages[Workspace.stageID].playTimeTicks = cycles * Workspace.StageWindowSize; }
{
Workspace.animationDef.animationStages[Workspace.stageID].playTimeTicks = cycles * Workspace.StageWindowSize;
Workspace.animationDef.animationStages[Workspace.stageID].isLooping = cycles > 1;
foreach(AnimationTimeline animationTimeline in animationTimelines.GetComponentsInChildren<AnimationTimeline>())
{ animationTimeline.InitiateUpdateOfGhostFrames(); }
}
Workspace.Instance.RecordEvent("Cycle count (normal)");
}
@ -477,8 +483,14 @@ namespace RimWorldAnimationStudio
{
if (Workspace.animationDef == null) return;
if (int.TryParse(cyclesFastField.text, out int cycles))
{ Workspace.animationDef.animationStages[Workspace.stageID].playTimeTicksQuick = cycles * Workspace.StageWindowSize; }
if (int.TryParse(cyclesFastField.text, out int fastCycles))
{
int.TryParse(cyclesNormalField.text, out int cycles);
if (fastCycles > cycles) fastCycles = cycles;
cyclesFastField.text = fastCycles.ToString();
Workspace.animationDef.animationStages[Workspace.stageID].playTimeTicksQuick = fastCycles * Workspace.StageWindowSize;
}
Workspace.Instance.RecordEvent("Cycle count (fast)");
}

View file

@ -88,7 +88,7 @@ namespace RimWorldAnimationStudio
foreach (string bodyType in allTags)
{
path = alienRaceDef.GetBodyTypeGraphicPath(facing, bodyType);
Debug.Log(path);
if (path != null && path != "")
{ alienRaceDef.SetBodyTypeGraphicPath(path, facing, bodyType); }
}

View file

@ -31,18 +31,12 @@ namespace RimWorldAnimationStudio
{ return -1; }
if (animationDef.animationStages[stageID].stageWindowSize < 0)
{ return animationDef.animationStages[stageID].animationClips.Select(x => x.duration).Max(); }
{ animationDef.animationStages[stageID].stageWindowSize = animationDef.animationStages[stageID].animationClips.Select(x => x.duration).Max(); }
return animationDef.animationStages[stageID].stageWindowSize;
}
}
public void Update()
{
//if (isDirty)
//{ TrackChanges(); }
}
public PawnKeyframe GetCurrentPawnKeyframe(bool makeKeyframe = false)
{
int stageTick = AnimationController.Instance.stageTick;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -21,7 +21,7 @@ MonoBehaviour:
m_ShowMode: 4
m_Title:
m_RootView: {fileID: 2}
m_MinSize: {x: 875, y: 542}
m_MinSize: {x: 875, y: 521}
m_MaxSize: {x: 10000, y: 10000}
m_Maximized: 1
--- !u!114 &2
@ -46,7 +46,7 @@ MonoBehaviour:
y: 0
width: 1920
height: 997
m_MinSize: {x: 875, y: 542}
m_MinSize: {x: 875, y: 521}
m_MaxSize: {x: 10000, y: 10000}
--- !u!114 &3
MonoBehaviour:
@ -112,10 +112,10 @@ MonoBehaviour:
y: 30
width: 1920
height: 947
m_MinSize: {x: 679, y: 492}
m_MaxSize: {x: 14002, y: 14042}
m_MinSize: {x: 678, y: 471}
m_MaxSize: {x: 14001, y: 14021}
vertical: 0
controlID: 4354
controlID: 12036
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@ -137,10 +137,10 @@ MonoBehaviour:
y: 0
width: 1524
height: 947
m_MinSize: {x: 403, y: 492}
m_MaxSize: {x: 10001, y: 14042}
m_MinSize: {x: 402, y: 471}
m_MaxSize: {x: 10000, y: 14021}
vertical: 1
controlID: 4355
controlID: 12037
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@ -162,10 +162,10 @@ MonoBehaviour:
y: 0
width: 1524
height: 648
m_MinSize: {x: 403, y: 221}
m_MaxSize: {x: 8003, y: 4021}
m_MinSize: {x: 402, y: 221}
m_MaxSize: {x: 8002, y: 4021}
vertical: 0
controlID: 4356
controlID: 12038
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@ -396,9 +396,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: f41cffff081dffffa61dffff62fbffff
m_SelectedIDs: 46450000
m_LastClickedID: 17734
m_ExpandedIDs: ac95feffa605ffffe808ffff0a09ffff3809ffff2a76ffffee94ffff8696ffffd29cffff46a4ffffcca5ffffeea5ffff1ca6ffff4cfbffffaa3a0000503c0000e63f000060440000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -458,9 +458,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 1.3961211, y: 0.5866932, z: -0.3834264}
m_Target: {x: 1077.5, y: 57.5, z: 0}
speed: 2
m_Value: {x: 37.5, y: 0, z: 0}
m_Value: {x: 1077.5, y: 57.5, z: 0}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -510,9 +510,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 2.3153484
m_Target: 829.6356
speed: 2
m_Value: 40.388737
m_Value: 829.6356
m_Ortho:
m_Target: 1
speed: 2
@ -1104,20 +1104,20 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Resources/Prefabs/RaceDialogPrefabs
- Assets/Resources/Prefabs
m_ViewMode: 1
m_StartGridSize: 67
m_LastFolders:
- Assets/Resources/Prefabs/RaceDialogPrefabs
- Assets/Resources/Prefabs
m_LastFoldersGridSize: 67
m_LastProjectPath: C:\UnityDev\rimworld-animation-studio
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 12260100
m_LastClickedID: 75282
m_ExpandedIDs: 000000000448000006480000084800000a4800000c480000f22501000c26010000ca9a3b
m_SelectedIDs: 28480000
m_LastClickedID: 18472
m_ExpandedIDs: 0000000006480000084800000a4800000c4800000e4800001e48000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1145,7 +1145,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 000000000448000006480000084800000a4800000c48000000ca9a3b
m_ExpandedIDs: 0000000006480000084800000a4800000c4800000e48000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1295,4 +1295,4 @@ MonoBehaviour:
m_PrefName: Preview_InspectorPreview
m_PreviewWindow: {fileID: 0}
m_LastInspectedObjectInstanceID: -1
m_LastVerticalScrollValue: 0
m_LastVerticalScrollValue: 100

View file

@ -21,10 +21,10 @@ MonoBehaviour:
y: 30
width: 1920
height: 947
m_MinSize: {x: 679, y: 492}
m_MaxSize: {x: 14002, y: 14042}
m_MinSize: {x: 678, y: 471}
m_MaxSize: {x: 14001, y: 14021}
vertical: 0
controlID: 4046
controlID: 11839
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
@ -138,10 +138,10 @@ MonoBehaviour:
y: 0
width: 1524
height: 947
m_MinSize: {x: 403, y: 492}
m_MaxSize: {x: 10001, y: 14042}
m_MinSize: {x: 402, y: 471}
m_MaxSize: {x: 10000, y: 14021}
vertical: 1
controlID: 4006
controlID: 11840
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
@ -163,10 +163,10 @@ MonoBehaviour:
y: 0
width: 1524
height: 648
m_MinSize: {x: 403, y: 221}
m_MaxSize: {x: 8003, y: 4021}
m_MinSize: {x: 402, y: 221}
m_MaxSize: {x: 8002, y: 4021}
vertical: 0
controlID: 4007
controlID: 11841
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
@ -224,7 +224,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: b46cffffc06cffff362601003e260100
m_ExpandedIDs: ac95feffa605ffffe808ffff0a09ffff3809ffff2a76ffffee94ffff8696ffffd29cffff46a4ffffcca5ffffeea5ffff1ca6ffff4cfbffffaa3a0000503c0000e63f000060440000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -306,16 +306,16 @@ MonoBehaviour:
m_ShowContextualTools: 0
m_WindowGUID: 352ee9c972596684b9fdf9db32bf21bf
m_Gizmos: 0
m_SceneIsLit: 0
m_SceneIsLit: 1
m_SceneLighting: 1
m_2DMode: 1
m_isRotationLocked: 0
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 37.5, y: 0, z: 0}
m_Target: {x: 1077.5, y: 57.5, z: 0}
speed: 2
m_Value: {x: 37.5, y: 0, z: 0}
m_Value: {x: 1077.5, y: 57.5, z: 0}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -328,7 +328,7 @@ MonoBehaviour:
m_SceneViewState:
showFog: 1
showMaterialUpdate: 0
showSkybox: 0
showSkybox: 1
showFlares: 1
showImageEffects: 1
showParticleSystems: 1
@ -365,9 +365,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 40.388737
m_Target: 829.6356
speed: 2
m_Value: 40.388737
m_Value: 829.6356
m_Ortho:
m_Target: 1
speed: 2
@ -987,20 +987,20 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Resources/Prefabs/RaceDialogPrefabs
- Assets/Resources/Prefabs
m_ViewMode: 1
m_StartGridSize: 67
m_LastFolders:
- Assets/Resources/Prefabs/RaceDialogPrefabs
- Assets/Resources/Prefabs
m_LastFoldersGridSize: 67
m_LastProjectPath: C:\UnityDev\rimworld-animation-studio
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 12260100
m_LastClickedID: 75282
m_ExpandedIDs: 000000000448000006480000084800000a4800000c480000f22501000c26010000ca9a3b
m_SelectedIDs: 28480000
m_LastClickedID: 18472
m_ExpandedIDs: 0000000006480000084800000a4800000c4800000e4800001e48000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1028,7 +1028,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 000000000448000006480000084800000a4800000c48000000ca9a3b
m_ExpandedIDs: 0000000006480000084800000a4800000c4800000e48000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1053,8 +1053,8 @@ MonoBehaviour:
m_Icon: {fileID: 0}
m_ResourceFile:
m_ListAreaState:
m_SelectedInstanceIDs: 48260100
m_LastClickedInstanceID: 75336
m_SelectedInstanceIDs: 46450000
m_LastClickedInstanceID: 17734
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c6230000303a0000063a0000a83d00005c66000000870000f8860000004a00004a4600000c43000000000000
m_RenameOverlay:
@ -1203,5 +1203,5 @@ MonoBehaviour:
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_PreviewWindow: {fileID: 0}
m_LastInspectedObjectInstanceID: 75336
m_LastVerticalScrollValue: 0
m_LastInspectedObjectInstanceID: 17734
m_LastVerticalScrollValue: 100

Binary file not shown.

View file

@ -1 +1 @@
{"m_ExpandedPrefabGameObjectFileIDs":[4658118913435815158,2751111744579094145,8359461402257861397],"m_ExpandedSceneGameObjectInstanceIDs":[],"m_ScrollY":0.0,"m_LastClickedFileID":3845252506739069817,"m_LastClickedInstanceID":0}
{"m_ExpandedPrefabGameObjectFileIDs":[4658118913435815158,2751111744579094145,8359461402257861397],"m_ExpandedSceneGameObjectInstanceIDs":[],"m_ScrollY":0.0,"m_LastClickedFileID":4658118913435815158,"m_LastClickedInstanceID":0}

View file

@ -1 +1 @@
{"cameraMode":{"drawMode":0,"name":"Shaded","section":"Shading Mode"},"sceneLighting":true,"audioPlay":false,"sceneViewState":{"showFog":true,"showMaterialUpdate":false,"showSkybox":true,"showFlares":true,"showImageEffects":true,"showParticleSystems":true},"in2DMode":true,"pivot":{"x":1.3961211442947388,"y":0.5866932272911072,"z":-0.38342639803886416},"rotation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0},"size":2.3153483867645265,"orthographic":true}
{"cameraMode":{"drawMode":0,"name":"Shaded","section":"Shading Mode"},"sceneLighting":true,"audioPlay":false,"sceneViewState":{"showFog":true,"showMaterialUpdate":false,"showSkybox":true,"showFlares":true,"showImageEffects":true,"showParticleSystems":true},"in2DMode":true,"pivot":{"x":1077.5,"y":57.5,"z":0.0},"rotation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0},"size":829.6356201171875,"orthographic":true}