Bug fixes

- Fixed bug which cause body to skip around when body offsets were set
- Fixed bug where genital rotations were absolute rather than relative to body orientation
This commit is contained in:
AbstractConcept 2022-09-27 18:29:08 -05:00
parent 0e653f863a
commit 61c6c949d3
70 changed files with 26 additions and 21 deletions

View file

@ -87,6 +87,13 @@ namespace RimWorldAnimationStudio
raceOffset.SetOffset(offset);
}
public Vector3 GetFinalTransformOffset()
{
Vector3 offset = bodyTypeOffset.GetOffset(bodyType) + GetAlienRaceOffset();
return new Vector3(offset.x, offset.z, offset.y);
}
public void ValidateData()
{
bodyDefTypes = bodyDefTypes.Intersect(Tags.bodyDefTypes.Concat(CustomTags.bodyDefTypes))?.ToList();

View file

@ -59,8 +59,8 @@ namespace RimWorldAnimationStudio
if (Workspace.actorManipulationMode == ActorManipulationMode.Pan)
{
keyframe.bodyOffsetX = mousePosition.x - delta.x - Workspace.animationDef.actors[actorID].GetAlienRaceOffset().x;
keyframe.bodyOffsetZ = mousePosition.y - delta.y - Workspace.animationDef.actors[actorID].GetAlienRaceOffset().z;
keyframe.bodyOffsetX = mousePosition.x - delta.x - Workspace.animationDef.actors[actorID].GetFinalTransformOffset().x;
keyframe.bodyOffsetZ = mousePosition.y - delta.y - Workspace.animationDef.actors[actorID].GetFinalTransformOffset().y;
}
else if (Workspace.actorManipulationMode == ActorManipulationMode.Rotate)

View file

@ -151,7 +151,6 @@ namespace RimWorldAnimationStudio
string bodyType = alienRaceDef.isHumanoid ? actor.bodyType : "None";
Vector3 deltaPos = new Vector3(clip.BodyOffsetX.Evaluate(clipPercent), 0, clip.BodyOffsetZ.Evaluate(clipPercent));
deltaPos += actor.bodyTypeOffset.GetOffset(bodyType) + actor.GetAlienRaceOffset();
float bodyAngle = clip.BodyAngle.Evaluate(clipPercent);
float headAngle = clip.HeadAngle.Evaluate(clipPercent);
@ -177,14 +176,14 @@ namespace RimWorldAnimationStudio
Vector3 appendagePos = PawnUtility.AppendageOffsetAt(bodyType, bodyFacing);
float appendageRotation = clip.GenitalAngle.Evaluate(clipPercent);
actorBody.transform.position = bodyPos;
actorBody.transform.position = bodyPos + actor.GetFinalTransformOffset();
actorBody.transform.eulerAngles = new Vector3(0, 0, -bodyAngle);
actorBody.headRenderer.transform.localPosition = headPos;
actorBody.headRenderer.transform.eulerAngles = new Vector3(0, 0, -headAngle);
actorBody.appendageRenderer.transform.localPosition = new Vector3(appendagePos.x, appendagePos.z, 0f);
actorBody.appendageRenderer.transform.eulerAngles = new Vector3(0, 0, -appendageRotation);
actorBody.appendageRenderer.transform.localEulerAngles = new Vector3(0, 0, -appendageRotation);
actorBody.bodyRenderer.sprite = alienRaceDef.GetBodyTypeGraphic((CardinalDirection)bodyFacing, bodyType);
actorBody.headRenderer.sprite = alienRaceDef.isHumanoid ? alienRaceDef.GetHeadGraphic((CardinalDirection)headFacing) : null;

Binary file not shown.

View file

@ -115,7 +115,7 @@ MonoBehaviour:
m_MinSize: {x: 678, y: 492}
m_MaxSize: {x: 14001, y: 14042}
vertical: 0
controlID: 12962
controlID: 1188
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@ -140,7 +140,7 @@ MonoBehaviour:
m_MinSize: {x: 403, y: 492}
m_MaxSize: {x: 10001, y: 14042}
vertical: 1
controlID: 12963
controlID: 1189
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@ -165,7 +165,7 @@ MonoBehaviour:
m_MinSize: {x: 403, y: 221}
m_MaxSize: {x: 8003, y: 4021}
vertical: 0
controlID: 12964
controlID: 1190
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@ -398,7 +398,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: c6a4faffdaa4faff78a5faff9095ffff62fbffff6a3a0000463c0000323d00009a3f0000dc3f0000cc410000
m_ExpandedIDs: e0d2fffff4d2ffff92d3ffff62fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1115,9 +1115,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 20480000
m_LastClickedID: 18464
m_ExpandedIDs: 00000000fc470000fe4700000048000002480000044800001848000000ca9a3b
m_SelectedIDs: 22480000
m_LastClickedID: 18466
m_ExpandedIDs: 00000000fc470000fe4700000048000002480000044800001a48000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:

View file

@ -24,7 +24,7 @@ MonoBehaviour:
m_MinSize: {x: 678, y: 492}
m_MaxSize: {x: 14001, y: 14042}
vertical: 0
controlID: 12636
controlID: 1062
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
@ -141,7 +141,7 @@ MonoBehaviour:
m_MinSize: {x: 403, y: 492}
m_MaxSize: {x: 10001, y: 14042}
vertical: 1
controlID: 12600
controlID: 1063
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
@ -166,7 +166,7 @@ MonoBehaviour:
m_MinSize: {x: 403, y: 221}
m_MaxSize: {x: 8003, y: 4021}
vertical: 0
controlID: 12601
controlID: 1038
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
@ -224,7 +224,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: c6a4faffdaa4faff78a5faff9095ffff62fbffff6a3a0000463c0000323d00009a3f0000dc3f0000cc410000
m_ExpandedIDs: 62fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -998,9 +998,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 20480000
m_LastClickedID: 18464
m_ExpandedIDs: 00000000fc470000fe4700000048000002480000044800001848000000ca9a3b
m_SelectedIDs: 22480000
m_LastClickedID: 18466
m_ExpandedIDs: 00000000fc470000fe4700000048000002480000044800001a48000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:

Binary file not shown.

View file

@ -37,7 +37,6 @@ ScriptsOnlyBuild:
- UnityEditor.U2D.Animation.BoneGizmo
Unity.2D.Tilemap.Editor.dll:
- UnityEditor.Tilemaps.GridBrush
- UnityEditor.Tilemaps.GridBrushEditor
- UnityEditor.Tilemaps.GridPaintPaletteClipboard
- UnityEditor.Tilemaps.GridPaintPaletteWindow
- UnityEditor.Tilemaps.GridPaintingState

Binary file not shown.

View file

@ -124,7 +124,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 0.1
bundleVersion: 0.1.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0