From 8ade56a21e368764b2f09592f01a55a1492b647f Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Sat, 1 Jul 2023 23:06:33 +0200 Subject: [PATCH 01/18] Worked on reworking the animation system --- .../Editor/navMeshDebug.vtsdef.vtmeta | 7 +- .../Utility/PreDepth.vtsdef.vtmeta | 7 +- Engine/Scripts/Volt-ScriptCore.dll | 4 +- Engine/Scripts/Volt-ScriptCore.pdb | 4 +- .../Volt-ScriptCore/Source/Volt/Math/Mathf.cs | 20 +- Project/Assets/New Textdokument.txt | 0 .../AG_NewAnimationGraph.vtanimgraph | 818 +++++++++++++++ .../AG_NewAnimationGraph.vtanimgraph.vtmeta | 4 + Project/Assets/Player Test/Player.cs | 112 +++ Project/Assets/Player Test/Player.cs.vtmeta | 4 + .../PlayerTestGym/Layers/layer_0.vtlayer | 948 ++++++++++++++++++ .../PlayerTestGym/New Scene.vtscene | 2 + .../PlayerTestGym/New Scene.vtscene.vtmeta | 4 + .../Assets/Player Test/playerCharacter_sk.fbx | 3 + .../Player Test/playerCharacter_sk.fbx.vtmeta | 4 + .../Player Test/playerCharacter_sk.vtmat | 3 + .../playerCharacter_sk.vtmat.vtmeta | 4 + .../Player Test/playerCharacter_sk.vtmesh | 3 + .../playerCharacter_sk.vtmesh.vtmeta | 4 + .../Player Test/playerCharacter_sk.vtsk | 3 + .../playerCharacter_sk.vtsk.vtmeta | 4 + .../Assets/Player Test/playerIdle_anim.fbx | 3 + .../Player Test/playerIdle_anim.fbx.vtmeta | 4 + .../Assets/Player Test/playerIdle_anim.vtanim | 3 + .../Player Test/playerIdle_anim.vtanim.vtmeta | 4 + .../Assets/Player Test/player_inAir_anim.fbx | 3 + .../Player Test/player_inAir_anim.fbx.vtmeta | 4 + .../Player Test/player_inAir_anim.vtanim | 3 + .../player_inAir_anim.vtanim.vtmeta | 4 + .../Assets/Player Test/player_jumpUp_anim.fbx | 3 + .../Player Test/player_jumpUp_anim.fbx.vtmeta | 4 + .../Player Test/player_jumpUp_anim.vtanim | 3 + .../player_jumpUp_anim.vtanim.vtmeta | 4 + .../Player Test/player_landing_anim.fbx | 3 + .../player_landing_anim.fbx.vtmeta | 4 + .../Player Test/player_landing_anim.vtanim | 3 + .../player_landing_anim.vtanim.vtmeta | 4 + .../Assets/Player Test/player_run_anim.vtanim | 3 + .../Player Test/player_run_anim.vtanim.vtmeta | 4 + .../Assets/Player Test/player_sprint_anim.fbx | 3 + .../Player Test/player_sprint_anim.fbx.vtmeta | 4 + .../Player Test/player_sprint_anim.vtanim | 3 + .../player_sprint_anim.vtanim.vtmeta | 4 + .../Nodes/Animation/BaseAnimationNodes.cpp | 6 +- .../GraphKey/Nodes/Animation/BlendNodes.cpp | 32 +- .../Nodes/Animation/SequenceNodes.cpp | 11 +- .../Nodes/Animation/StateMachineNodes.cpp | 14 +- .../src/Navigation/Core/NavigationSystem.cpp | 117 ++- .../src/Sandbox/Utility/EditorUtilities.cpp | 8 +- .../src/Sandbox/Utility/EditorUtilities.h | 2 +- .../AnimationGraph/AnimationGraphPanel.cpp | 14 +- .../Sandbox/Window/AssetBrowser/AssetItem.cpp | 4 +- .../Window/AssetBrowser/DirectoryItem.cpp | 8 +- .../AssetBrowser/EditorAssetRegistry.cpp | 8 +- .../Volt/Animation/AnimationController.cpp | 17 +- .../Volt/Animation/AnimationStateMachine.cpp | 30 +- .../Volt/Animation/AnimationStateMachine.h | 8 +- .../Asset/Animation/AnimationGraphAsset.cpp | 8 +- .../Asset/Animation/AnimationGraphAsset.h | 15 +- .../Importers/AnimationGraphImporter.cpp | 11 +- .../Volt/src/Volt/Rendering/SceneRenderer.cpp | 31 +- .../Volt/Scripting/Mono/MonoScriptGlue.cpp | 12 +- 62 files changed, 2209 insertions(+), 186 deletions(-) delete mode 100644 Project/Assets/New Textdokument.txt create mode 100644 Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph create mode 100644 Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta create mode 100644 Project/Assets/Player Test/Player.cs create mode 100644 Project/Assets/Player Test/Player.cs.vtmeta create mode 100644 Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer create mode 100644 Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene create mode 100644 Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta create mode 100644 Project/Assets/Player Test/playerCharacter_sk.fbx create mode 100644 Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta create mode 100644 Project/Assets/Player Test/playerCharacter_sk.vtmat create mode 100644 Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta create mode 100644 Project/Assets/Player Test/playerCharacter_sk.vtmesh create mode 100644 Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta create mode 100644 Project/Assets/Player Test/playerCharacter_sk.vtsk create mode 100644 Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta create mode 100644 Project/Assets/Player Test/playerIdle_anim.fbx create mode 100644 Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta create mode 100644 Project/Assets/Player Test/playerIdle_anim.vtanim create mode 100644 Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta create mode 100644 Project/Assets/Player Test/player_inAir_anim.fbx create mode 100644 Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta create mode 100644 Project/Assets/Player Test/player_inAir_anim.vtanim create mode 100644 Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta create mode 100644 Project/Assets/Player Test/player_jumpUp_anim.fbx create mode 100644 Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta create mode 100644 Project/Assets/Player Test/player_jumpUp_anim.vtanim create mode 100644 Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta create mode 100644 Project/Assets/Player Test/player_landing_anim.fbx create mode 100644 Project/Assets/Player Test/player_landing_anim.fbx.vtmeta create mode 100644 Project/Assets/Player Test/player_landing_anim.vtanim create mode 100644 Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta create mode 100644 Project/Assets/Player Test/player_run_anim.vtanim create mode 100644 Project/Assets/Player Test/player_run_anim.vtanim.vtmeta create mode 100644 Project/Assets/Player Test/player_sprint_anim.fbx create mode 100644 Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta create mode 100644 Project/Assets/Player Test/player_sprint_anim.vtanim create mode 100644 Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta diff --git a/Engine/Engine/Shaders/Definitions/Editor/navMeshDebug.vtsdef.vtmeta b/Engine/Engine/Shaders/Definitions/Editor/navMeshDebug.vtsdef.vtmeta index 398e682b3..6ce9e2833 100644 --- a/Engine/Engine/Shaders/Definitions/Editor/navMeshDebug.vtsdef.vtmeta +++ b/Engine/Engine/Shaders/Definitions/Editor/navMeshDebug.vtsdef.vtmeta @@ -1,7 +1,8 @@ Metadata: - assetHandle: 11344793791434321691 - filePath: Engine/Shaders/Definitions/Editor/navMeshDebug.vtsdef + assetHandle: 7583228775342091226 + filePath: Engine/Shaders/Definitions/Editor/navmeshDebug.vtsdef type: 64 Dependencies: - 13639218079433149575 - - 3437710173954916273 \ No newline at end of file + - 3437710173954916273 + ? Properties \ No newline at end of file diff --git a/Engine/Engine/Shaders/Definitions/Utility/PreDepth.vtsdef.vtmeta b/Engine/Engine/Shaders/Definitions/Utility/PreDepth.vtsdef.vtmeta index 7aa545330..8efbfc283 100644 --- a/Engine/Engine/Shaders/Definitions/Utility/PreDepth.vtsdef.vtmeta +++ b/Engine/Engine/Shaders/Definitions/Utility/PreDepth.vtsdef.vtmeta @@ -1,7 +1,8 @@ Metadata: - assetHandle: 6333113496356666499 - filePath: Engine/Shaders/Definitions/Utility/preDepth.vtsdef + assetHandle: 17145172393171821217 + filePath: Engine/Shaders/Definitions/Utility/PreDepth.vtsdef type: 64 Dependencies: - 18032802909032779550 - - 12161986101142080347 \ No newline at end of file + - 12161986101142080347 + ? Properties \ No newline at end of file diff --git a/Engine/Scripts/Volt-ScriptCore.dll b/Engine/Scripts/Volt-ScriptCore.dll index 5d5e543f2..1f4f36862 100644 --- a/Engine/Scripts/Volt-ScriptCore.dll +++ b/Engine/Scripts/Volt-ScriptCore.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f74a276126d5fea569325bf8280548658a002c4a32e2a9df11cbfcc28ae5a300 -size 101888 \ No newline at end of file +oid sha256:d7ef4f764ede3d846169e20a881adc302cc4bfae7171cee38d1c8aedb5d92386 +size 101888 diff --git a/Engine/Scripts/Volt-ScriptCore.pdb b/Engine/Scripts/Volt-ScriptCore.pdb index 3242799ca..3e58ce7df 100644 --- a/Engine/Scripts/Volt-ScriptCore.pdb +++ b/Engine/Scripts/Volt-ScriptCore.pdb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c9e98e6b52d0692a8457901ca47c2bc17cf5da3fb24b09db3675245552f48320 -size 47856 +oid sha256:72e6208079961a2e8f5fe919a58c29fa010c2b96598799a966b02c933f39bee7 +size 48132 diff --git a/Engine/Volt-ScriptCore/Source/Volt/Math/Mathf.cs b/Engine/Volt-ScriptCore/Source/Volt/Math/Mathf.cs index 9bdd986fb..f8978c90c 100644 --- a/Engine/Volt-ScriptCore/Source/Volt/Math/Mathf.cs +++ b/Engine/Volt-ScriptCore/Source/Volt/Math/Mathf.cs @@ -77,6 +77,10 @@ public static float Clamp(float value, float min, float max) public static float Abs(float value) => Math.Abs(value); public static int Abs(int value) => Math.Abs(value); + public static float Pow(float value, float power) => (float)Math.Pow(value, power); + + + public static Vector3 Abs(Vector3 value) { @@ -84,8 +88,22 @@ public static Vector3 Abs(Vector3 value) } public static float Lerp(float p1, float p2, float t) => Interpolate.Linear(p1, p2, t); + //lerp angle + public static float LerpAngle(float p1, float p2, float t) + { + float num = Repeat(p2 - p1, 360.0f); + if (num > 180.0f) + { + num -= 360.0f; + } + return p1 + num * Clamp(t, 0.0f, 1.0f); + } + + public static float Repeat(float t, float length) => t - Floor(t / length) * length; + + public static float BounceOut(float p1, float p2, float t, float duration) => Interpolate.BounceOut(t, p1, p2, duration); - public static float BounceIn(float p1, float p2, float t, float duration) + public static float BounceIn(float p1, float p2, float t, float duration) { return p2 - BounceOut(p1, p2, duration - t, duration); } diff --git a/Project/Assets/New Textdokument.txt b/Project/Assets/New Textdokument.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph new file mode 100644 index 000000000..a18cf812c --- /dev/null +++ b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph @@ -0,0 +1,818 @@ +AnimationGraph: + state: "{\"nodes\":{\"node:14478923545599575399\":{\"location\":{\"x\":312,\"y\":-6}},\"node:17301805690779624226\":{\"location\":{\"x\":244,\"y\":198}},\"node:17868484199422907988\":{\"location\":{\"x\":488,\"y\":198}}},\"selection\":[\"node:17301805690779624226\"],\"view\":{\"scroll\":{\"x\":-68,\"y\":-184},\"zoom\":1}}" + skeleton: 10080715167332384675 + Graph: + Nodes: + - id: 17868484199422907988 + type: OutputPoseNode + state: "{\"location\":{\"x\":488,\"y\":198}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 15529003614232630594 + outputs: + [] + - id: 17301805690779624226 + type: StateMachineNode + state: "{\"location\":{\"x\":244,\"y\":198}}" + nodeSpecific: + StateMachine: + name: Main State Machine + editorState: "{\"nodes\":{\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}},\"node:5853113754576418241\":{\"location\":{\"x\":323,\"y\":378}}},\"selection\":[\"node:5853113754576418241\"],\"view\":{\"scroll\":{\"x\":93,\"y\":-43},\"zoom\":1}}" + skeletonHandle: 10080715167332384675 + States: + - name: Entry + isEntry: true + isAny: false + editorState: "{\"location\":{\"x\":-28,\"y\":58}}" + id: 3665464684957549364 + pinId: 12902782254156092098 + pinId2: 14258103125107884637 + Transitions: + - 15724984446624483268 + - name: Any + isEntry: false + isAny: true + editorState: "{\"location\":{\"x\":243,\"y\":14}}" + id: 2878473185253437245 + pinId: 5269647802711289343 + pinId2: 10660380611335689211 + Transitions: + - 7924813067403359603 + - 16741418222055495425 + - name: Idle + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":-12,\"y\":174}}" + id: 3681991280272765136 + pinId: 2894418162706173443 + pinId2: 13804721687551360234 + Transitions: + - 15724984446624483268 + - 2885412559387363311 + - 1559816839792901889 + - 10274687952614952111 + skeletonHandle: 10080715167332384675 + Graph: + Nodes: + - id: 14536892748128745780 + type: OutputPoseNode + state: "{\"location\":{\"x\":392,\"y\":214}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 14105913789575905908 + outputs: + [] + - id: 16221844271113134588 + type: SequencePlayerNode + state: "{\"location\":{\"x\":34,\"y\":210}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 10580947816370530482 + data: 16802240511195054919 + - name: Loop + id: 123450497769363306 + data: true + - name: Speed + id: 8336879108405323436 + data: 1 + - name: Apply Root Motion + id: 11090811506985761982 + data: false + outputs: + - name: Output + id: 3099520766036006655 + Links: + - id: 9662818189681954966 + output: 3099520766036006655 + input: 14105913789575905908 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + Events: + [] + - name: Run + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":-12,\"y\":314}}" + id: 17362013720582400113 + pinId: 7817618331721326880 + pinId2: 9430452183247307602 + Transitions: + - 2885412559387363311 + - 1559816839792901889 + skeletonHandle: 10080715167332384675 + Graph: + Nodes: + - id: 13182824102293636283 + type: OutputPoseNode + state: "{\"location\":{\"x\":56,\"y\":-26}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 2434102622300016631 + outputs: + [] + - id: 16767149402094149869 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-302,\"y\":-14}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 10031653943577889520 + data: 1087306084089571470 + - name: Loop + id: 3012088715339929536 + data: true + - name: Speed + id: 14780628045392394899 + data: 1 + - name: Apply Root Motion + id: 11703811859076888858 + data: false + outputs: + - name: Output + id: 3273018439142468825 + Links: + - id: 14411293871932759808 + output: 3273018439142468825 + input: 2434102622300016631 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + Events: + [] + - name: StartJump + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":195,\"y\":154}}" + id: 4959086316646373199 + pinId: 10295643871073811521 + pinId2: 16267254125773997612 + Transitions: + - 7924813067403359603 + - 13269834706927116307 + skeletonHandle: 10080715167332384675 + Graph: + Nodes: + - id: 12596166692664476774 + type: OutputPoseNode + state: "{\"location\":{\"x\":392,\"y\":214}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 5861817840940044885 + outputs: + [] + - id: 15180245410823459525 + type: SequencePlayerNode + state: "{\"location\":{\"x\":82,\"y\":210}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 16262223745919603949 + data: 9874085243310133722 + - name: Loop + id: 12070280934059552080 + data: false + - name: Speed + id: 4387072234620904110 + data: 1 + - name: Apply Root Motion + id: 11149968965430831207 + data: false + outputs: + - name: Output + id: 17182538447330918633 + Links: + - id: 7423060123162994628 + output: 17182538447330918633 + input: 5861817840940044885 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - name: InAir + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":355,\"y\":254}}" + id: 16788735106587868172 + pinId: 12345812838632408803 + pinId2: 13133448969614549550 + Transitions: + - 16741418222055495425 + - 4770872081588975154 + - 13269834706927116307 + skeletonHandle: 10080715167332384675 + Graph: + Nodes: + - id: 10375549879072757522 + type: OutputPoseNode + state: "{\"location\":{\"x\":168,\"y\":118}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 7993111188786885993 + outputs: + [] + - id: 72906687750208911 + type: SequencePlayerNode + state: "{\"location\":{\"x\":24,\"y\":222}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 10867885091214013952 + data: 16379139790018569206 + - name: Loop + id: 9146347772134529951 + data: true + - name: Speed + id: 15267910550696299263 + data: 1 + - name: Apply Root Motion + id: 11935242591066892335 + data: false + outputs: + - name: Output + id: 11680064864603595249 + Links: + - id: 1881370631314135528 + output: 11680064864603595249 + input: 7993111188786885993 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - name: Land + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":323,\"y\":378}}" + id: 5853113754576418241 + pinId: 17490356693278968614 + pinId2: 9356542095790036010 + Transitions: + - 4770872081588975154 + - 10274687952614952111 + skeletonHandle: 10080715167332384675 + Graph: + Nodes: + - id: 7972067113546953247 + type: OutputPoseNode + state: "{\"location\":{\"x\":184,\"y\":134}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 14476689878508423546 + outputs: + [] + - id: 6123819316360548125 + type: SequencePlayerNode + state: "{\"location\":{\"x\":72,\"y\":178}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 15254946406601266251 + data: 13719070777493897150 + - name: Loop + id: 1916361062164798703 + data: false + - name: Speed + id: 2070241052447209235 + data: 100 + - name: Apply Root Motion + id: 8106797449584285687 + data: false + outputs: + - name: Output + id: 3721232241028352589 + Links: + - id: 15423302180500718702 + output: 3721232241028352589 + input: 14476689878508423546 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + Transitions: + - id: 15724984446624483268 + fromState: 3665464684957549364 + toState: 3681991280272765136 + hasExitTime: false + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 3623410152680394859 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 5330600848135263334 + data: false + outputs: + [] + Links: + [] + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + Events: + [] + - id: 2885412559387363311 + fromState: 3681991280272765136 + toState: 17362013720582400113 + hasExitTime: false + shouldBlend: true + blendTime: 0 + Graph: + Nodes: + - id: 11731338212989462854 + type: TransitionOutputNode + state: "{\"location\":{\"x\":120,\"y\":118}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 12462159291396020858 + outputs: + [] + - id: 5005875258605301911 + type: GetParameterFloat + state: "{\"location\":{\"x\":-34,\"y\":230}}" + nodeSpecific: + {} + parameterId: 14724677624567781970 + inputs: + [] + outputs: + - name: Get + id: 18275963554927969773 + data: 0 + - id: 2811085383675707505 + type: GreaterThanNodeFloat + state: "{\"location\":{\"x\":-104,\"y\":128}}" + nodeSpecific: + {} + inputs: + - name: A + id: 10872483824638756943 + - name: B + id: 9457170580670463800 + data: 0.100000001 + outputs: + - name: Result + id: 5036612592930820697 + data: false + Links: + - id: 7146303879928486359 + output: 18275963554927969773 + input: 10872483824638756943 + - id: 12870605454712754654 + output: 5036612592930820697 + input: 12462159291396020858 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + Events: + [] + - id: 1559816839792901889 + fromState: 17362013720582400113 + toState: 3681991280272765136 + hasExitTime: false + shouldBlend: true + blendTime: 0 + Graph: + Nodes: + - id: 4353185446893683017 + type: TransitionOutputNode + state: "{\"location\":{\"x\":216,\"y\":118}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 3827972964461496599 + outputs: + [] + - id: 8401262388928910263 + type: GetParameterFloat + state: "{\"location\":{\"x\":-34,\"y\":214}}" + nodeSpecific: + {} + parameterId: 14724677624567781970 + inputs: + [] + outputs: + - name: Get + id: 6726792203143162984 + data: 0 + - id: 7227732160314416901 + type: LessThanNodeFloat + state: "{\"location\":{\"x\":142,\"y\":252}}" + nodeSpecific: + {} + inputs: + - name: A + id: 12187121267027445680 + - name: B + id: 13814791514744881313 + data: 0.100000001 + outputs: + - name: Result + id: 738529439542813677 + data: false + Links: + - id: 15904718365980337666 + output: 6726792203143162984 + input: 12187121267027445680 + - id: 11862470462851682223 + output: 738529439542813677 + input: 3827972964461496599 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + Events: + [] + - id: 7924813067403359603 + fromState: 2878473185253437245 + toState: 4959086316646373199 + hasExitTime: false + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 11062424893867846629 + type: TransitionOutputNode + state: "{\"location\":{\"x\":280,\"y\":166}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 8334824368944772969 + outputs: + [] + - id: 8824535931127518854 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-61,\"y\":134}}" + nodeSpecific: + {} + parameterId: 1479367072072825218 + inputs: + [] + outputs: + - name: Get + id: 15363129655624191644 + data: false + - id: 17282162711169094560 + type: AndNode + state: "{\"location\":{\"x\":88,\"y\":124}}" + nodeSpecific: + {} + inputs: + - name: A + id: 10132646139662137838 + - name: B + id: 11743468572293499736 + outputs: + - name: Result + id: 11010260275052348966 + data: false + - id: 13484925391025310362 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-201,\"y\":54}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 2365682830968910570 + data: false + Links: + - id: 8924923132298007691 + output: 15363129655624191644 + input: 11743468572293499736 + - id: 17403562062281532048 + output: 11010260275052348966 + input: 8334824368944772969 + - id: 1399652018617867899 + output: 2365682830968910570 + input: 10132646139662137838 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - id: 16741418222055495425 + fromState: 2878473185253437245 + toState: 16788735106587868172 + hasExitTime: false + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 15319280053520300675 + type: TransitionOutputNode + state: "{\"location\":{\"x\":184,\"y\":326}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 17511013795618814745 + outputs: + [] + - id: 2365174270754884041 + type: GetParameterBoolean + state: "{\"location\":{\"x\":222,\"y\":186}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 9256431525144238956 + data: false + - id: 5203943386703931362 + type: NotNode + state: "{\"location\":{\"x\":152,\"y\":268}}" + nodeSpecific: + {} + inputs: + - name: Value + id: 8850764303543511227 + outputs: + - name: Result + id: 7683167445072757152 + data: false + Links: + - id: 11848749067612066567 + output: 9256431525144238956 + input: 8850764303543511227 + - id: 17677665878225347876 + output: 7683167445072757152 + input: 17511013795618814745 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - id: 4770872081588975154 + fromState: 16788735106587868172 + toState: 5853113754576418241 + hasExitTime: false + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 6339755224688244053 + type: TransitionOutputNode + state: "{\"location\":{\"x\":168,\"y\":134}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 13931501205392875816 + outputs: + [] + - id: 4169333806093001417 + type: GetParameterBoolean + state: "{\"location\":{\"x\":46,\"y\":122}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 15125974727342423453 + data: false + Links: + - id: 1046760825910924135 + output: 15125974727342423453 + input: 13931501205392875816 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - id: 10274687952614952111 + fromState: 5853113754576418241 + toState: 3681991280272765136 + hasExitTime: true + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 12685031745682105689 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 14146025927140979864 + data: true + outputs: + [] + Links: + [] + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - id: 13269834706927116307 + fromState: 4959086316646373199 + toState: 16788735106587868172 + hasExitTime: true + shouldBlend: false + blendTime: 1 + Graph: + Nodes: + - id: 15364653686485468151 + type: TransitionOutputNode + state: "{\"location\":{\"x\":248,\"y\":54}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 353687032276741306 + data: true + outputs: + [] + Links: + [] + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + inputs: + [] + outputs: + - name: Output + id: 9596355334609294623 + Links: + - id: 9171493557640758720 + output: 9596355334609294623 + input: 15529003614232630594 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta new file mode 100644 index 000000000..9de862130 --- /dev/null +++ b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta @@ -0,0 +1,4 @@ +Handle: 2896570904865207590 +Path: Assets/Player Test/AG_NewAnimationGraph.vtanimgraph +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/Player.cs b/Project/Assets/Player Test/Player.cs new file mode 100644 index 000000000..3a9efd603 --- /dev/null +++ b/Project/Assets/Player Test/Player.cs @@ -0,0 +1,112 @@ +using System.Windows.Forms; +using Volt; +using System.Linq; +using System.Diagnostics; + +namespace Project +{ + public class Player : Script + { + public float runSpeed = 350f; + public float sprintSpeed = 472f; + public float acceleration = 10f; + public float deceleration = 10f; + public float jumpForce = 100f; + public float rotationSpeed = 10f; + + private float currentSpeed = 0f; + private Vector3 desiredDir; + + + CharacterControllerComponent charComp; + AnimationControllerComponent animController; + Entity camera; + private void OnCreate() + { + } + + private void OnUpdate(float deltaTime) + { + if (camera == null) + { + camera = Entity.Find("VCam0"); + } + charComp = entity.GetComponent(); + animController = entity.GetComponent(); + Vector2 dir = Vector2.Zero; + if (Volt.Input.IsKeyDown(KeyCode.W)) + { + dir.y += 1; + } + if (Volt.Input.IsKeyDown(KeyCode.S)) + { + dir.y -= 1; + } + + if (Volt.Input.IsKeyDown(KeyCode.A)) + { + dir.x -= 1; + } + if (Volt.Input.IsKeyDown(KeyCode.D)) + { + dir.x += 1; + } + float desiredSpeed = runSpeed; + if (Volt.Input.IsKeyDown(KeyCode.Left_Shift)) + { + desiredSpeed = sprintSpeed; + } + + if (dir.Length() > 0) + { + currentSpeed = Mathf.Lerp(currentSpeed, desiredSpeed, acceleration * deltaTime); + } + else + { + currentSpeed = Mathf.Lerp(currentSpeed, 0, deceleration * deltaTime); + } + + Vector3 cameraFwd = new Vector3(0, 0, 1); + if (camera != null) + { + cameraFwd = camera.forward; + } + dir = new Vector2(cameraFwd.x, cameraFwd.z) * dir.y + new Vector2(cameraFwd.z, -cameraFwd.x) * dir.x; + dir.Normalize(); + if (dir.Length() > 0) + { + desiredDir = new Vector3(dir.x, 0, dir.y); + + } + if (currentSpeed > 0 && charComp != null) + { + + Vector3 lookDir = new Vector3(dir.x, 0, dir.y); + Log.Info("LookDir: " + lookDir.ToString()); + + entity.rotation = Quaternion.Slerp(entity.rotation, Quaternion.QuaternionLookRotation(desiredDir, Vector3.Down), rotationSpeed * deltaTime); + charComp.Move(new Vector3(entity.forward.x, 0, entity.forward.z) * currentSpeed * deltaTime); + } + + + animController?.controller?.SetParameter("CurrentSpeed", currentSpeed); + animController?.controller?.SetParameter("Grounded", charComp.isGrounded); + + animController?.controller?.SetParameter("Jump", false); + if (Volt.Input.IsKeyDown(KeyCode.Space) && charComp.isGrounded) + { + Jump(); + } + } + + private void Jump() + { + if (charComp != null) + { + charComp.Jump(jumpForce); + } + animController?.controller?.SetParameter("Jump", true); + + } + } +} diff --git a/Project/Assets/Player Test/Player.cs.vtmeta b/Project/Assets/Player Test/Player.cs.vtmeta new file mode 100644 index 000000000..ffb0e5ec7 --- /dev/null +++ b/Project/Assets/Player Test/Player.cs.vtmeta @@ -0,0 +1,4 @@ +Handle: 16164390882708253215 +Path: Assets/Player Test/Player.cs +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer b/Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer new file mode 100644 index 000000000..8265a445d --- /dev/null +++ b/Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer @@ -0,0 +1,948 @@ +Layer: + name: Main + id: 0 + visible: true + locked: false + Entities: + - Entity: + id: 132488643 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Skylight + - guid: [5130770350572262273, 9533246575187293344] + properties: + - type: 16 + vectorType: 13 + name: Environment Map + data: 0 + - type: 7 + vectorType: 13 + name: Intensity + data: 1 + - type: 7 + vectorType: 13 + name: LOD + data: 0 + - type: 7 + vectorType: 13 + name: Turbidity + data: 2 + - type: 7 + vectorType: 13 + name: Azimuth + data: 0 + - type: 7 + vectorType: 13 + name: Inclination + data: 0 + - type: 0 + vectorType: 13 + name: Show + data: true + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - Entity: + id: 1868519665 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: TransitionCamera + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5524573352483143404, 11007889460122951339] + properties: + - type: 7 + vectorType: 13 + name: Aperture + data: 16 + - type: 7 + vectorType: 13 + name: Shutter Speed + data: 0.00999999978 + - type: 7 + vectorType: 13 + name: ISO + data: 100 + - type: 7 + vectorType: 13 + name: Field of View + data: 60 + - type: 7 + vectorType: 13 + name: Near plane + data: 1 + - type: 7 + vectorType: 13 + name: Far plane + data: 100000 + - type: 2 + vectorType: 13 + name: Priority + data: 0 + - guid: [5459167153101153946, 11768209997352591234] + properties: + - type: 7 + vectorType: 13 + name: Blend Time + data: 1 + - type: 7 + vectorType: 13 + name: Field Of View + data: 60 + - type: 21 + vectorType: 2 + name: Ignored Layers + data: + [] + - type: 24 + vectorType: 13 + name: Camera Type + data: 0 + - type: 24 + vectorType: 13 + name: Blend Type + data: 0 + - type: 7 + vectorType: 13 + name: Damping + data: 0 + - type: 10 + vectorType: 13 + name: Offset + data: [0, 0, 0] + - type: 22 + vectorType: 13 + name: Follow + data: 0 + - type: 22 + vectorType: 13 + name: LookAt + data: 0 + - type: 22 + vectorType: 13 + name: Collision Focus Point + data: 0 + - type: 7 + vectorType: 13 + name: Focal Distance + data: 1000 + - type: 7 + vectorType: 13 + name: Mouse Sensitivity + data: 0.150000006 + - type: 7 + vectorType: 13 + name: Collision Sphere Radius + data: 100 + - type: 0 + vectorType: 13 + name: Collision + data: false + - type: 0 + vectorType: 13 + name: Is Default + data: false + - type: 0 + vectorType: 13 + name: X FollowLock + data: false + - type: 0 + vectorType: 13 + name: Y FollowLock + data: false + - type: 0 + vectorType: 13 + name: Z FollowLock + data: false + - type: 0 + vectorType: 13 + name: X ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Y ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Z ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Additive Blend + data: false + - Entity: + id: 1868755325 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Directional Light + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0.866025448, 0, 0, 0.49999997] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [4956947959302657279, 6431008363526150588] + properties: + - type: 7 + vectorType: 13 + name: Intensity + data: 1 + - type: 17 + vectorType: 13 + name: Color + data: [1, 1, 1] + - type: 7 + vectorType: 13 + name: Light Size + data: 1 + - type: 0 + vectorType: 13 + name: Soft Shadows + data: true + - type: 0 + vectorType: 13 + name: Cast Shadows + data: true + - Entity: + id: 2402376934 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: playerCharacter_sk + - guid: [4801038614670344234, 17500621051426503811] + properties: + - type: 24 + vectorType: 13 + name: Climbing Mode + data: 0 + - type: 7 + vectorType: 13 + name: Slope Limit + data: 20 + - type: 7 + vectorType: 13 + name: Invisible Wall Height + data: 200 + - type: 7 + vectorType: 13 + name: Max Jump Height + data: 100 + - type: 7 + vectorType: 13 + name: Contact Offset + data: 1 + - type: 7 + vectorType: 13 + name: Step Offset + data: 10 + - type: 7 + vectorType: 13 + name: Density + data: 1 + - type: 2 + vectorType: 13 + name: Layer + data: 0 + - type: 0 + vectorType: 13 + name: Has Gravity + data: true + - guid: [5272442441707063634, 16349525528562408586] + properties: + - type: 7 + vectorType: 13 + name: Radius + data: 50 + - type: 7 + vectorType: 13 + name: Height + data: 50 + - type: 10 + vectorType: 13 + name: Offset + data: [0, 75, 0] + - type: 0 + vectorType: 13 + name: Is Trigger + data: false + - type: 16 + vectorType: 13 + name: Physics Material + data: 13487565 + - guid: [4626977537440075682, 8666096866538760379] + properties: + - type: 16 + vectorType: 13 + name: Animation Graph + data: 6090874269170405106 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - type: 16 + vectorType: 13 + name: Override Skin + data: 0 + - type: 0 + vectorType: 13 + name: Apply Root Motion + data: false + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [-80.8730011, 0.999992371, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [-2.77599663e-17, -0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 2266006686789750075 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - guid: [5428802467633469958, 3006162545260469436] + properties: + - type: 21 + vectorType: 12 + name: ScriptNames + data: + - value: Project.Player + - type: 21 + vectorType: 16 + name: ScriptIds + data: + - value: 17153352387063866732 + MonoScripts: + - ScriptEntry: + name: Project.Player + id: 17153352387063866732 + properties: + - type: 7 + name: acceleration + enumName: "" + data: 10 + - type: 7 + name: runSpeed + enumName: "" + data: 350 + - type: 7 + name: sprintSpeed + enumName: "" + data: 472 + - type: 7 + name: deceleration + enumName: "" + data: 800 + - type: 7 + name: jumpForce + enumName: "" + data: 500 + - type: 7 + name: rotationSpeed + enumName: "" + data: 15 + - Entity: + id: 2795517839 + components: + - guid: [5594831065701184629, 5808174883320445581] + properties: + - type: 10 + vectorType: 13 + name: Half Size + data: [50, 50, 50] + - type: 10 + vectorType: 13 + name: Offset + data: [0, 0, 0] + - type: 0 + vectorType: 13 + name: Is Trigger + data: false + - type: 16 + vectorType: 13 + name: Physics Material + data: 57928654030491085 + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5241627842114713378, 11179844935521484427] + properties: + - type: 24 + vectorType: 13 + name: Type + data: 0 + - type: 2 + vectorType: 13 + name: Layer ID + data: 0 + - type: 7 + vectorType: 13 + name: Mass + data: 1 + - type: 7 + vectorType: 13 + name: Linear Drag + data: 0.00999999978 + - type: 2 + vectorType: 13 + name: Lock Flags + data: 0 + - type: 7 + vectorType: 13 + name: Angular Drag + data: 0.0500000007 + - type: 24 + vectorType: 13 + name: Collision Type + data: 0 + - type: 0 + vectorType: 13 + name: Disable Graivity + data: true + - type: 0 + vectorType: 13 + name: Is Kinematic + data: false + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: New Cube + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, -50, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [10, 1, 10] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 10149696181569838305 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - Entity: + id: 3674840423 + components: + - guid: [5594831065701184629, 5808174883320445581] + properties: + - type: 10 + vectorType: 13 + name: Half Size + data: [50, 50, 50] + - type: 10 + vectorType: 13 + name: Offset + data: [0, 0, 0] + - type: 0 + vectorType: 13 + name: Is Trigger + data: false + - type: 16 + vectorType: 13 + name: Physics Material + data: 57928654030491085 + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5241627842114713378, 11179844935521484427] + properties: + - type: 24 + vectorType: 13 + name: Type + data: 0 + - type: 2 + vectorType: 13 + name: Layer ID + data: 0 + - type: 7 + vectorType: 13 + name: Mass + data: 1 + - type: 7 + vectorType: 13 + name: Linear Drag + data: 0.00999999978 + - type: 2 + vectorType: 13 + name: Lock Flags + data: 0 + - type: 7 + vectorType: 13 + name: Angular Drag + data: 0.0500000007 + - type: 24 + vectorType: 13 + name: Collision Type + data: 0 + - type: 0 + vectorType: 13 + name: Disable Graivity + data: true + - type: 0 + vectorType: 13 + name: Is Kinematic + data: false + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: New Cube + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [1000, -20.3999996, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [10, 1, 10] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 10149696181569838305 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - Entity: + id: 4018203657 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: VCam0 + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [-80.8730011, 118.999992, -234] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5524573352483143404, 11007889460122951339] + properties: + - type: 7 + vectorType: 13 + name: Aperture + data: 16 + - type: 7 + vectorType: 13 + name: Shutter Speed + data: 0.00999999978 + - type: 7 + vectorType: 13 + name: ISO + data: 100 + - type: 7 + vectorType: 13 + name: Field of View + data: 60 + - type: 7 + vectorType: 13 + name: Near plane + data: 1 + - type: 7 + vectorType: 13 + name: Far plane + data: 100000 + - type: 2 + vectorType: 13 + name: Priority + data: 1 + - guid: [5459167153101153946, 11768209997352591234] + properties: + - type: 7 + vectorType: 13 + name: Blend Time + data: 1 + - type: 7 + vectorType: 13 + name: Field Of View + data: 60 + - type: 21 + vectorType: 2 + name: Ignored Layers + data: + [] + - type: 24 + vectorType: 13 + name: Camera Type + data: 1 + - type: 24 + vectorType: 13 + name: Blend Type + data: 0 + - type: 7 + vectorType: 13 + name: Damping + data: 0 + - type: 10 + vectorType: 13 + name: Offset + data: [0, 118, 766] + - type: 22 + vectorType: 13 + name: Follow + data: 2402376934 + - type: 22 + vectorType: 13 + name: LookAt + data: 2402376934 + - type: 22 + vectorType: 13 + name: Collision Focus Point + data: 0 + - type: 7 + vectorType: 13 + name: Focal Distance + data: 1000 + - type: 7 + vectorType: 13 + name: Mouse Sensitivity + data: 0.150000006 + - type: 7 + vectorType: 13 + name: Collision Sphere Radius + data: 100 + - type: 0 + vectorType: 13 + name: Collision + data: false + - type: 0 + vectorType: 13 + name: Is Default + data: true + - type: 0 + vectorType: 13 + name: X FollowLock + data: false + - type: 0 + vectorType: 13 + name: Y FollowLock + data: false + - type: 0 + vectorType: 13 + name: Z FollowLock + data: false + - type: 0 + vectorType: 13 + name: X ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Y ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Z ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Additive Blend + data: false + Graph: + Nodes: + [] + Links: + [] + Parameters: + [] + Events: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene new file mode 100644 index 000000000..c57cbadd7 --- /dev/null +++ b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene @@ -0,0 +1,2 @@ +Scene: + name: New Scene \ No newline at end of file diff --git a/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta new file mode 100644 index 000000000..47e21f604 --- /dev/null +++ b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta @@ -0,0 +1,4 @@ +Handle: 11781743913864354695 +Path: Assets/Player Test/PlayerTestGym/New Scene.vtscene +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.fbx b/Project/Assets/Player Test/playerCharacter_sk.fbx new file mode 100644 index 000000000..29c645d2c --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e847dfccd296b3e7ac51fea1176ff5f3a5ebc93d458084ca1885d9c930800b41 +size 12794286 diff --git a/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta new file mode 100644 index 000000000..d1ae328c5 --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta @@ -0,0 +1,4 @@ +Handle: 7909096447964860586 +Path: Assets/Player Test/playerCharacter_sk.fbx +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmat b/Project/Assets/Player Test/playerCharacter_sk.vtmat new file mode 100644 index 000000000..037f77f19 --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:affce77b0d51df5d500cbb0661f471f580a2128cee5288666690c7563b6a54fd +size 1707 diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta new file mode 100644 index 000000000..ed252847f --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta @@ -0,0 +1,4 @@ +Handle: 15849153362820611389 +Path: Assets/Player Test/playerCharacter_sk.vtmat +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmesh b/Project/Assets/Player Test/playerCharacter_sk.vtmesh new file mode 100644 index 000000000..3ab6a87f9 --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b23303ebbe2e7d7b5c3094d4bf587ac19628f54b54359820195a7e69c12700c9 +size 2900044 diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta new file mode 100644 index 000000000..1e5180051 --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta @@ -0,0 +1,4 @@ +Handle: 9098645144163709913 +Path: Assets/Player Test/playerCharacter_sk.vtmesh +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtsk b/Project/Assets/Player Test/playerCharacter_sk.vtsk new file mode 100644 index 000000000..9da33f9c9 --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.vtsk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4779f3fd0ede26d3f1253a6cf50c4ecb03211e43d4acf649616f35f2d4e2a52 +size 20733 diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta new file mode 100644 index 000000000..e75a9f535 --- /dev/null +++ b/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta @@ -0,0 +1,4 @@ +Handle: 10080715167332384675 +Path: Assets/Player Test/playerCharacter_sk.vtsk +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/playerIdle_anim.fbx b/Project/Assets/Player Test/playerIdle_anim.fbx new file mode 100644 index 000000000..1d8d93338 --- /dev/null +++ b/Project/Assets/Player Test/playerIdle_anim.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e32b2b1546d226831ab19810b805f0564a907ee32505ddef5e99e469a580202f +size 1662608 diff --git a/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta b/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta new file mode 100644 index 000000000..8fc21061c --- /dev/null +++ b/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta @@ -0,0 +1,4 @@ +Handle: 4503334044421001517 +Path: Assets/Player Test/playerIdle_anim.fbx +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/playerIdle_anim.vtanim b/Project/Assets/Player Test/playerIdle_anim.vtanim new file mode 100644 index 000000000..fe4df8eb2 --- /dev/null +++ b/Project/Assets/Player Test/playerIdle_anim.vtanim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab5fab4da63d1405079bb0a4479542a7493de473dd95135f6e0514ac7855d9c4 +size 2214016 diff --git a/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta b/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta new file mode 100644 index 000000000..f582e1bd3 --- /dev/null +++ b/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta @@ -0,0 +1,4 @@ +Handle: 16802240511195054919 +Path: Assets/Player Test/playerIdle_anim.vtanim +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_inAir_anim.fbx b/Project/Assets/Player Test/player_inAir_anim.fbx new file mode 100644 index 000000000..6add07a2d --- /dev/null +++ b/Project/Assets/Player Test/player_inAir_anim.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c112db4292369fd3b647117fb68fa6d2d369ff38cb68c218585d0951aefc30fd +size 346256 diff --git a/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta b/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta new file mode 100644 index 000000000..962179294 --- /dev/null +++ b/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta @@ -0,0 +1,4 @@ +Handle: 14167442283478199722 +Path: Assets/Player Test/player_inAir_anim.fbx +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_inAir_anim.vtanim b/Project/Assets/Player Test/player_inAir_anim.vtanim new file mode 100644 index 000000000..a0e48fa13 --- /dev/null +++ b/Project/Assets/Player Test/player_inAir_anim.vtanim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab1c9ff70d463b66b93abbece98a7a6a771688ff4daed0333a674238587d4e10 +size 45376 diff --git a/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta new file mode 100644 index 000000000..9b3b97d28 --- /dev/null +++ b/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta @@ -0,0 +1,4 @@ +Handle: 16379139790018569206 +Path: Assets/Player Test/player_inAir_anim.vtanim +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_jumpUp_anim.fbx b/Project/Assets/Player Test/player_jumpUp_anim.fbx new file mode 100644 index 000000000..89f92632a --- /dev/null +++ b/Project/Assets/Player Test/player_jumpUp_anim.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f7441c48762e8d58e4490f54830c5c5e03dbf1a1adacf00f62b79e1f8a2f381 +size 419056 diff --git a/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta b/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta new file mode 100644 index 000000000..57573dbe2 --- /dev/null +++ b/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta @@ -0,0 +1,4 @@ +Handle: 13207614601213847269 +Path: Assets/Player Test/player_jumpUp_anim.fbx +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_jumpUp_anim.vtanim b/Project/Assets/Player Test/player_jumpUp_anim.vtanim new file mode 100644 index 000000000..c760ca3fa --- /dev/null +++ b/Project/Assets/Player Test/player_jumpUp_anim.vtanim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4f528e3e205f3965238f8b1c92f101d6f6e0c481a6a84cae1c07601eb609643 +size 32416 diff --git a/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta new file mode 100644 index 000000000..90e3b4e86 --- /dev/null +++ b/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta @@ -0,0 +1,4 @@ +Handle: 9874085243310133722 +Path: Assets/Player Test/player_jumpUp_anim.vtanim +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_landing_anim.fbx b/Project/Assets/Player Test/player_landing_anim.fbx new file mode 100644 index 000000000..ee690b7e9 --- /dev/null +++ b/Project/Assets/Player Test/player_landing_anim.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:163a53a5fb35ff557640dba233133e64bbd2ba30db04b475d008154aa8b9b13c +size 535024 diff --git a/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta b/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta new file mode 100644 index 000000000..acfb5ab99 --- /dev/null +++ b/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta @@ -0,0 +1,4 @@ +Handle: 16582168720100222204 +Path: Assets/Player Test/player_landing_anim.fbx +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_landing_anim.vtanim b/Project/Assets/Player Test/player_landing_anim.vtanim new file mode 100644 index 000000000..cc4b36c1e --- /dev/null +++ b/Project/Assets/Player Test/player_landing_anim.vtanim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e968c0a20d10823e5dc3111c6becb92cbb32ec7f01447e888f712944b0831050 +size 131776 diff --git a/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta new file mode 100644 index 000000000..31e9f3dfd --- /dev/null +++ b/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta @@ -0,0 +1,4 @@ +Handle: 13719070777493897150 +Path: Assets/Player Test/player_landing_anim.vtanim +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_run_anim.vtanim b/Project/Assets/Player Test/player_run_anim.vtanim new file mode 100644 index 000000000..90ae7863a --- /dev/null +++ b/Project/Assets/Player Test/player_run_anim.vtanim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db6faba998366d0d14580f43c2df9dc59a3941cd09a222e5776adbae1ccf1b01 +size 58336 diff --git a/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta new file mode 100644 index 000000000..b7d741d17 --- /dev/null +++ b/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta @@ -0,0 +1,4 @@ +Handle: 1087306084089571470 +Path: Assets/Player Test/player_run_anim.vtanim +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_sprint_anim.fbx b/Project/Assets/Player Test/player_sprint_anim.fbx new file mode 100644 index 000000000..fe9da5d3b --- /dev/null +++ b/Project/Assets/Player Test/player_sprint_anim.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ea6b0ac76ef39cc3f5470c1cb9506d36d2efd3270718165b7a42f732e03e81d +size 431552 diff --git a/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta b/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta new file mode 100644 index 000000000..07410b60a --- /dev/null +++ b/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta @@ -0,0 +1,4 @@ +Handle: 14967198796169727603 +Path: Assets/Player Test/player_sprint_anim.fbx +Dependencies: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/player_sprint_anim.vtanim b/Project/Assets/Player Test/player_sprint_anim.vtanim new file mode 100644 index 000000000..db377041f --- /dev/null +++ b/Project/Assets/Player Test/player_sprint_anim.vtanim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d2f4df7570947c73c622a070806adc62907a552134d4c207fa96155ac63eb0c +size 30256 diff --git a/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta new file mode 100644 index 000000000..7f4f9943e --- /dev/null +++ b/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta @@ -0,0 +1,4 @@ +Handle: 15479924379188462583 +Path: Assets/Player Test/player_sprint_anim.vtanim +Dependencies: + [] \ No newline at end of file diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp index 5b721e921..ffcc211c6 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp @@ -23,9 +23,9 @@ namespace GraphKey AnimationOutputData output{}; Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return output; } @@ -42,7 +42,7 @@ namespace GraphKey if (moveToWorldSpace) { - const auto& joints = character->GetSkeleton()->GetJoints(); + const auto& joints = skeleton->GetJoints(); for (size_t i = 0; i < joints.size(); i++) { const auto& joint = joints[i]; diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp index 8674e3c2b..8ae937f52 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include namespace GraphKey @@ -73,16 +73,16 @@ namespace GraphKey void AdditiveNode::TryApplyAdditive() { Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return; } const auto& base = GetInput(0); const auto& additive = GetInput(1); - const auto& additiveBase = character->GetSkeleton()->GetRestPose(); + const auto& additiveBase = skeleton->GetRestPose(); const float alpha = std::clamp(GetInput(2), 0.f, 1.f); @@ -258,9 +258,9 @@ namespace GraphKey const std::vector BlendSpaceNode::TrySampleAnimation(Volt::AssetHandle animationHandle) { Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return {}; } @@ -275,7 +275,7 @@ namespace GraphKey { return {}; } - return anim->SampleTRS(animGraph->GetStartTime(), character->GetSkeleton(), true); + return anim->SampleTRS(animGraph->GetStartTime(), skeleton, true); } const std::vector> BlendSpaceNode::GetSortedAnimationWeights(Ref blendSpace, const glm::vec2& blendValue) @@ -337,14 +337,14 @@ namespace GraphKey const size_t BlendSpaceNode::GetSkeletonJointCount() const { Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return 0; } - return character->GetSkeleton()->GetJointCount(); + return skeleton->GetJointCount(); } LayeredBlendPerBoneNode::LayeredBlendPerBoneNode() @@ -412,15 +412,13 @@ namespace GraphKey void LayeredBlendPerBoneNode::TryApplyLayeredBlendPerBone() { Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return; } - auto skeleton = character->GetSkeleton(); - const auto& basePose = GetInput(0); const auto& blendPose = GetInput(1); const float alpha = std::clamp(GetInput(2), 0.f, 1.f); @@ -515,15 +513,13 @@ namespace GraphKey void RotateBoneNode::RotateBone() { Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return; } - auto skeleton = character->GetSkeleton(); - auto basePose = GetInput(0); const auto& boneName = GetInput(1); const auto& rotation = GetInput(2); diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp index 2a6dd70ca..ff9e304cb 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include @@ -51,9 +51,9 @@ namespace GraphKey const auto animHandle = GetInput(0); Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return; } @@ -74,6 +74,7 @@ namespace GraphKey const bool applyRootMotion = GetInput(3); const uint32_t currentFrame = anim->GetFrameFromStartTime(animGraph->GetStartTime(), speed); + /* ANIMATION EVENT STUFF const int32_t animationIndex = character->GetAnimationIndexFromHandle(animHandle); if (myGraph->GetEntity() != Wire::NullID && Volt::SceneManager::GetActiveScene().lock() && animationIndex != -1 && character->HasAnimationEvents((uint32_t)animationIndex)) { @@ -102,12 +103,12 @@ namespace GraphKey } } } - } + }*/ myLastFrame = (int32_t)currentFrame; AnimationOutputData output{}; - output.pose = anim->SampleTRS(animGraph->GetStartTime(), character->GetSkeleton(), shouldLoop, speed); + output.pose = anim->SampleTRS(animGraph->GetStartTime(), skeleton, shouldLoop, speed); if (applyRootMotion) { diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp index 73e71b1ed..48cb5a0b2 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp @@ -2,7 +2,7 @@ #include "StateMachineNodes.h" #include -#include +#include #include #include @@ -45,7 +45,7 @@ namespace GraphKey Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); if (!myStateMachine) { - myStateMachine = CreateRef("New State Machine", animGraph->GetCharacterHandle()); + myStateMachine = CreateRef("New State Machine", animGraph->GetSkeletonHandle()); } } @@ -56,7 +56,7 @@ namespace GraphKey { VT_SERIALIZE_PROPERTY(name, myStateMachine->GetName(), out); VT_SERIALIZE_PROPERTY(editorState, myStateMachine->GetEditorState(), out); - VT_SERIALIZE_PROPERTY(characterHandle, myStateMachine->GetCharacterHandle(), out); + VT_SERIALIZE_PROPERTY(skeletonHandle, myStateMachine->GetSkeletonHandle(), out); out << YAML::Key << "States" << YAML::BeginSeq; for (const auto& state : myStateMachine->GetStates()) @@ -81,7 +81,7 @@ namespace GraphKey if (state->stateGraph) { - VT_SERIALIZE_PROPERTY(characterHandle, state->stateGraph->GetCharacterHandle(), out); + VT_SERIALIZE_PROPERTY(skeletonHandle, state->stateGraph->GetSkeletonHandle(), out); Graph::Serialize(state->stateGraph, out); } } @@ -237,14 +237,14 @@ namespace GraphKey } Volt::AnimationGraphAsset* animGraph = reinterpret_cast(myGraph); - const auto character = Volt::AssetManager::GetAsset(animGraph->GetCharacterHandle()); + const auto skeleton = Volt::AssetManager::GetAsset(animGraph->GetSkeletonHandle()); - if (!character || !character->IsValid()) + if (!skeleton || !skeleton->IsValid()) { return; } - SetOutputData(0, myStateMachine->Sample(character->GetSkeleton())); + SetOutputData(0, myStateMachine->Sample(skeleton)); } } diff --git a/Volt/Navigation/src/Navigation/Core/NavigationSystem.cpp b/Volt/Navigation/src/Navigation/Core/NavigationSystem.cpp index 344791d2c..52a3ca480 100644 --- a/Volt/Navigation/src/Navigation/Core/NavigationSystem.cpp +++ b/Volt/Navigation/src/Navigation/Core/NavigationSystem.cpp @@ -17,7 +17,7 @@ namespace Volt { namespace AI { - NavigationSystem::NavigationSystem() + NavigationSystem::NavigationSystem() { myNavMesh = CreateRef(); } @@ -38,75 +38,75 @@ namespace Volt bool NavigationSystem::OnAppUpdateEvent(Volt::AppUpdateEvent& e) { VT_PROFILE_FUNCTION() - if (myNavMesh && myActiveScene && myActiveScene->IsPlaying()) - { - auto& crowd = myNavMesh->GetCrowd(); - - auto& agentMap = crowd->GetAgentMap(); + if (myNavMesh && myActiveScene && myActiveScene->IsPlaying()) { - VT_PROFILE_SCOPE("Remove old agents"); + auto& crowd = myNavMesh->GetCrowd(); - for (auto [entityId, agentId] : agentMap) + auto& agentMap = crowd->GetAgentMap(); { - const auto& registry = myActiveScene->GetRegistry(); - auto entity = Volt::Entity(entityId, myActiveScene.get()); - - if (!registry.Exists(entityId) || !registry.HasComponent(entityId)) - { - crowd->RemoveAgent(entity); - } + VT_PROFILE_SCOPE("Remove old agents"); - if (myEntityIdToTargetPosMap.contains(entityId)) + for (auto [entityId, agentId] : agentMap) { - myEntityIdToTargetPosMap.erase(entityId); + const auto& registry = myActiveScene->GetRegistry(); + auto entity = Volt::Entity(entityId, myActiveScene.get()); + + if (!registry.Exists(entityId) || !registry.HasComponent(entityId)) + { + crowd->RemoveAgent(entity); + } + + if (myEntityIdToTargetPosMap.contains(entityId)) + { + myEntityIdToTargetPosMap.erase(entityId); + } } } - } - - { - VT_PROFILE_SCOPE("Add new agents & disable movement on inactive agents"); - - auto& registry = myActiveScene->GetRegistry(); - auto agentEntities = registry.GetComponentView(); - for (auto entityId : agentEntities) { - auto entity = Volt::Entity(entityId, myActiveScene.get()); - crowd->SetAgentPosition(entity, entity.GetPosition()); + VT_PROFILE_SCOPE("Add new agents & disable movement on inactive agents"); - if (!crowd->GetAgentMap().contains(entityId)) - { - crowd->AddAgent(entity); - crowd->UpdateAgentParams(entity); - } - else if (!registry.GetComponent(entityId).active) - { - PauseAgent(entity, e.GetTimestep()); - } - else if (registry.GetComponent(entityId).active) + auto& registry = myActiveScene->GetRegistry(); + + auto agentEntities = registry.GetComponentView(); + for (auto entityId : agentEntities) { - UnpauseAgent(entity); + auto entity = Volt::Entity(entityId, myActiveScene.get()); + crowd->SetAgentPosition(entity, entity.GetPosition()); + + if (!crowd->GetAgentMap().contains(entityId)) + { + crowd->AddAgent(entity); + crowd->UpdateAgentParams(entity); + } + else if (!registry.GetComponent(entityId).active) + { + PauseAgent(entity, e.GetTimestep()); + } + else if (registry.GetComponent(entityId).active) + { + UnpauseAgent(entity); + } } } - } - { - VT_PROFILE_SCOPE("Detour crowd update"); - myNavMesh->Update(e.GetTimestep()); - } + { + VT_PROFILE_SCOPE("Detour crowd update"); + myNavMesh->Update(e.GetTimestep()); + } - { - VT_PROFILE_SCOPE("Update agent positions"); - for (auto [entityId, agentId] : agentMap) { - Volt::Entity entity(entityId, myActiveScene.get()); - if (entity.GetComponent().active) + VT_PROFILE_SCOPE("Update agent positions"); + for (auto [entityId, agentId] : agentMap) { - SyncDetourPosition(entity, e.GetTimestep()); + Volt::Entity entity(entityId, myActiveScene.get()); + if (entity.GetComponent().active) + { + SyncDetourPosition(entity, e.GetTimestep()); + } } } } - } return false; } @@ -202,7 +202,11 @@ namespace Volt if (myNavMesh) { auto& crowd = myNavMesh->GetCrowd(); - + if (!myActiveScene) + { + VT_CORE_ERROR("Could not initialize agents because active scene is null"); + return; + } auto agentEntities = myActiveScene->GetRegistry().GetComponentView(); for (auto entityId : agentEntities) { @@ -216,8 +220,15 @@ namespace Volt { if (myNavMesh) { - auto& crowd = myNavMesh->GetCrowd(); - crowd->ClearAgents(); + if (myNavMesh->GetCrowd()) + { + auto& crowd = myNavMesh->GetCrowd(); + crowd->ClearAgents(); + } + else + { + VT_CORE_ERROR("Could not clear agents because crowd is null"); + } } } } diff --git a/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.cpp b/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.cpp index 28c823fbf..1df7eb575 100644 --- a/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.cpp +++ b/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.cpp @@ -854,7 +854,7 @@ bool EditorUtils::NewAnimationGraphModal(const std::string& aId, Ref(graphData.destination, graphData.name + ".vtanimgraph", graphData.characterHandle); + auto newGraph = Volt::AssetManager::CreateAsset(graphData.destination, graphData.name + ".vtanimgraph", graphData.skeletonHandle); if (outGraph) { diff --git a/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.h b/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.h index f40812764..357e6c81d 100644 --- a/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.h +++ b/Volt/Sandbox/src/Sandbox/Utility/EditorUtilities.h @@ -36,7 +36,7 @@ struct NewCharacterData struct NewAnimationGraphData { std::string name = "None"; - Volt::AssetHandle characterHandle = Volt::Asset::Null(); + Volt::AssetHandle skeletonHandle = Volt::Asset::Null(); std::filesystem::path destination = "Assets/Animations/"; }; diff --git a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp index d201c3067..9f94d9cea 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp @@ -483,11 +483,11 @@ void AnimationGraphPanel::DrawPropertiesPanel() { if (UI::BeginProperties("graphProperties")) { - auto handle = myCurrentAsset->GetCharacterHandle(); + /*auto handle = myCurrentAsset->GetCharacterHandle(); if (EditorUtils::Property("Character", handle, Volt::AssetType::AnimatedCharacter)) { myCurrentAsset->SetCharacterHandle(handle); - } + }*/ UI::EndProperties(); @@ -857,11 +857,11 @@ void AnimationGraphPanel::DrawGraphProperties() } } - auto handle = myCurrentAsset->GetCharacterHandle(); - if (EditorUtils::Property("Character", handle, Volt::AssetType::AnimatedCharacter)) - { - myCurrentAsset->SetCharacterHandle(handle); - } + //auto handle = myCurrentAsset->GetCharacterHandle(); + //if (EditorUtils::Property("Character", handle, Volt::AssetType::AnimatedCharacter)) + //{ + // myCurrentAsset->SetCharacterHandle(handle); + //} UI::EndProperties(); } diff --git a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetItem.cpp b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetItem.cpp index 990730671..7ae0c2edf 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetItem.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetItem.cpp @@ -42,7 +42,7 @@ namespace AssetBrowser Sandbox::Get().SaveScene(); } - Sandbox::Get().OpenScene(Volt::AssetManager::GetPathFromAssetHandle(mySceneToOpen)); + Sandbox::Get().OpenScene(Volt::AssetManager::GetFilePathFromAssetHandle(mySceneToOpen)); mySceneToOpen = Volt::Asset::Null(); } @@ -154,7 +154,7 @@ namespace AssetBrowser break; case Volt::AssetType::MonoScript: { - if (!Volt::PremadeCommands::RunOpenVSFileCommand(UserSettingsManager::GetSettings().externalToolsSettings.customExternalScriptEditor, Volt::AssetManager::GetPathFromAssetHandle(handle))) + if (!Volt::PremadeCommands::RunOpenVSFileCommand(UserSettingsManager::GetSettings().externalToolsSettings.customExternalScriptEditor, Volt::AssetManager::GetFilePathFromAssetHandle(handle))) { UI::Notify(NotificationType::Error, "Open file failed!", "External script editor is not valid!"); } diff --git a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/DirectoryItem.cpp b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/DirectoryItem.cpp index 6445c29fa..81224e067 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/DirectoryItem.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/DirectoryItem.cpp @@ -30,7 +30,7 @@ namespace AssetBrowser if (item->isDirectory && item != this) { const std::filesystem::path newPath = path / item->path.stem(); - Volt::AssetManager::Get().MoveFolder(item->path, newPath); + Volt::AssetManager::Get().MoveFullFolder(item->path, newPath); FileSystem::MoveFolder(Volt::ProjectManager::GetDirectory() / item->path, newPath); } } @@ -39,7 +39,7 @@ namespace AssetBrowser { if (!item->isDirectory && item != this && FileSystem::Exists(Volt::ProjectManager::GetDirectory() / item->path)) { - Volt::AssetManager::Get().MoveAsset(Volt::AssetManager::Get().GetAssetHandleFromPath(item->path), path); + Volt::AssetManager::Get().MoveAsset(Volt::AssetManager::Get().GetAssetHandleFromFilePath(item->path), path); } } @@ -53,7 +53,7 @@ namespace AssetBrowser if (item->isDirectory && item != this) { const std::filesystem::path newPath = path / item->path.stem(); - Volt::AssetManager::Get().MoveFolder(item->path, newPath); + Volt::AssetManager::Get().MoveFullFolder(item->path, newPath); FileSystem::MoveFolder(Volt::ProjectManager::GetDirectory() / item->path, newPath); } } @@ -72,7 +72,7 @@ namespace AssetBrowser } } - Volt::AssetManager::Get().MoveAsset(Volt::AssetManager::Get().GetAssetHandleFromPath(item->path), path); + Volt::AssetManager::Get().MoveAsset(Volt::AssetManager::Get().GetAssetHandleFromFilePath(item->path), path); } } diff --git a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp index 7832a80c4..9854af771 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp @@ -42,7 +42,7 @@ std::unordered_map EditorAssetRegistry::myAsse { auto asset = Volt::AssetManager::GetAsset(aAssetHandle); std::filesystem::path sourceMeshPath = "Could not find the source mesh path"; - const auto& dependencies = Volt::AssetManager::Get().GetDependencies(aAssetHandle); + //const auto& dependencies = Volt::AssetManager::Get().GetDependencies(aAssetHandle); //for (const auto& d : dependencies) //{ // if (d.extension().string() == ".fbx") @@ -54,7 +54,7 @@ std::unordered_map EditorAssetRegistry::myAsse std::vector> data = { std::make_pair("Submesh Count", std::to_string(asset->GetSubMeshes().size())), - std::make_pair("Material Path", asset->GetMaterial()->path.string()), + std::make_pair("Material Path", Volt::AssetManager::GetFilePathFromAssetHandle(asset->GetMaterial()->handle).string()), std::make_pair("Vertex Count", Utils::ToStringWithThousandSeparator(asset->GetVertexCount())), std::make_pair("Index Count", Utils::ToStringWithThousandSeparator(asset->GetIndexCount())), std::make_pair("Source Mesh Path", sourceMeshPath.string()) @@ -147,8 +147,8 @@ std::unordered_map EditorAssetRegistry::myAsse auto asset = Volt::AssetManager::GetAsset(aAssetHandle); std::vector> data = { - std::make_pair("Skeleton Path", asset->GetSkeleton()->path.string()), - std::make_pair("Mesh Path", asset->GetSkin()->path.string()), + std::make_pair("Skeleton Path", Volt::AssetManager::GetFilePathFromAssetHandle(asset->GetSkeleton()->handle).string()), + std::make_pair("Mesh Path",Volt::AssetManager::GetFilePathFromAssetHandle(asset->GetSkin()->handle).string()), std::make_pair("Animation Count", std::to_string(asset->GetAnimationCount())), }; return data; diff --git a/Volt/Volt/src/Volt/Animation/AnimationController.cpp b/Volt/Volt/src/Volt/Animation/AnimationController.cpp index 44ffd4e64..11228744c 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationController.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationController.cpp @@ -38,10 +38,10 @@ namespace Volt } auto outputPoseNode = std::reinterpret_pointer_cast(nodes.at(0)); - const auto character = AssetManager::GetAsset(myGraph->GetCharacterHandle()); + const auto skeleton = AssetManager::GetAsset(myGraph->GetSkeletonHandle()); const auto sample = outputPoseNode->Sample(true, 0.f); - const auto& invBindPose = character->GetSkeleton()->GetInverseBindPose(); + const auto& invBindPose = skeleton->GetInverseBindPose(); std::vector result{}; result.resize(sample.pose.size()); @@ -56,7 +56,8 @@ namespace Volt result[i] = transform * invBindPose[i]; } - { + + /* { VT_PROFILE_SCOPE("Joint Attachments"); for (const auto& [attachmentId, attachedEntities] : myAttachedEntities) @@ -84,14 +85,14 @@ namespace Volt ent.SetLocalScale(currentTRS.scale); } } - } + }*/ return result; } void AnimationController::AttachEntity(const std::string& attachment, Entity entity) { - const auto character = AssetManager::GetAsset(myGraph->GetCharacterHandle()); + /*const auto character = AssetManager::GetAsset(myGraph->GetCharacterHandle()); if (!character || !character->IsValid()) { @@ -103,12 +104,12 @@ namespace Volt return; } - myAttachedEntities[character->GetJointAttachmentFromName(attachment).id].emplace_back(entity); + myAttachedEntities[character->GetJointAttachmentFromName(attachment).id].emplace_back(entity);*/ } void AnimationController::DetachEntity(Entity entity) { - for (auto& [attachmentName, attachedEntities] : myAttachedEntities) + /*for (auto& [attachmentName, attachedEntities] : myAttachedEntities) { auto it = std::find(attachedEntities.begin(), attachedEntities.end(), entity); if (it != attachedEntities.end()) @@ -116,7 +117,7 @@ namespace Volt attachedEntities.erase(it); return; } - } + }*/ } void AnimationController::OnEvent(Event& e) diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index b74be4c6a..bf2f2b328 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -15,8 +15,8 @@ namespace Volt { - AnimationStateMachine::AnimationStateMachine(const std::string& name, AssetHandle characterHandle) - : myName(name), myCharacterHandle(characterHandle) + AnimationStateMachine::AnimationStateMachine(const std::string& name, AssetHandle aSkeletonHandle) + : myName(name), mySkeletonHandle(aSkeletonHandle) { AddState("Entry", true); AddState("Any", false, true); @@ -112,14 +112,14 @@ namespace Volt } } - void AnimationStateMachine::SetCharacterHandle(AssetHandle handle) + void AnimationStateMachine::SetSkeletonHandle(AssetHandle aSkeletonHandle) { - myCharacterHandle = handle; + mySkeletonHandle = aSkeletonHandle; for (const auto& state : myStates) { if (state->stateGraph) { - state->stateGraph->SetCharacterHandle(handle); + state->stateGraph->SetSkeletonHandle(aSkeletonHandle); } } } @@ -160,12 +160,12 @@ namespace Volt auto outputPoseNode = std::reinterpret_pointer_cast(nodes.at(0)); auto sample = outputPoseNode->Sample(false, currState->startTime); - + if (myStateChanged) { myStateChanged = false; } - + return sample; } @@ -174,7 +174,7 @@ namespace Volt auto state = CreateRef(name, isEntry, isAny); if (!isEntry && !isAny) { - state->stateGraph = CreateRef(myCharacterHandle); + state->stateGraph = CreateRef(mySkeletonHandle); state->stateGraph->AddNode(GraphKey::Registry::Create("OutputPoseNode")); } @@ -222,9 +222,9 @@ namespace Volt void AnimationStateMachine::RemoveState(const UUID id) { auto it = std::find_if(myStates.begin(), myStates.end(), [&id](const auto& lhs) - { - return lhs->id == id; - }); + { + return lhs->id == id; + }); if (it == myStates.end()) { @@ -243,9 +243,9 @@ namespace Volt void AnimationStateMachine::RemoveTransition(const UUID id) { auto it = std::find_if(myTransitions.begin(), myTransitions.end(), [&id](const auto& lhs) - { - return lhs->id == id; - }); + { + return lhs->id == id; + }); if (it == myTransitions.end()) { @@ -320,7 +320,7 @@ namespace Volt Ref AnimationStateMachine::CreateCopy(GraphKey::Graph* ownerGraph, Wire::EntityId entity) const { - Ref newStateMachine = CreateRef(myName, myCharacterHandle); + Ref newStateMachine = CreateRef(myName, mySkeletonHandle); newStateMachine->myStartState = myStartState; newStateMachine->myCurrentState = myCurrentState; diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h index f0789fd10..72b570b52 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h @@ -58,7 +58,7 @@ namespace Volt class AnimationStateMachine { public: - AnimationStateMachine(const std::string& name, AssetHandle characterHandle); + AnimationStateMachine(const std::string& name, AssetHandle aSkeletonHandle); void Update(float deltaTime); const GraphKey::AnimationOutputData Sample(Ref skeleton); @@ -87,13 +87,13 @@ namespace Volt inline const std::vector>& GetStates() const { return myStates; } inline const std::vector>& GetTransitions() const { return myTransitions; } inline const std::string& GetEditorState() const { return myState; } - inline const AssetHandle GetCharacterHandle() const { return myCharacterHandle; } + inline const AssetHandle GetSkeletonHandle() const { return mySkeletonHandle; } inline const std::string& GetName() const { return myName; } inline void SetEditorState(const std::string& state) { myState = state; } inline void SetName(const std::string& name) { myName = name; } - void SetCharacterHandle(AssetHandle handle); + void SetSkeletonHandle(AssetHandle aSkeletonHandle); void Clear(); @@ -119,6 +119,6 @@ namespace Volt std::vector> myStates; std::vector> myTransitions; - AssetHandle myCharacterHandle = 0; + AssetHandle mySkeletonHandle = 0; }; } diff --git a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp index 323023e71..e501495eb 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp +++ b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp @@ -7,21 +7,21 @@ namespace Volt { Ref AnimationGraphAsset::CreateCopy(Wire::EntityId entity) { - Ref newGraph = CreateRef(myAnimatedCharacter); + Ref newGraph = CreateRef(mySkeletonHandle); newGraph->SetEntity(entity); GraphKey::Graph::Copy(shared_from_this(), newGraph); return newGraph; } - void AnimationGraphAsset::SetCharacterHandle(AssetHandle handle) + void AnimationGraphAsset::SetSkeletonHandle(AssetHandle aSkeletonHandle) { - myAnimatedCharacter = handle; + mySkeletonHandle = aSkeletonHandle; auto stateMachines = GetNodesOfType("StateMachineNode"); for (const auto& node : stateMachines) { auto stateNodeType = std::reinterpret_pointer_cast(node); - stateNodeType->GetStateMachine()->SetCharacterHandle(handle); + stateNodeType->GetStateMachine()->SetSkeletonHandle(aSkeletonHandle); } } } diff --git a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h index 3526cfef9..9f663aac3 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h +++ b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h @@ -8,20 +8,21 @@ namespace Volt { public: inline AnimationGraphAsset() = default; - inline AnimationGraphAsset(AssetHandle character) - : myAnimatedCharacter(character) + inline AnimationGraphAsset(AssetHandle aSkeleton) + : mySkeletonHandle(aSkeleton) { } - inline AnimationGraphAsset(AssetHandle character, Wire::EntityId entity) - : GraphKey::Graph(entity), myAnimatedCharacter(character) + inline AnimationGraphAsset(AssetHandle aSkeleton, Wire::EntityId entity) + : GraphKey::Graph(entity), mySkeletonHandle(aSkeleton) { } ~AnimationGraphAsset() override = default; - void SetCharacterHandle(AssetHandle handle); - inline const AssetHandle GetCharacterHandle() const { return myAnimatedCharacter; } + void SetSkeletonHandle(AssetHandle aSkeletonHandle); + inline const AssetHandle GetSkeletonHandle() const { return mySkeletonHandle; } + inline void SetState(const std::string& state) { myGraphState = state; } inline const std::string& GetState() const { return myGraphState; } @@ -36,7 +37,7 @@ namespace Volt private: friend class AnimationGraphImporter; - AssetHandle myAnimatedCharacter = Asset::Null(); + AssetHandle mySkeletonHandle = Asset::Null(); std::string myGraphState; float myStartTime = 0.f; diff --git a/Volt/Volt/src/Volt/Asset/Importers/AnimationGraphImporter.cpp b/Volt/Volt/src/Volt/Asset/Importers/AnimationGraphImporter.cpp index dc02a73f1..34d231f5a 100644 --- a/Volt/Volt/src/Volt/Asset/Importers/AnimationGraphImporter.cpp +++ b/Volt/Volt/src/Volt/Asset/Importers/AnimationGraphImporter.cpp @@ -59,10 +59,10 @@ namespace Volt std::string state; VT_DESERIALIZE_PROPERTY(state, state, graphNode, std::string("")); - AssetHandle characterHandle; - VT_DESERIALIZE_PROPERTY(character, characterHandle, graphNode, AssetHandle(0)); + AssetHandle skeletonHandle; + VT_DESERIALIZE_PROPERTY(skeleton, skeletonHandle, graphNode, AssetHandle(0)); - animGraph->myAnimatedCharacter = characterHandle; + animGraph->mySkeletonHandle = skeletonHandle; animGraph->myGraphState = state; } @@ -74,6 +74,9 @@ namespace Volt GraphKey::Graph::Deserialize(animGraph, graphSaveNode); } } + + + animGraph->SetSkeletonHandle(animGraph->mySkeletonHandle); return true; } @@ -87,7 +90,7 @@ namespace Volt { out << YAML::BeginMap; VT_SERIALIZE_PROPERTY(state, animGraph->myGraphState, out); - VT_SERIALIZE_PROPERTY(character, animGraph->myAnimatedCharacter, out); + VT_SERIALIZE_PROPERTY(skeleton, animGraph->mySkeletonHandle, out); GraphKey::Graph::Serialize(animGraph, out); out << YAML::EndMap; } diff --git a/Volt/Volt/src/Volt/Rendering/SceneRenderer.cpp b/Volt/Volt/src/Volt/Rendering/SceneRenderer.cpp index 78a12811c..72c24d025 100644 --- a/Volt/Volt/src/Volt/Rendering/SceneRenderer.cpp +++ b/Volt/Volt/src/Volt/Rendering/SceneRenderer.cpp @@ -1141,7 +1141,7 @@ namespace Volt if (comp.environmentHandle != comp.lastEnvironmentHandle) { comp.lastEnvironmentHandle = comp.environmentHandle; - comp.currentSceneEnvironment = Renderer::GenerateEnvironmentMap(comp.environmentHandle); + //comp.currentSceneEnvironment = Renderer::GenerateEnvironmentMap(comp.environmentHandle); myEnvironmentSettings.irradianceMap = comp.currentSceneEnvironment.irradianceMap; myEnvironmentSettings.radianceMap = comp.currentSceneEnvironment.radianceMap; @@ -1271,7 +1271,10 @@ namespace Volt { Wire::EntityId id = meshComponentView.at(currentIndex); Entity entity{ id, scenePtr.get() }; - + if (entity.HasComponent()) + { + return; + } const MeshComponent& meshComp = entity.GetComponent(); const TransformComponent& transComp = entity.GetComponent(); const EntityDataComponent& dataComp = entity.GetComponent(); @@ -1387,7 +1390,7 @@ namespace Volt auto scenePtr = myScene.lock(); auto& registry = scenePtr->GetRegistry(); - registry.ForEach([&](Wire::EntityId id, AnimationControllerComponent& animComp, const TransformComponent& transformComp, const EntityDataComponent& dataComp) + registry.ForEach([&](Wire::EntityId id, AnimationControllerComponent& animComp, MeshComponent& meshComp, const TransformComponent& transformComp, const EntityDataComponent& dataComp) { if (!transformComp.visible) { @@ -1396,13 +1399,12 @@ namespace Volt if (animComp.controller) { - const auto characterHandle = animComp.controller->GetGraph()->GetCharacterHandle(); - - const auto character = AssetManager::QueueAsset(animComp.controller->GetGraph()->GetCharacterHandle()); - if (!character || !character->IsValid()) + const auto skeleton = AssetManager::QueueAsset(animComp.controller->GetGraph()->GetSkeletonHandle()); + if (!skeleton || !skeleton->IsValid()) { return; } + auto skin = AssetManager::QueueAsset(meshComp.handle); auto entity = Entity(id, scenePtr.get()); @@ -1414,7 +1416,6 @@ namespace Volt entity.SetLocalPosition(entity.GetLocalPosition() + rootMotion.position); } - auto skin = character->GetSkin(); if (animComp.overrideSkin != Asset::Null()) { Ref overrideSkin = AssetManager::GetAsset(animComp.overrideSkin); @@ -1446,20 +1447,8 @@ namespace Volt } else { - auto animGraph = AssetManager::QueueAsset(animComp.animationGraph); - - if (!animGraph || !animGraph->IsValid()) - { - return; - } - - auto character = AssetManager::QueueAsset(animGraph->GetCharacterHandle()); - if (!character || !character->IsValid()) - { - return; - } - auto skin = character->GetSkin(); + auto skin = AssetManager::GetAsset(meshComp.handle); if (!skin || !skin->IsValid()) { return; diff --git a/Volt/Volt/src/Volt/Scripting/Mono/MonoScriptGlue.cpp b/Volt/Volt/src/Volt/Scripting/Mono/MonoScriptGlue.cpp index 554ae65c5..3c857cbb2 100644 --- a/Volt/Volt/src/Volt/Scripting/Mono/MonoScriptGlue.cpp +++ b/Volt/Volt/src/Volt/Scripting/Mono/MonoScriptGlue.cpp @@ -3803,16 +3803,20 @@ namespace Volt { return; } + if (!entity.HasComponent()) + { + return; + } if (!entity.GetComponent().controller) { return; } - auto controller = entity.GetComponent().controller; - auto animatedCharacter = AssetManager::GetAsset(controller->GetGraph()->GetCharacterHandle()); - *center = animatedCharacter->GetSkin()->GetBoundingSphere().center; - *radius = animatedCharacter->GetSkin()->GetBoundingSphere().radius; + auto meshComp = entity.GetComponent(); + auto mesh = AssetManager::GetAsset(meshComp.handle); + *center = mesh->GetBoundingSphere().center; + *radius = mesh->GetBoundingSphere().radius; } inline static float AnimationControllerComponent_GetParameterFloat(Wire::EntityId id, MonoString* name) From 96469159efd669fe90cc08812a3cb11716b0b89f Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Wed, 2 Aug 2023 13:40:24 +0200 Subject: [PATCH 02/18] Added an icon to animOutput pins, added some animations and a character, removed exit time and started adding relevant animation nodes --- .../Icons/icon_graph_pin_anim_pose.dds | 3 + .../Icons/icon_graph_pin_anim_pose_filled.dds | 3 + Engine/Scripts/Volt-ScriptCore.dll | 2 +- Engine/Scripts/Volt-ScriptCore.pdb | 4 +- .../AG_NewAnimationGraph.vtanimgraph | 298 ++++++++++++++++-- .../AG_NewAnimationGraph.vtanimgraph.vtmeta | 11 +- .../Assets/Player Test/CH_Player_01_MAT_C.dds | 3 + .../Player Test/CH_Player_01_MAT_C.dds.vtmeta | 7 + .../Assets/Player Test/CH_Player_01_MAT_M.dds | 3 + .../Player Test/CH_Player_01_MAT_M.dds.vtmeta | 7 + .../Assets/Player Test/CH_Player_01_MAT_N.dds | 3 + .../Player Test/CH_Player_01_MAT_N.dds.vtmeta | 7 + .../CH_Player_Gauntlet_01_MAT_C.dds | 3 + .../CH_Player_Gauntlet_01_MAT_C.dds.vtmeta | 7 + .../CH_Player_Gauntlet_01_MAT_M.dds | 3 + .../CH_Player_Gauntlet_01_MAT_M.dds.vtmeta | 7 + .../CH_Player_Gauntlet_01_MAT_N.dds | 3 + .../CH_Player_Gauntlet_01_MAT_N.dds.vtmeta | 7 + Project/Assets/Player Test/Player.cs.vtmeta | 11 +- .../PlayerTestGym/Layers/layer_0.vtlayer | 98 +++++- .../PlayerTestGym/New Scene.vtscene.vtmeta | 11 +- Project/Assets/Player Test/Test.vtanimgraph | 259 +++++++++++++++ .../Player Test/Test.vtanimgraph.vtmeta | 7 + .../Player Test/playerCharacter_sk.fbx.vtmeta | 11 +- .../Player Test/playerCharacter_sk.vtmat | 4 +- .../playerCharacter_sk.vtmat.vtmeta | 11 +- .../playerCharacter_sk.vtmesh.vtmeta | 11 +- .../playerCharacter_sk.vtsk.vtmeta | 11 +- .../Player Test/playerIdle_anim.fbx.vtmeta | 11 +- .../Player Test/playerIdle_anim.vtanim.vtmeta | 11 +- .../Player Test/player_inAir_anim.fbx.vtmeta | 11 +- .../player_inAir_anim.vtanim.vtmeta | 11 +- .../Player Test/player_jumpUp_anim.fbx.vtmeta | 11 +- .../player_jumpUp_anim.vtanim.vtmeta | 11 +- .../player_landing_anim.fbx.vtmeta | 11 +- .../player_landing_anim.vtanim.vtmeta | 11 +- .../Player Test/player_run_anim.vtanim.vtmeta | 11 +- .../Player Test/player_sprint_anim.fbx.vtmeta | 11 +- .../player_sprint_anim.vtanim.vtmeta | 11 +- Volt/GraphKey/src/GraphKey/Node.h | 19 ++ .../Nodes/Animation/AnimationSwitchNode.cpp | 24 +- .../Nodes/Animation/BaseAnimationNodes.cpp | 2 +- .../GraphKey/Nodes/Animation/BlendNodes.cpp | 24 +- .../Nodes/Animation/SequenceNodes.cpp | 2 +- .../SrtateMachineTransitionNodes.cpp | 33 ++ .../Animation/SrtateMachineTransitionNodes.h | 23 ++ .../Nodes/Animation/StateMachineNodes.cpp | 9 +- .../Nodes/Animation/StateMachineNodes.h | 1 + .../src/Sandbox/NodeGraph/IONodeGraphEditor.h | 1 + .../NodeGraph/NodeGraphEditorPinUtility.h | 25 +- .../src/Sandbox/Utility/EditorResources.cpp | 3 + .../src/Sandbox/Utility/EditorResources.h | 3 + .../AnimationGraph/AnimationGraphPanel.cpp | 6 - .../Volt/Animation/AnimationStateMachine.cpp | 109 ++++--- .../Volt/Animation/AnimationStateMachine.h | 3 - .../Volt/Animation/AnimationTransitionGraph.h | 13 +- .../src/Volt/Asset/Animation/Animation.cpp | 2 +- .../Asset/Animation/AnimationGraphAsset.cpp | 15 + .../Asset/Animation/AnimationGraphAsset.h | 7 + 59 files changed, 1060 insertions(+), 200 deletions(-) create mode 100644 Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds create mode 100644 Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds create mode 100644 Project/Assets/Player Test/CH_Player_01_MAT_C.dds create mode 100644 Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta create mode 100644 Project/Assets/Player Test/CH_Player_01_MAT_M.dds create mode 100644 Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta create mode 100644 Project/Assets/Player Test/CH_Player_01_MAT_N.dds create mode 100644 Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta create mode 100644 Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds create mode 100644 Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta create mode 100644 Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds create mode 100644 Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta create mode 100644 Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds create mode 100644 Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta create mode 100644 Project/Assets/Player Test/Test.vtanimgraph create mode 100644 Project/Assets/Player Test/Test.vtanimgraph.vtmeta create mode 100644 Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp create mode 100644 Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h diff --git a/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds new file mode 100644 index 000000000..5ae1ccdb6 --- /dev/null +++ b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4db0e3d663e0eaed354408cefe06bbb5ae0721cd515a76ba0d7d383696ce4310 +size 262292 diff --git a/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds new file mode 100644 index 000000000..903f26367 --- /dev/null +++ b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89ac12a94a505a16a90effe4aab7e410e6e30a0206d3d4d7ad9e018f417a74e3 +size 262292 diff --git a/Engine/Scripts/Volt-ScriptCore.dll b/Engine/Scripts/Volt-ScriptCore.dll index 1f4f36862..da735602c 100644 --- a/Engine/Scripts/Volt-ScriptCore.dll +++ b/Engine/Scripts/Volt-ScriptCore.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d7ef4f764ede3d846169e20a881adc302cc4bfae7171cee38d1c8aedb5d92386 +oid sha256:bbcbd0b31cc2769eda18bf6d2595e8e24bc546925a8ad9d40b71ba8d270ec53e size 101888 diff --git a/Engine/Scripts/Volt-ScriptCore.pdb b/Engine/Scripts/Volt-ScriptCore.pdb index 3e58ce7df..5dfb3602d 100644 --- a/Engine/Scripts/Volt-ScriptCore.pdb +++ b/Engine/Scripts/Volt-ScriptCore.pdb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:72e6208079961a2e8f5fe919a58c29fa010c2b96598799a966b02c933f39bee7 -size 48132 +oid sha256:b21266d878f844f2ee34979faabe179787e30363e50712aeeb0ff460e9d59fb5 +size 47992 diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph index a18cf812c..5481e3843 100644 --- a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph +++ b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph @@ -1,6 +1,6 @@ AnimationGraph: - state: "{\"nodes\":{\"node:14478923545599575399\":{\"location\":{\"x\":312,\"y\":-6}},\"node:17301805690779624226\":{\"location\":{\"x\":244,\"y\":198}},\"node:17868484199422907988\":{\"location\":{\"x\":488,\"y\":198}}},\"selection\":[\"node:17301805690779624226\"],\"view\":{\"scroll\":{\"x\":-68,\"y\":-184},\"zoom\":1}}" - skeleton: 10080715167332384675 + state: "{\"nodes\":{\"node:17301805690779624226\":{\"location\":{\"x\":260,\"y\":262}},\"node:17868484199422907988\":{\"location\":{\"x\":488,\"y\":198}},\"node:18363173312177694114\":{\"location\":{\"x\":435,\"y\":383}},\"node:4037372283017650440\":{\"location\":{\"x\":114,\"y\":66}}},\"selection\":[\"node:18363173312177694114\"],\"view\":{\"scroll\":{\"x\":128.620773315429688,\"y\":-0.04199981689453125},\"zoom\":1.5}}" + skeleton: 13037238043735750390 Graph: Nodes: - id: 17868484199422907988 @@ -15,12 +15,12 @@ AnimationGraph: [] - id: 17301805690779624226 type: StateMachineNode - state: "{\"location\":{\"x\":244,\"y\":198}}" + state: "{\"location\":{\"x\":260,\"y\":262}}" nodeSpecific: StateMachine: name: Main State Machine - editorState: "{\"nodes\":{\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}},\"node:5853113754576418241\":{\"location\":{\"x\":323,\"y\":378}}},\"selection\":[\"node:5853113754576418241\"],\"view\":{\"scroll\":{\"x\":93,\"y\":-43},\"zoom\":1}}" - skeletonHandle: 10080715167332384675 + editorState: "{\"nodes\":{\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}},\"node:5853113754576418241\":{\"location\":{\"x\":323,\"y\":378}}},\"selection\":[\"node:3681991280272765136\"],\"view\":{\"scroll\":{\"x\":-123.732566833496094,\"y\":-95.3266448974609375},\"zoom\":1.24999988079071045}}" + skeletonHandle: 13037238043735750390 States: - name: Entry isEntry: true @@ -53,7 +53,7 @@ AnimationGraph: - 2885412559387363311 - 1559816839792901889 - 10274687952614952111 - skeletonHandle: 10080715167332384675 + skeletonHandle: 13037238043735750390 Graph: Nodes: - id: 14536892748128745780 @@ -74,7 +74,7 @@ AnimationGraph: inputs: - name: "" id: 10580947816370530482 - data: 16802240511195054919 + data: 6258146775014869030 - name: Loop id: 123450497769363306 data: true @@ -96,6 +96,18 @@ AnimationGraph: type: Float id: 14724677624567781970 data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false Events: [] - name: Run @@ -108,7 +120,7 @@ AnimationGraph: Transitions: - 2885412559387363311 - 1559816839792901889 - skeletonHandle: 10080715167332384675 + skeletonHandle: 13037238043735750390 Graph: Nodes: - id: 13182824102293636283 @@ -129,7 +141,7 @@ AnimationGraph: inputs: - name: "" id: 10031653943577889520 - data: 1087306084089571470 + data: 6011248127994413100 - name: Loop id: 3012088715339929536 data: true @@ -151,6 +163,18 @@ AnimationGraph: type: Float id: 14724677624567781970 data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false Events: [] - name: StartJump @@ -163,7 +187,7 @@ AnimationGraph: Transitions: - 7924813067403359603 - 13269834706927116307 - skeletonHandle: 10080715167332384675 + skeletonHandle: 13037238043735750390 Graph: Nodes: - id: 12596166692664476774 @@ -184,7 +208,7 @@ AnimationGraph: inputs: - name: "" id: 16262223745919603949 - data: 9874085243310133722 + data: 6011248127994413100 - name: Loop id: 12070280934059552080 data: false @@ -231,7 +255,8 @@ AnimationGraph: - 16741418222055495425 - 4770872081588975154 - 13269834706927116307 - skeletonHandle: 10080715167332384675 + - 18199447053876155910 + skeletonHandle: 13037238043735750390 Graph: Nodes: - id: 10375549879072757522 @@ -252,7 +277,7 @@ AnimationGraph: inputs: - name: "" id: 10867885091214013952 - data: 16379139790018569206 + data: 18438903370085448471 - name: Loop id: 9146347772134529951 data: true @@ -298,12 +323,13 @@ AnimationGraph: Transitions: - 4770872081588975154 - 10274687952614952111 - skeletonHandle: 10080715167332384675 + - 18199447053876155910 + skeletonHandle: 13037238043735750390 Graph: Nodes: - id: 7972067113546953247 type: OutputPoseNode - state: "{\"location\":{\"x\":184,\"y\":134}}" + state: "{\"location\":{\"x\":328,\"y\":182}}" nodeSpecific: {} inputs: @@ -313,19 +339,19 @@ AnimationGraph: [] - id: 6123819316360548125 type: SequencePlayerNode - state: "{\"location\":{\"x\":72,\"y\":178}}" + state: "{\"location\":{\"x\":-8,\"y\":182}}" nodeSpecific: {} inputs: - name: "" id: 15254946406601266251 - data: 13719070777493897150 + data: 1783046688217532516 - name: Loop id: 1916361062164798703 data: false - name: Speed id: 2070241052447209235 - data: 100 + data: 4 - name: Apply Root Motion id: 8106797449584285687 data: false @@ -712,8 +738,8 @@ AnimationGraph: fromState: 5853113754576418241 toState: 3681991280272765136 hasExitTime: true - shouldBlend: true - blendTime: 1 + shouldBlend: false + blendTime: 0 Graph: Nodes: - id: 12685031745682105689 @@ -724,11 +750,24 @@ AnimationGraph: inputs: - name: Can Enter Transition id: 14146025927140979864 - data: true outputs: [] + - id: 16490412479619183933 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-185,\"y\":-10}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 11250599007969618501 + data: false Links: - [] + - id: 17348631575818981995 + output: 11250599007969618501 + input: 14146025927140979864 Parameters: - name: CurrentSpeed type: Float @@ -788,13 +827,226 @@ AnimationGraph: data: false Events: [] + - id: 18199447053876155910 + fromState: 5853113754576418241 + toState: 16788735106587868172 + hasExitTime: false + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 10638236518812433586 + type: TransitionOutputNode + state: "{\"location\":{\"x\":360,\"y\":6}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 4772559863186558065 + outputs: + [] + - id: 8299836028890960564 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-25,\"y\":6}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 10525197383903802877 + data: false + - id: 1144234582148848871 + type: NotNode + state: "{\"location\":{\"x\":136,\"y\":28}}" + nodeSpecific: + {} + inputs: + - name: Value + id: 1770400119402805745 + outputs: + - name: Result + id: 13456728752634676541 + data: false + Links: + - id: 2792116225498798359 + output: 10525197383903802877 + input: 1770400119402805745 + - id: 4713676757425803934 + output: 13456728752634676541 + input: 4772559863186558065 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] inputs: [] outputs: - name: Output id: 9596355334609294623 + - id: 4037372283017650440 + type: SequencePlayerNode + state: "{\"location\":{\"x\":114,\"y\":66}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 618220956437004201 + data: 6258146775014869030 + - name: Loop + id: 3114604204655010593 + data: true + - name: Speed + id: 16236054903193339643 + data: 6 + - name: Apply Root Motion + id: 7395332009648184810 + data: false + outputs: + - name: Output + id: 10069388367567677367 + - id: 18363173312177694114 + type: StateMachineNode + state: "{\"location\":{\"x\":435,\"y\":383}}" + nodeSpecific: + StateMachine: + name: New State Machine + editorState: "{\"nodes\":{\"node:10255543999415026575\":{\"location\":{\"x\":0,\"y\":0}},\"node:2824380456210401004\":{\"location\":{\"x\":3,\"y\":110}},\"node:8314527320702571076\":{\"location\":{\"x\":259,\"y\":-6}}},\"selection\":[\"node:2824380456210401004\"],\"view\":{\"scroll\":{\"x\":-150.780380249023438,\"y\":-193.987319946289062},\"zoom\":1.24999988079071045}}" + skeletonHandle: 13037238043735750390 + States: + - name: Entry + isEntry: true + isAny: false + editorState: "{\"location\":{\"x\":0,\"y\":0}}" + id: 10255543999415026575 + pinId: 4218612207817334503 + pinId2: 13512004326247544924 + Transitions: + - 9852413716433189781 + - name: Any + isEntry: false + isAny: true + editorState: "{\"location\":{\"x\":259,\"y\":-6}}" + id: 8314527320702571076 + pinId: 8215778157926147715 + pinId2: 11817364200069612898 + Transitions: + [] + - name: Idle + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":3,\"y\":110}}" + id: 2824380456210401004 + pinId: 6827110913530388880 + pinId2: 14061245127300807158 + Transitions: + - 9852413716433189781 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 16362999611899321912 + type: OutputPoseNode + state: "{\"location\":{\"x\":168,\"y\":6}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 13855760947205103266 + outputs: + [] + - id: 15603655444273743752 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-190,\"y\":-6}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 3396135448745199814 + data: 6258146775014869030 + - name: Loop + id: 12282045701194949945 + data: true + - name: Speed + id: 5884609386405628936 + data: 1 + - name: Apply Root Motion + id: 15032609613315241840 + data: false + outputs: + - name: Output + id: 2322189099458714193 + Links: + - id: 320056135243155510 + output: 2322189099458714193 + input: 13855760947205103266 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + Transitions: + - id: 9852413716433189781 + fromState: 10255543999415026575 + toState: 2824380456210401004 + hasExitTime: false + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 13130306270108144217 + type: TransitionOutputNode + state: "" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 7560125829164143497 + data: false + outputs: + [] + Links: + [] + Parameters: + [] + Events: + [] + inputs: + [] + outputs: + - name: Output + id: 17146453387266039233 Links: - - id: 9171493557640758720 + - id: 9127606745776540744 output: 9596355334609294623 input: 15529003614232630594 Parameters: diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta index 9de862130..eaad5da92 100644 --- a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta +++ b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta @@ -1,4 +1,7 @@ -Handle: 2896570904865207590 -Path: Assets/Player Test/AG_NewAnimationGraph.vtanimgraph -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 4734108098716078210 + filePath: Assets/Player Test/AG_NewAnimationGraph.vtanimgraph + type: 131072 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_C.dds b/Project/Assets/Player Test/CH_Player_01_MAT_C.dds new file mode 100644 index 000000000..b8cc06ca0 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_01_MAT_C.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02c41edb822ad5a1b6a30bdd9fb28c32204f984642f63e67082bc00468f25257 +size 1398276 diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta b/Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta new file mode 100644 index 000000000..b82338587 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 9631924488118293224 + filePath: Assets/Player Test/CH_Player_01_MAT_C.dds + type: 16 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_M.dds b/Project/Assets/Player Test/CH_Player_01_MAT_M.dds new file mode 100644 index 000000000..df51c8cf7 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_01_MAT_M.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e7c4667dbca4aaa637614d72dee941ed87f4e1efc974c6efe583319262897fc +size 1398276 diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta b/Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta new file mode 100644 index 000000000..b23ff4966 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 12685627588652671323 + filePath: Assets/Player Test/CH_Player_01_MAT_M.dds + type: 16 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_N.dds b/Project/Assets/Player Test/CH_Player_01_MAT_N.dds new file mode 100644 index 000000000..a5733facc --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_01_MAT_N.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48a5b2ca39011a5bbc4c157d4478f1ec5717c1e535557261a1320f543f023c9a +size 1398276 diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta b/Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta new file mode 100644 index 000000000..e006a9501 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 17652342456126291493 + filePath: Assets/Player Test/CH_Player_01_MAT_N.dds + type: 16 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds new file mode 100644 index 000000000..fde532b14 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7eefa8daa3c628253e6eaea8c7265aee1317cf2ac8c39b72830b9d430a3a7552 +size 1398276 diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta new file mode 100644 index 000000000..a6cfc9037 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 2608646360106569445 + filePath: Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds + type: 16 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds new file mode 100644 index 000000000..fc18e44d9 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e8065e786193b968de1faf0581623681488c2da8f5853ff018b1c4de2bd25b2 +size 1398276 diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta new file mode 100644 index 000000000..71e400182 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 5663274028817352781 + filePath: Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds + type: 16 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds new file mode 100644 index 000000000..a5733facc --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48a5b2ca39011a5bbc4c157d4478f1ec5717c1e535557261a1320f543f023c9a +size 1398276 diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta new file mode 100644 index 000000000..010ec89a1 --- /dev/null +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 17419715416009506023 + filePath: Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds + type: 16 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/Player.cs.vtmeta b/Project/Assets/Player Test/Player.cs.vtmeta index ffb0e5ec7..f89d27355 100644 --- a/Project/Assets/Player Test/Player.cs.vtmeta +++ b/Project/Assets/Player Test/Player.cs.vtmeta @@ -1,4 +1,7 @@ -Handle: 16164390882708253215 -Path: Assets/Player Test/Player.cs -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 4232354692353249525 + filePath: Assets/Player Test/Player.cs + type: 524288 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer b/Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer index 8265a445d..34c468975 100644 --- a/Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer +++ b/Project/Assets/Player Test/PlayerTestGym/Layers/layer_0.vtlayer @@ -419,11 +419,11 @@ Layer: - type: 16 vectorType: 13 name: Animation Graph - data: 6090874269170405106 + data: 4734108098716078210 - type: 16 vectorType: 13 name: Material - data: 0 + data: 10717049606619290080 - type: 16 vectorType: 13 name: Override Skin @@ -476,11 +476,11 @@ Layer: - type: 16 vectorType: 13 name: Mesh - data: 2266006686789750075 + data: 15314435918099419685 - type: 16 vectorType: 13 name: Material - data: 0 + data: 10717049606619290080 - guid: [5428802467633469958, 3006162545260469436] properties: - type: 21 @@ -492,16 +492,16 @@ Layer: vectorType: 16 name: ScriptIds data: - - value: 17153352387063866732 + - value: 2236035842924872221 MonoScripts: - ScriptEntry: name: Project.Player - id: 17153352387063866732 + id: 2236035842924872221 properties: - type: 7 name: acceleration enumName: "" - data: 10 + data: 15 - type: 7 name: runSpeed enumName: "" @@ -513,7 +513,7 @@ Layer: - type: 7 name: deceleration enumName: "" - data: 800 + data: 30 - type: 7 name: jumpForce enumName: "" @@ -762,6 +762,88 @@ Layer: vectorType: 13 name: Material data: 0 + - Entity: + id: 3811384406 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: playerCharacter_sk + - guid: [4626977537440075682, 8666096866538760379] + properties: + - type: 16 + vectorType: 13 + name: Animation Graph + data: 9824459651317056180 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - type: 16 + vectorType: 13 + name: Override Skin + data: 0 + - type: 0 + vectorType: 13 + name: Apply Root Motion + data: false + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [131.705002, 0, -3.02999997] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 15314435918099419685 + - type: 16 + vectorType: 13 + name: Material + data: 0 - Entity: id: 4018203657 components: diff --git a/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta index 47e21f604..3c3e97cdb 100644 --- a/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta +++ b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta @@ -1,4 +1,7 @@ -Handle: 11781743913864354695 -Path: Assets/Player Test/PlayerTestGym/New Scene.vtscene -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 16356918977103702973 + filePath: Assets/Player Test/PlayerTestGym/New Scene.vtscene + type: 256 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/Test.vtanimgraph b/Project/Assets/Player Test/Test.vtanimgraph new file mode 100644 index 000000000..9074ba320 --- /dev/null +++ b/Project/Assets/Player Test/Test.vtanimgraph @@ -0,0 +1,259 @@ +AnimationGraph: + state: "{\"nodes\":{\"node:1006070039772890228\":{\"location\":{\"x\":-168,\"y\":558}},\"node:10699787631764274471\":{\"location\":{\"x\":-152,\"y\":1078}},\"node:11354558835617312324\":{\"location\":{\"x\":-184,\"y\":470}},\"node:16711666180004131191\":{\"location\":{\"x\":-168,\"y\":834}},\"node:17016064579008095314\":{\"location\":{\"x\":155,\"y\":207}},\"node:17799981009668987651\":{\"location\":{\"x\":-232,\"y\":174}},\"node:18054270757268510857\":{\"location\":{\"x\":-184,\"y\":-18}},\"node:2694319636063669802\":{\"location\":{\"x\":-168,\"y\":694}},\"node:3083746622885143771\":{\"location\":{\"x\":-152,\"y\":1254}},\"node:341966602745090179\":{\"location\":{\"x\":-200,\"y\":330}},\"node:3782040649102992905\":{\"location\":{\"x\":-152,\"y\":1158}},\"node:4344419824704500793\":{\"location\":{\"x\":248,\"y\":-42}},\"node:7656389100798975303\":{\"location\":{\"x\":-152,\"y\":1382}},\"node:8044127385527085030\":{\"location\":{\"x\":-155,\"y\":998}},\"node:8923098434624100022\":{\"location\":{\"x\":-152,\"y\":1518}}},\"selection\":null,\"view\":{\"scroll\":{\"x\":-372.109710693359375,\"y\":1365.4534912109375},\"zoom\":1.49999988079071045}}" + skeleton: 13037238043735750390 + Graph: + Nodes: + - id: 17016064579008095314 + type: OutputPoseNode + state: "{\"location\":{\"x\":155,\"y\":207}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 8912193043255975237 + outputs: + [] + - id: 17799981009668987651 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-232,\"y\":174}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 8217612451253235622 + data: 1783046688217532516 + - name: Loop + id: 14738987251851020954 + data: true + - name: Speed + id: 13280973409413485598 + data: 1 + - name: Apply Root Motion + id: 4771715777244753111 + data: false + outputs: + - name: Output + id: 7602683736179524479 + - id: 341966602745090179 + type: GetAnimationDurationNode + state: "{\"location\":{\"x\":-200,\"y\":330}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 15801239787672910807 + data: 0 + - name: Speed + id: 6794737750940670423 + data: 1 + - name: Duration + id: 15125627446645641498 + data: 1 + outputs: + - name: Duration + id: 4806198076403676149 + data: 0 + - name: Speed + id: 8789406319326525832 + data: 0 + - id: 11354558835617312324 + type: OutputPoseNode + state: "{\"location\":{\"x\":-184,\"y\":470}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 28738994016088801 + outputs: + [] + - id: 1006070039772890228 + type: CrossfadeNode + state: "{\"location\":{\"x\":-168,\"y\":558}}" + nodeSpecific: + {} + inputs: + - name: A + id: 6940482675611503736 + - name: B + id: 1861340288714725484 + - name: Alpha + id: 13747882242583734845 + data: 0 + outputs: + - name: Result + id: 919130576860396977 + - id: 2694319636063669802 + type: AdditiveNode + state: "{\"location\":{\"x\":-168,\"y\":694}}" + nodeSpecific: + {} + inputs: + - name: Base Pose + id: 17903323408703615758 + - name: Additive Pose + id: 2893155668619357030 + - name: Alpha + id: 15690387277251830268 + data: 0 + outputs: + - name: Result + id: 11200111019111597069 + - id: 16711666180004131191 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-168,\"y\":834}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 374909589740975642 + data: 0 + - name: Loop + id: 3590531738909806677 + data: false + - name: Speed + id: 17598008580947810852 + data: 1 + - name: Apply Root Motion + id: 8620450836622512981 + data: false + outputs: + - name: Output + id: 1437291778259308082 + - id: 8044127385527085030 + type: StateMachineNode + state: "{\"location\":{\"x\":-155,\"y\":998}}" + nodeSpecific: + StateMachine: + name: New State Machine + editorState: "" + skeletonHandle: 13037238043735750390 + States: + - name: Entry + isEntry: true + isAny: false + editorState: "" + id: 15510741132668245506 + pinId: 4655723520876113213 + pinId2: 18402467573497219598 + Transitions: + [] + - name: Any + isEntry: false + isAny: true + editorState: "" + id: 18366179445935695121 + pinId: 10222200494814651963 + pinId2: 9655532096060700653 + Transitions: + [] + Transitions: + [] + inputs: + [] + outputs: + - name: Output + id: 1073184117691252953 + - id: 10699787631764274471 + type: TransitionOutputNode + state: "{\"location\":{\"x\":-152,\"y\":1078}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 4300427149542576420 + data: false + outputs: + [] + - id: 3782040649102992905 + type: BlendSpaceNode + state: "{\"location\":{\"x\":-152,\"y\":1158}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 16066883391581954022 + data: 0 + - name: Value + id: 12347889574742708072 + data: [0, 0] + outputs: + - name: Result + id: 15972977011056892429 + - id: 3083746622885143771 + type: LayeredBlendPerBoneNode + state: "{\"location\":{\"x\":-152,\"y\":1254}}" + nodeSpecific: + BlendIncludeFilters: + [] + BlendExcludeFilters: + [] + inputs: + - name: Base Pose + id: 7182468989071234212 + - name: Blend Pose + id: 11068097245599357146 + - name: Alpha + id: 11658164279991482374 + data: 0 + outputs: + - name: Result + id: 10849653976842996484 + - id: 7656389100798975303 + type: RotateBoneNode + state: "{\"location\":{\"x\":-152,\"y\":1382}}" + nodeSpecific: + {} + inputs: + - name: Pose + id: 15851200680865289277 + - name: Bone Name + id: 3808384462121841859 + data: "" + - name: Rotation + id: 13641366384143608299 + data: [0, 0, 0] + outputs: + - name: Result + id: 193713925641608444 + - id: 8923098434624100022 + type: AnimationSwitchNode + state: "{\"location\":{\"x\":-152,\"y\":1518}}" + nodeSpecific: + {} + inputs: + - name: Value + id: 10908805887829639274 + data: 0 + - name: 0 + id: 5261958324199283905 + - name: 1 + id: 5939175278023374616 + - name: 2 + id: 12136272998889868579 + - name: 3 + id: 5644931588880017774 + - name: 4 + id: 4594430831763283516 + - name: 5 + id: 10039462605218388148 + - name: 6 + id: 18111954152780173769 + - name: 7 + id: 11397483191819618131 + - name: 8 + id: 4108524099607527985 + - name: 9 + id: 15334696522250511371 + - name: 10 + id: 15119129556684598369 + outputs: + - name: Output + id: 8226194051794537 + Links: + - id: 11013626773313563736 + output: 7602683736179524479 + input: 8912193043255975237 + Parameters: + [] + Events: + [] \ No newline at end of file diff --git a/Project/Assets/Player Test/Test.vtanimgraph.vtmeta b/Project/Assets/Player Test/Test.vtanimgraph.vtmeta new file mode 100644 index 000000000..985d935e5 --- /dev/null +++ b/Project/Assets/Player Test/Test.vtanimgraph.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 9824459651317056180 + filePath: Assets/Player Test/Test.vtanimgraph + type: 131072 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta index d1ae328c5..76ff2a41b 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta @@ -1,4 +1,7 @@ -Handle: 7909096447964860586 -Path: Assets/Player Test/playerCharacter_sk.fbx -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 7131475977284553944 + filePath: Assets/Player Test/playerCharacter_sk.fbx + type: 2 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmat b/Project/Assets/Player Test/playerCharacter_sk.vtmat index 037f77f19..4ec7c3fc9 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.vtmat +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:affce77b0d51df5d500cbb0661f471f580a2128cee5288666690c7563b6a54fd -size 1707 +oid sha256:98ccbf46eb454d7bc8502d109d6354637a698c14e921e20d9811c424e4b49cd2 +size 1818 diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta index ed252847f..9587dd870 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta @@ -1,4 +1,7 @@ -Handle: 15849153362820611389 -Path: Assets/Player Test/playerCharacter_sk.vtmat -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 10717049606619290080 + filePath: Assets/Player Test/playerCharacter_sk.vtmat + type: 32 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta index 1e5180051..7fbc8c5ef 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta @@ -1,4 +1,7 @@ -Handle: 9098645144163709913 -Path: Assets/Player Test/playerCharacter_sk.vtmesh -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 15314435918099419685 + filePath: Assets/Player Test/playerCharacter_sk.vtmesh + type: 1 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta index e75a9f535..dc361688a 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta @@ -1,4 +1,7 @@ -Handle: 10080715167332384675 -Path: Assets/Player Test/playerCharacter_sk.vtsk -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 13037238043735750390 + filePath: Assets/Player Test/playerCharacter_sk.vtsk + type: 8 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta b/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta index 8fc21061c..aa3736cbd 100644 --- a/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta @@ -1,4 +1,7 @@ -Handle: 4503334044421001517 -Path: Assets/Player Test/playerIdle_anim.fbx -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 7863969560167659036 + filePath: Assets/Player Test/playerIdle_anim.fbx + type: 2 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta b/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta index f582e1bd3..59e045bc7 100644 --- a/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta @@ -1,4 +1,7 @@ -Handle: 16802240511195054919 -Path: Assets/Player Test/playerIdle_anim.vtanim -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 6258146775014869030 + filePath: Assets/Player Test/playerIdle_anim.vtanim + type: 4 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta b/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta index 962179294..2ffd72584 100644 --- a/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta @@ -1,4 +1,7 @@ -Handle: 14167442283478199722 -Path: Assets/Player Test/player_inAir_anim.fbx -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 668370251908861470 + filePath: Assets/Player Test/player_inAir_anim.fbx + type: 2 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta index 9b3b97d28..e385c6b18 100644 --- a/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta @@ -1,4 +1,7 @@ -Handle: 16379139790018569206 -Path: Assets/Player Test/player_inAir_anim.vtanim -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 18438903370085448471 + filePath: Assets/Player Test/player_inAir_anim.vtanim + type: 4 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta b/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta index 57573dbe2..43e94ee07 100644 --- a/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta @@ -1,4 +1,7 @@ -Handle: 13207614601213847269 -Path: Assets/Player Test/player_jumpUp_anim.fbx -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 4445321090449276063 + filePath: Assets/Player Test/player_jumpUp_anim.fbx + type: 2 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta index 90e3b4e86..c980f048b 100644 --- a/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta @@ -1,4 +1,7 @@ -Handle: 9874085243310133722 -Path: Assets/Player Test/player_jumpUp_anim.vtanim -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 92487431340345286 + filePath: Assets/Player Test/player_jumpUp_anim.vtanim + type: 4 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta b/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta index acfb5ab99..ba5457b55 100644 --- a/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta @@ -1,4 +1,7 @@ -Handle: 16582168720100222204 -Path: Assets/Player Test/player_landing_anim.fbx -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 11907945305765132793 + filePath: Assets/Player Test/player_landing_anim.fbx + type: 2 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta index 31e9f3dfd..0df9c37d0 100644 --- a/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta @@ -1,4 +1,7 @@ -Handle: 13719070777493897150 -Path: Assets/Player Test/player_landing_anim.vtanim -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 1783046688217532516 + filePath: Assets/Player Test/player_landing_anim.vtanim + type: 4 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta index b7d741d17..968d052e4 100644 --- a/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta @@ -1,4 +1,7 @@ -Handle: 1087306084089571470 -Path: Assets/Player Test/player_run_anim.vtanim -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 6011248127994413100 + filePath: Assets/Player Test/player_run_anim.vtanim + type: 4 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta b/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta index 07410b60a..da35dead7 100644 --- a/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta @@ -1,4 +1,7 @@ -Handle: 14967198796169727603 -Path: Assets/Player Test/player_sprint_anim.fbx -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 13913202096580181046 + filePath: Assets/Player Test/player_sprint_anim.fbx + type: 2 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta index 7f4f9943e..bf5a7566f 100644 --- a/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta @@ -1,4 +1,7 @@ -Handle: 15479924379188462583 -Path: Assets/Player Test/player_sprint_anim.vtanim -Dependencies: - [] \ No newline at end of file +Metadata: + assetHandle: 6771955893741976960 + filePath: Assets/Player Test/player_sprint_anim.vtanim + type: 4 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Volt/GraphKey/src/GraphKey/Node.h b/Volt/GraphKey/src/GraphKey/Node.h index a1ad391c1..d7050a6e4 100644 --- a/Volt/GraphKey/src/GraphKey/Node.h +++ b/Volt/GraphKey/src/GraphKey/Node.h @@ -24,6 +24,7 @@ namespace GraphKey { Flow, Type, + AnimationPose, }; enum class AttributeDirection @@ -83,6 +84,9 @@ namespace GraphKey Attribute AttributeConfig(const std::string& name, AttributeDirection direction, const std::function& function = nullptr); + template + Attribute AttributeConfigAnimationPose(const std::string& name, AttributeDirection direction, const std::function& function = nullptr); + template const T& GetInput(uint32_t index); @@ -145,6 +149,21 @@ namespace GraphKey } + template + inline Attribute Node::AttributeConfigAnimationPose(const std::string& name, AttributeDirection direction, const std::function& function) + { + Attribute attr{}; + attr.name = name; + attr.direction = direction; + attr.inputHidden = false; + attr.linkable = true; + attr.function = function; + attr.data = T(); + attr.type = AttributeType::AnimationPose; + + return attr; + } + template inline const T& Node::GetInput(uint32_t index) { diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/AnimationSwitchNode.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/AnimationSwitchNode.cpp index c9d9c57d0..61f9fde56 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/AnimationSwitchNode.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/AnimationSwitchNode.cpp @@ -10,22 +10,22 @@ namespace GraphKey inputs = { AttributeConfigDefault("Value", AttributeDirection::Input, int32_t(0)), - AttributeConfig("0", AttributeDirection::Input), - AttributeConfig("1", AttributeDirection::Input), - AttributeConfig("2", AttributeDirection::Input), - AttributeConfig("3", AttributeDirection::Input), - AttributeConfig("4", AttributeDirection::Input), - AttributeConfig("5", AttributeDirection::Input), - AttributeConfig("6", AttributeDirection::Input), - AttributeConfig("7", AttributeDirection::Input), - AttributeConfig("8", AttributeDirection::Input), - AttributeConfig("9", AttributeDirection::Input), - AttributeConfig("10", AttributeDirection::Input) + AttributeConfigAnimationPose("0", AttributeDirection::Input), + AttributeConfigAnimationPose("1", AttributeDirection::Input), + AttributeConfigAnimationPose("2", AttributeDirection::Input), + AttributeConfigAnimationPose("3", AttributeDirection::Input), + AttributeConfigAnimationPose("4", AttributeDirection::Input), + AttributeConfigAnimationPose("5", AttributeDirection::Input), + AttributeConfigAnimationPose("6", AttributeDirection::Input), + AttributeConfigAnimationPose("7", AttributeDirection::Input), + AttributeConfigAnimationPose("8", AttributeDirection::Input), + AttributeConfigAnimationPose("9", AttributeDirection::Input), + AttributeConfigAnimationPose("10", AttributeDirection::Input) }; outputs = { - AttributeConfig("Output", AttributeDirection::Output, GK_BIND_FUNCTION(AnimationSwitchNode::GetSwitchedAnimation)) + AttributeConfigAnimationPose("Output", AttributeDirection::Output, GK_BIND_FUNCTION(AnimationSwitchNode::GetSwitchedAnimation)) }; } diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp index ffcc211c6..7bfe851f6 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BaseAnimationNodes.cpp @@ -12,7 +12,7 @@ namespace GraphKey { inputs = { - AttributeConfig("Result", AttributeDirection::Input) + AttributeConfigAnimationPose("Result", AttributeDirection::Input) }; } diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp index 8ae937f52..eeee1aa2d 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/BlendNodes.cpp @@ -15,14 +15,14 @@ namespace GraphKey { inputs = { - AttributeConfig("A", AttributeDirection::Input), - AttributeConfig("B", AttributeDirection::Input), + AttributeConfigAnimationPose("A", AttributeDirection::Input), + AttributeConfigAnimationPose("B", AttributeDirection::Input), AttributeConfigDefault("Alpha", AttributeDirection::Input, 0.f) }; outputs = { - AttributeConfig("Result", AttributeDirection::Output, GK_BIND_FUNCTION(CrossfadeNode::TryApplyCrossfade)) + AttributeConfigAnimationPose("Result", AttributeDirection::Output, GK_BIND_FUNCTION(CrossfadeNode::TryApplyCrossfade)) }; } @@ -59,14 +59,14 @@ namespace GraphKey { inputs = { - AttributeConfig("Base Pose", AttributeDirection::Input), - AttributeConfig("Additive Pose", AttributeDirection::Input), + AttributeConfigAnimationPose("Base Pose", AttributeDirection::Input), + AttributeConfigAnimationPose("Additive Pose", AttributeDirection::Input), AttributeConfigDefault("Alpha", AttributeDirection::Input, 0.f) }; outputs = { - AttributeConfig("Result", AttributeDirection::Output, GK_BIND_FUNCTION(AdditiveNode::TryApplyAdditive)) + AttributeConfigAnimationPose("Result", AttributeDirection::Output, GK_BIND_FUNCTION(AdditiveNode::TryApplyAdditive)) }; } @@ -121,7 +121,7 @@ namespace GraphKey outputs = { - AttributeConfig("Result", AttributeDirection::Output, GK_BIND_FUNCTION(BlendSpaceNode::Sample)) + AttributeConfigAnimationPose("Result", AttributeDirection::Output, GK_BIND_FUNCTION(BlendSpaceNode::Sample)) }; } @@ -351,14 +351,14 @@ namespace GraphKey { inputs = { - AttributeConfig("Base Pose", AttributeDirection::Input), - AttributeConfig("Blend Pose", AttributeDirection::Input), + AttributeConfigAnimationPose("Base Pose", AttributeDirection::Input), + AttributeConfigAnimationPose("Blend Pose", AttributeDirection::Input), AttributeConfigDefault("Alpha", AttributeDirection::Input, 0.f) }; outputs = { - AttributeConfig("Result", AttributeDirection::Output, GK_BIND_FUNCTION(LayeredBlendPerBoneNode::TryApplyLayeredBlendPerBone)) + AttributeConfigAnimationPose("Result", AttributeDirection::Output, GK_BIND_FUNCTION(LayeredBlendPerBoneNode::TryApplyLayeredBlendPerBone)) }; } @@ -499,14 +499,14 @@ namespace GraphKey { inputs = { - AttributeConfig("Pose", AttributeDirection::Input), + AttributeConfigAnimationPose("Pose", AttributeDirection::Input), AttributeConfigDefault("Bone Name", AttributeDirection::Input, std::string("")), AttributeConfigDefault("Rotation", AttributeDirection::Input, glm::vec3{ 0.f }) }; outputs = { - AttributeConfig("Result", AttributeDirection::Output, GK_BIND_FUNCTION(RotateBoneNode::RotateBone)) + AttributeConfigAnimationPose("Result", AttributeDirection::Output, GK_BIND_FUNCTION(RotateBoneNode::RotateBone)) }; } diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp index ff9e304cb..cb5970f00 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp @@ -31,7 +31,7 @@ namespace GraphKey outputs = { - AttributeConfig("Output", AttributeDirection::Output, GK_BIND_FUNCTION(SequencePlayerNode::TrySampleAnimation)) + AttributeConfigAnimationPose("Output", AttributeDirection::Output, GK_BIND_FUNCTION(SequencePlayerNode::TrySampleAnimation)) }; } diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp new file mode 100644 index 000000000..572d42e5f --- /dev/null +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp @@ -0,0 +1,33 @@ +#include "gkpch.h" +#include "SrtateMachineTransitionNodes.h" + +#include +#include + +#include +#include +#include + + + +GraphKey::GetRelevantAnimationLengthNode::GetRelevantAnimationLengthNode() +{ + outputs = + { + AttributeConfigDefault("Return Value", AttributeDirection::Output, 0.f, false, GK_BIND_FUNCTION(GetRelevantAnimationLength)) + }; +} + +void GraphKey::GetRelevantAnimationLengthNode::GetRelevantAnimationLength() +{ + auto animTransitionGraph = static_cast(myGraph); + auto stateMachine = animTransitionGraph->GetStateMachine(); + auto transition = stateMachine->GetTransitionById(animTransitionGraph->GetTransitionID()); + auto fromState = stateMachine->GetStateById(transition->fromState); + Volt::AssetHandle relevantAnimationHandle = fromState->stateGraph->GetRelevantAnimationHandle(); + + auto relevantAnimation = Volt::AssetManager::GetAsset(relevantAnimationHandle); + + float length = relevantAnimation->GetDuration(); + SetOutputData(0, length); +} diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h new file mode 100644 index 000000000..63a3bec78 --- /dev/null +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h @@ -0,0 +1,23 @@ +#pragma once +#include "GraphKey/Node.h" +#include "Volt/Core/Base.h" +namespace Volt +{ + class Animation; +} +namespace GraphKey +{ + class GetRelevantAnimationLengthNode : public Node + { + public: + GetRelevantAnimationLengthNode(); + ~GetRelevantAnimationLengthNode() override = default; + + inline const std::string GetName() override { return "Get Relevant Animation Length"; } + inline const glm::vec4 GetColor() override { return { 1.f }; } + private: + void GetRelevantAnimationLength(); + }; + + //class GetRelevantAnimationTime +} diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp index 48cb5a0b2..2b0a61bee 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp @@ -16,7 +16,7 @@ namespace GraphKey { outputs = { - AttributeConfig("Output", AttributeDirection::Output, GK_BIND_FUNCTION(StateMachineNode::SampleStateMachine)) + AttributeConfigAnimationPose("Output", AttributeDirection::Output, GK_BIND_FUNCTION(StateMachineNode::SampleStateMachine)) }; } @@ -96,7 +96,6 @@ namespace GraphKey VT_SERIALIZE_PROPERTY(id, transition->id, out); VT_SERIALIZE_PROPERTY(fromState, transition->fromState, out); VT_SERIALIZE_PROPERTY(toState, transition->toState, out); - VT_SERIALIZE_PROPERTY(hasExitTime, transition->hasExitTime, out); VT_SERIALIZE_PROPERTY(shouldBlend, transition->shouldBlend, out); VT_SERIALIZE_PROPERTY(blendTime, transition->blendTime, out); @@ -174,14 +173,16 @@ namespace GraphKey auto newTransition = myStateMachine->CreateTransition(transitionId); newTransition->fromState = transitionFromState; newTransition->toState = transitionToState; - - VT_DESERIALIZE_PROPERTY(hasExitTime, newTransition->hasExitTime, transitionNode, false); + VT_DESERIALIZE_PROPERTY(shouldBlend, newTransition->shouldBlend, transitionNode, false); VT_DESERIALIZE_PROPERTY(blendTime, newTransition->blendTime, transitionNode, 1.f); if (transitionNode["Graph"]) { newTransition->transitionGraph = CreateRef(); + newTransition->transitionGraph->SetStateMachine(myStateMachine.get()); + newTransition->transitionGraph->SetTransitionID(transitionId); + Graph::Deserialize(std::reinterpret_pointer_cast(newTransition->transitionGraph), transitionNode["Graph"]); } } diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.h b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.h index e5fc17236..8171695b9 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.h +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.h @@ -27,4 +27,5 @@ namespace GraphKey Ref myStateMachine; void SampleStateMachine(); }; + } diff --git a/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h b/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h index b20eeabea..fd54689f0 100644 --- a/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h +++ b/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h @@ -1505,6 +1505,7 @@ inline void IONodeGraphEditor::DrawPinIcon(const Graph { case GraphKey::AttributeType::Flow: iconType = IconType::Flow; break; case GraphKey::AttributeType::Type: iconType = IconType::Circle; break; + case GraphKey::AttributeType::AnimationPose: iconType = IconType::AnimationPose; break; default: return; diff --git a/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditorPinUtility.h b/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditorPinUtility.h index 26ebf671e..f5fdeee4b 100644 --- a/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditorPinUtility.h +++ b/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditorPinUtility.h @@ -1,7 +1,8 @@ #pragma once #include - +#include "Sandbox/Utility/EditorResources.h" +#include "Volt/Rendering/Texture/Texture2D.h" enum class IconType : ImU32 { Flow, @@ -9,7 +10,8 @@ enum class IconType : ImU32 Square, Grid, RoundSquare, - Diamond + Diamond, + AnimationPose }; inline static void DrawIconKey(ImDrawList* drawList, const ImVec2& a, const ImVec2& b, IconType type, bool filled, ImU32 color, ImU32 innerColor) @@ -84,6 +86,25 @@ inline static void DrawIconKey(ImDrawList* drawList, const ImVec2& a, const ImVe else drawList->PathFillConvex(color); } + else if (type == IconType::AnimationPose) + { + Ref texture; + if (filled) + { + texture = EditorResources::GetEditorIcon(EditorIcon::GraphPinAnimationPoseFilled); + } + else + { + texture = EditorResources::GetEditorIcon(EditorIcon::GraphPinAnimationPose); + } + if (texture) + { + if (texture->IsValid()) + { + drawList->AddImage(UI::GetTextureID(texture), rect.Min, rect.Max, ImVec2(0, 0), ImVec2(1, 1), color); + } + } + } else { auto triangleStart = rect_center_x + 0.32f * rect_w; diff --git a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp index d5ea4eed5..edee17723 100644 --- a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp +++ b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp @@ -80,6 +80,9 @@ void EditorResources::Initialize() myEditorIcons[EditorIcon::Swap] = TryLoadIcon("Editor/Textures/Icons/icon_swap.dds"); myEditorIcons[EditorIcon::Remove] = TryLoadIcon("Editor/Textures/Icons/icon_remove.dds"); + myEditorIcons[EditorIcon::GraphPinAnimationPose] = TryLoadIcon("Editor/Textures/Icons/icon_graph_pin_anim_pose.dds"); + myEditorIcons[EditorIcon::GraphPinAnimationPoseFilled] = TryLoadIcon("Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds"); + myEditorIcons[EditorIcon::Volt] = TryLoadIcon("Editor/Textures/Icons/icon_volt.dds"); } diff --git a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h index 208f63d6e..ac6b1a571 100644 --- a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h +++ b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h @@ -54,6 +54,9 @@ enum class EditorIcon Swap, Remove, + GraphPinAnimationPose, + GraphPinAnimationPoseFilled, + Volt, }; diff --git a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp index 9f94d9cea..fa942c525 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp @@ -895,12 +895,6 @@ void AnimationGraphPanel::DrawStateMachineProperties() UI::PushId(); if (UI::BeginProperties("transitionProperties")) { - UI::Property("Has Exit Time", transition->hasExitTime); - if (transition->hasExitTime) - { - UI::Property("Blend Start Time", transition->exitStartValue); - } - UI::Property("Should Blend", transition->shouldBlend); if (transition->shouldBlend) diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index bf2f2b328..a3b95c3a8 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -24,6 +24,7 @@ namespace Volt void AnimationStateMachine::Update(float deltaTime) { + // if no state is active, check if the entry state has any transitions and choose the first one if (myCurrentState == -1) { for (const auto& state : myStates) @@ -213,8 +214,10 @@ namespace Volt startState->transitions.emplace_back(transition->id); endState->transitions.emplace_back(transition->id); } - + transition->transitionGraph = CreateRef(); + transition->transitionGraph->SetStateMachine(this); + transition->transitionGraph->SetTransitionID(transition->id); transition->transitionGraph->AddNode(GraphKey::Registry::Create("TransitionOutputNode")); myTransitions.emplace_back(transition); } @@ -222,9 +225,9 @@ namespace Volt void AnimationStateMachine::RemoveState(const UUID id) { auto it = std::find_if(myStates.begin(), myStates.end(), [&id](const auto& lhs) - { - return lhs->id == id; - }); + { + return lhs->id == id; + }); if (it == myStates.end()) { @@ -243,9 +246,9 @@ namespace Volt void AnimationStateMachine::RemoveTransition(const UUID id) { auto it = std::find_if(myTransitions.begin(), myTransitions.end(), [&id](const auto& lhs) - { - return lhs->id == id; - }); + { + return lhs->id == id; + }); if (it == myTransitions.end()) { @@ -348,11 +351,13 @@ namespace Volt newTransition->id = transition->id; newTransition->fromState = transition->fromState; newTransition->toState = transition->toState; + newTransition->blendTime = transition->blendTime; - newTransition->hasExitTime = transition->hasExitTime; newTransition->shouldBlend = transition->shouldBlend; newTransition->transitionGraph = CreateRef(); + newTransition->transitionGraph->SetStateMachine(this); + newTransition->transitionGraph->SetTransitionID(newTransition->id); newTransition->transitionGraph->SetEntity(entity); GraphKey::Graph::Copy(transition->transitionGraph, newTransition->transitionGraph); @@ -383,46 +388,54 @@ namespace Volt return false; } - bool canTransition = transition->hasExitTime ? false : true; - - if (transition->hasExitTime) - { - const auto playerNodes = currentState->stateGraph->GetNodesOfType("SequencePlayerNode"); - - if (!playerNodes.empty()) - { - Ref longestAnimation; - Ref longestPlayer; - float longestAnimationTime = std::numeric_limits::lowest(); - for (const auto& player : playerNodes) - { - auto playerNodeType = std::reinterpret_pointer_cast(player); - auto anim = playerNodeType->GetAnimation(); - if (!anim || !anim->IsValid()) - { - continue; - } - - if (anim->GetDuration() > longestAnimationTime) - { - longestAnimationTime = anim->GetDuration(); - longestAnimation = anim; - longestPlayer = playerNodeType; - } - } - - if (longestPlayer) - { - const float animSpeed = longestPlayer->GetInput(2); - const float endTime = longestPlayer->GetAnimation()->GetDuration() * transition->exitStartValue; - - if (longestAnimation->IsAtEnd(currentState->startTime, animSpeed)/* || longestAnimation->HasPassedTime(currentState->startTime, animSpeed, endTime)*/) - { - canTransition = true; - } - } - } - } + bool canTransition = true;/*transition->hasExitTime ? false : true;*/ + + //if (transition->hasExitTime) + //{ + // const auto playerNodes = currentState->stateGraph->GetNodesOfType("SequencePlayerNode"); + + // if (!playerNodes.empty()) + // { + // Ref longestAnimation; + // Ref longestPlayer; + // float longestAnimationTime = std::numeric_limits::lowest(); + // for (const auto& player : playerNodes) + // { + // auto playerNodeType = std::reinterpret_pointer_cast(player); + // float speed = 1.f; + // for (auto& input : playerNodeType->inputs) + // { + // if (input.name == "Speed") + // { + // speed = std::any_cast(input.data); + // } + // } + // auto anim = playerNodeType->GetAnimation(); + // if (!anim || !anim->IsValid()) + // { + // continue; + // } + // const auto duration = (anim->GetDuration() * speed); + // if (duration > longestAnimationTime) + // { + // longestAnimationTime = anim->GetDuration() * speed; + // longestAnimation = anim; + // longestPlayer = playerNodeType; + // } + // } + + // if (longestPlayer) + // { + // const float animSpeed = longestPlayer->GetInput(2); + // const float endTime = longestAnimationTime * transition->exitStartValue; + + // if (longestAnimation->IsAtEnd(currentState->startTime, animSpeed)/* || longestAnimation->HasPassedTime(currentState->startTime, animSpeed, endTime)*/) + // { + // canTransition = true; + // } + // } + // } + //} auto transitionOutputNode = std::reinterpret_pointer_cast(nodes.front()); const bool result = transitionOutputNode->Evaluate(); diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h index 72b570b52..1031fa7c1 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h @@ -25,10 +25,7 @@ namespace Volt UUID fromState; UUID toState; - bool hasExitTime = false; bool shouldBlend = true; - float exitStartValue = 1.f; - float blendTime = 1.f; Ref transitionGraph; diff --git a/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h b/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h index b56fd63e9..9edd6d458 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h +++ b/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h @@ -1,19 +1,28 @@ #pragma once #include +#include namespace Volt { + class AnimationStateMachine; class AnimationTransitionGraph : public GraphKey::Graph { public: inline AnimationTransitionGraph() = default; inline ~AnimationTransitionGraph() override = default; - inline void SetState(const std::string& state) { myGraphState = state; } + inline void SetState(const std::string& aState) { myGraphState = aState; } inline const std::string& GetState() const { return myGraphState; } + inline void SetStateMachine(const AnimationStateMachine* aStateMachine) { myStateMachineWeak = aStateMachine; } + inline const AnimationStateMachine* GetStateMachine() const { return myStateMachineWeak; } + + inline void SetTransitionID(const UUID& aId) { myTransitionID = aId; } + inline const UUID& GetTransitionID() const { return myTransitionID; } private: std::string myGraphState; + const AnimationStateMachine* myStateMachineWeak; + UUID myTransitionID; }; -} \ No newline at end of file +} diff --git a/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp b/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp index 6af21fd4d..21765bcd5 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp +++ b/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp @@ -180,7 +180,7 @@ namespace Volt const Pose& nextFrame = myFrames.at(nextFrameIndex); const auto& joints = aSkeleton->GetJoints(); - + if (currentFrame.localTRS.size() < joints.size()) { return result; diff --git a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp index e501495eb..7ef493e13 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp +++ b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp @@ -2,6 +2,7 @@ #include "AnimationGraphAsset.h" #include +#include namespace Volt { @@ -14,6 +15,20 @@ namespace Volt return newGraph; } + AssetHandle AnimationGraphAsset::GetRelevantAnimationHandle() + { + auto sequencePlayerNodes = GetNodesOfType("Sequence Player"); + + if (sequencePlayerNodes.size() == 0) + return Asset::Null(); + + //TODO: Update this to check for all the relevant nodes + //TODO: Update this to have a relevancy order + auto sequencePlayerNode = std::dynamic_pointer_cast(sequencePlayerNodes[0]); + + return sequencePlayerNode->GetAnimation()->handle; + } + void AnimationGraphAsset::SetSkeletonHandle(AssetHandle aSkeletonHandle) { mySkeletonHandle = aSkeletonHandle; diff --git a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h index 9f663aac3..245f473f0 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h +++ b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h @@ -2,6 +2,11 @@ #include +namespace GraphKey +{ + struct Node; +} + namespace Volt { class AnimationGraphAsset : public GraphKey::Graph @@ -33,8 +38,10 @@ namespace Volt AssetType GetType() override { return GetStaticType(); }; Ref CreateCopy(Wire::EntityId entity = 0); + private: + Ref GetRelevantAnimationNode(); friend class AnimationGraphImporter; AssetHandle mySkeletonHandle = Asset::Null(); From 9df8a74e77703abf9f8e4e8944f27ec54f6d5ede Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Sun, 27 Aug 2023 21:36:38 +0200 Subject: [PATCH 03/18] Relevant animation nodes now work --- Engine/Scripts/Volt-ScriptCore.dll | 2 +- Engine/Scripts/Volt-ScriptCore.pdb | 2 +- .../AG_NewAnimationGraph.vtanimgraph | 697 ++++++++++++------ .../Nodes/Animation/SequenceNodes.cpp | 22 +- .../GraphKey/Nodes/Animation/SequenceNodes.h | 3 + .../SrtateMachineTransitionNodes.cpp | 33 - .../Animation/SrtateMachineTransitionNodes.h | 23 - .../Animation/StateMachineTransitionNodes.cpp | 105 +++ .../Animation/StateMachineTransitionNodes.h | 49 ++ .../src/GraphKey/Nodes/NodeRegistry.cpp | 6 + Volt/GraphKey/src/GraphKey/Registry.cpp | 2 +- .../Volt/Animation/AnimationStateMachine.cpp | 4 +- .../Volt/Animation/AnimationTransitionGraph.h | 4 +- .../src/Volt/Asset/Animation/Animation.cpp | 16 + .../Volt/src/Volt/Asset/Animation/Animation.h | 1 + .../Asset/Animation/AnimationGraphAsset.cpp | 12 +- .../Asset/Animation/AnimationGraphAsset.h | 2 +- 17 files changed, 668 insertions(+), 315 deletions(-) delete mode 100644 Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp delete mode 100644 Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h create mode 100644 Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp create mode 100644 Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.h diff --git a/Engine/Scripts/Volt-ScriptCore.dll b/Engine/Scripts/Volt-ScriptCore.dll index da735602c..f36d0ccb2 100644 --- a/Engine/Scripts/Volt-ScriptCore.dll +++ b/Engine/Scripts/Volt-ScriptCore.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bbcbd0b31cc2769eda18bf6d2595e8e24bc546925a8ad9d40b71ba8d270ec53e +oid sha256:e29c3f19d15612a2ff4f30fff882d2efae29559efe3ed40031d2fc5ea9551aee size 101888 diff --git a/Engine/Scripts/Volt-ScriptCore.pdb b/Engine/Scripts/Volt-ScriptCore.pdb index 5dfb3602d..127506e37 100644 --- a/Engine/Scripts/Volt-ScriptCore.pdb +++ b/Engine/Scripts/Volt-ScriptCore.pdb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b21266d878f844f2ee34979faabe179787e30363e50712aeeb0ff460e9d59fb5 +oid sha256:f86a917c215471d12b309a6484ece1926a00d4a44ff816d991da290de1523122 size 47992 diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph index 5481e3843..e2d233485 100644 --- a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph +++ b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph @@ -1,11 +1,11 @@ AnimationGraph: - state: "{\"nodes\":{\"node:17301805690779624226\":{\"location\":{\"x\":260,\"y\":262}},\"node:17868484199422907988\":{\"location\":{\"x\":488,\"y\":198}},\"node:18363173312177694114\":{\"location\":{\"x\":435,\"y\":383}},\"node:4037372283017650440\":{\"location\":{\"x\":114,\"y\":66}}},\"selection\":[\"node:18363173312177694114\"],\"view\":{\"scroll\":{\"x\":128.620773315429688,\"y\":-0.04199981689453125},\"zoom\":1.5}}" + state: "{\"nodes\":{\"node:13508735938561582046\":{\"location\":{\"x\":81,\"y\":118}},\"node:17301805690779624226\":{\"location\":{\"x\":36,\"y\":38}},\"node:17584398784418846919\":{\"location\":{\"x\":264,\"y\":86}},\"node:17868484199422907988\":{\"location\":{\"x\":536,\"y\":86}}},\"selection\":[\"node:13508735938561582046\"],\"view\":{\"scroll\":{\"x\":-54.6493682861328125,\"y\":-140.20166015625},\"zoom\":1.25}}" skeleton: 13037238043735750390 Graph: Nodes: - id: 17868484199422907988 type: OutputPoseNode - state: "{\"location\":{\"x\":488,\"y\":198}}" + state: "{\"location\":{\"x\":536,\"y\":86}}" nodeSpecific: {} inputs: @@ -15,11 +15,11 @@ AnimationGraph: [] - id: 17301805690779624226 type: StateMachineNode - state: "{\"location\":{\"x\":260,\"y\":262}}" + state: "{\"location\":{\"x\":36,\"y\":38}}" nodeSpecific: StateMachine: name: Main State Machine - editorState: "{\"nodes\":{\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}},\"node:5853113754576418241\":{\"location\":{\"x\":323,\"y\":378}}},\"selection\":[\"node:3681991280272765136\"],\"view\":{\"scroll\":{\"x\":-123.732566833496094,\"y\":-95.3266448974609375},\"zoom\":1.24999988079071045}}" + editorState: "{\"nodes\":{\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}}},\"selection\":[\"link:13017777191613838390\"],\"view\":{\"scroll\":{\"x\":-121.379241943359375,\"y\":31.9579696655273438},\"zoom\":1.5}}" skeletonHandle: 13037238043735750390 States: - name: Entry @@ -52,7 +52,7 @@ AnimationGraph: - 15724984446624483268 - 2885412559387363311 - 1559816839792901889 - - 10274687952614952111 + - 11217119714873309087 skeletonHandle: 13037238043735750390 Graph: Nodes: @@ -120,6 +120,7 @@ AnimationGraph: Transitions: - 2885412559387363311 - 1559816839792901889 + - 13017777191613838390 skeletonHandle: 13037238043735750390 Graph: Nodes: @@ -208,7 +209,7 @@ AnimationGraph: inputs: - name: "" id: 16262223745919603949 - data: 6011248127994413100 + data: 92487431340345286 - name: Loop id: 12070280934059552080 data: false @@ -253,9 +254,9 @@ AnimationGraph: pinId2: 13133448969614549550 Transitions: - 16741418222055495425 - - 4770872081588975154 - 13269834706927116307 - - 18199447053876155910 + - 11217119714873309087 + - 13017777191613838390 skeletonHandle: 13037238043735750390 Graph: Nodes: @@ -313,79 +314,10 @@ AnimationGraph: data: false Events: [] - - name: Land - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":323,\"y\":378}}" - id: 5853113754576418241 - pinId: 17490356693278968614 - pinId2: 9356542095790036010 - Transitions: - - 4770872081588975154 - - 10274687952614952111 - - 18199447053876155910 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 7972067113546953247 - type: OutputPoseNode - state: "{\"location\":{\"x\":328,\"y\":182}}" - nodeSpecific: - {} - inputs: - - name: Result - id: 14476689878508423546 - outputs: - [] - - id: 6123819316360548125 - type: SequencePlayerNode - state: "{\"location\":{\"x\":-8,\"y\":182}}" - nodeSpecific: - {} - inputs: - - name: "" - id: 15254946406601266251 - data: 1783046688217532516 - - name: Loop - id: 1916361062164798703 - data: false - - name: Speed - id: 2070241052447209235 - data: 4 - - name: Apply Root Motion - id: 8106797449584285687 - data: false - outputs: - - name: Output - id: 3721232241028352589 - Links: - - id: 15423302180500718702 - output: 3721232241028352589 - input: 14476689878508423546 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] Transitions: - id: 15724984446624483268 fromState: 3665464684957549364 toState: 3681991280272765136 - hasExitTime: false shouldBlend: true blendTime: 1 Graph: @@ -413,7 +345,6 @@ AnimationGraph: - id: 2885412559387363311 fromState: 3681991280272765136 toState: 17362013720582400113 - hasExitTime: false shouldBlend: true blendTime: 0 Graph: @@ -472,7 +403,6 @@ AnimationGraph: - id: 1559816839792901889 fromState: 17362013720582400113 toState: 3681991280272765136 - hasExitTime: false shouldBlend: true blendTime: 0 Graph: @@ -531,7 +461,6 @@ AnimationGraph: - id: 7924813067403359603 fromState: 2878473185253437245 toState: 4959086316646373199 - hasExitTime: false shouldBlend: true blendTime: 1 Graph: @@ -616,7 +545,6 @@ AnimationGraph: - id: 16741418222055495425 fromState: 2878473185253437245 toState: 16788735106587868172 - hasExitTime: false shouldBlend: true blendTime: 1 Graph: @@ -681,40 +609,26 @@ AnimationGraph: data: false Events: [] - - id: 4770872081588975154 - fromState: 16788735106587868172 - toState: 5853113754576418241 - hasExitTime: false - shouldBlend: true + - id: 13269834706927116307 + fromState: 4959086316646373199 + toState: 16788735106587868172 + shouldBlend: false blendTime: 1 Graph: Nodes: - - id: 6339755224688244053 + - id: 15364653686485468151 type: TransitionOutputNode - state: "{\"location\":{\"x\":168,\"y\":134}}" + state: "{\"location\":{\"x\":248,\"y\":54}}" nodeSpecific: {} inputs: - name: Can Enter Transition - id: 13931501205392875816 + id: 353687032276741306 + data: true outputs: [] - - id: 4169333806093001417 - type: GetParameterBoolean - state: "{\"location\":{\"x\":46,\"y\":122}}" - nodeSpecific: - {} - parameterId: 14089125791968877663 - inputs: - [] - outputs: - - name: Get - id: 15125974727342423453 - data: false Links: - - id: 1046760825910924135 - output: 15125974727342423453 - input: 13931501205392875816 + [] Parameters: - name: CurrentSpeed type: Float @@ -734,80 +648,89 @@ AnimationGraph: data: false Events: [] - - id: 10274687952614952111 - fromState: 5853113754576418241 + - id: 11217119714873309087 + fromState: 16788735106587868172 toState: 3681991280272765136 - hasExitTime: true - shouldBlend: false - blendTime: 0 + shouldBlend: true + blendTime: 0.100000001 Graph: Nodes: - - id: 12685031745682105689 + - id: 6653287450800999759 type: TransitionOutputNode - state: "{\"location\":{\"x\":0,\"y\":0}}" + state: "{\"location\":{\"x\":216,\"y\":6}}" nodeSpecific: {} inputs: - name: Can Enter Transition - id: 14146025927140979864 + id: 15457581589838815982 outputs: [] - - id: 16490412479619183933 - type: GetParameterBoolean - state: "{\"location\":{\"x\":-185,\"y\":-10}}" + - id: 9003178911700325979 + type: GetParameterFloat + state: "{\"location\":{\"x\":-418,\"y\":-10}}" nodeSpecific: {} - parameterId: 14089125791968877663 + parameterId: 14724677624567781970 inputs: [] outputs: - name: Get - id: 11250599007969618501 + id: 16985901984330133842 + data: 0 + - id: 4170492445078746776 + type: LessThanNodeFloat + state: "{\"location\":{\"x\":-210,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: A + id: 1838333731896890928 + - name: B + id: 16265345965886430070 + data: 0.100000001 + outputs: + - name: Result + id: 1722172169532499763 data: false - Links: - - id: 17348631575818981995 - output: 11250599007969618501 - input: 14146025927140979864 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - id: 13269834706927116307 - fromState: 4959086316646373199 - toState: 16788735106587868172 - hasExitTime: true - shouldBlend: false - blendTime: 1 - Graph: - Nodes: - - id: 15364653686485468151 - type: TransitionOutputNode - state: "{\"location\":{\"x\":248,\"y\":54}}" + - id: 9708513926336064775 + type: AndNode + state: "{\"location\":{\"x\":-8,\"y\":76}}" nodeSpecific: {} inputs: - - name: Can Enter Transition - id: 353687032276741306 - data: true + - name: A + id: 7856883403591827304 + - name: B + id: 5263988595647403898 outputs: + - name: Result + id: 4505037697392663919 + data: false + - id: 5216124704156292756 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-201,\"y\":134}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: [] + outputs: + - name: Get + id: 4825889497295237971 + data: false Links: - [] + - id: 17681043406700314896 + output: 16985901984330133842 + input: 1838333731896890928 + - id: 14011397835430996303 + output: 1722172169532499763 + input: 7856883403591827304 + - id: 13597328408190451023 + output: 4505037697392663919 + input: 15457581589838815982 + - id: 9037891135471372692 + output: 4825889497295237971 + input: 5263988595647403898 Parameters: - name: CurrentSpeed type: Float @@ -827,55 +750,89 @@ AnimationGraph: data: false Events: [] - - id: 18199447053876155910 - fromState: 5853113754576418241 - toState: 16788735106587868172 - hasExitTime: false + - id: 13017777191613838390 + fromState: 16788735106587868172 + toState: 17362013720582400113 shouldBlend: true - blendTime: 1 + blendTime: 0.100000001 Graph: Nodes: - - id: 10638236518812433586 + - id: 1036577216395848322 type: TransitionOutputNode - state: "{\"location\":{\"x\":360,\"y\":6}}" + state: "{\"location\":{\"x\":440,\"y\":102}}" nodeSpecific: {} inputs: - name: Can Enter Transition - id: 4772559863186558065 + id: 4339803792335917988 outputs: [] - - id: 8299836028890960564 - type: GetParameterBoolean - state: "{\"location\":{\"x\":-25,\"y\":6}}" + - id: 3837004825119610696 + type: GetParameterFloat + state: "{\"location\":{\"x\":-242,\"y\":-26}}" nodeSpecific: {} - parameterId: 14089125791968877663 + parameterId: 14724677624567781970 inputs: [] outputs: - name: Get - id: 10525197383903802877 + id: 10083439431734657165 + data: 0 + - id: 8146112023182747983 + type: GreaterThanNodeFloat + state: "{\"location\":{\"x\":-50,\"y\":-16}}" + nodeSpecific: + {} + inputs: + - name: A + id: 7199274808332462408 + - name: B + id: 8248371284444495255 + data: 0.100000001 + outputs: + - name: Result + id: 8064136978874577860 data: false - - id: 1144234582148848871 - type: NotNode - state: "{\"location\":{\"x\":136,\"y\":28}}" + - id: 1916275998856333282 + type: AndNode + state: "{\"location\":{\"x\":206,\"y\":85}}" nodeSpecific: {} inputs: - - name: Value - id: 1770400119402805745 + - name: A + id: 11165617151178048082 + - name: B + id: 16281659103676467265 outputs: - name: Result - id: 13456728752634676541 + id: 14319306040759918754 + data: false + - id: 11239840720661179165 + type: GetParameterBoolean + state: "{\"location\":{\"x\":2,\"y\":138}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 7590843644979289303 data: false Links: - - id: 2792116225498798359 - output: 10525197383903802877 - input: 1770400119402805745 - - id: 4713676757425803934 - output: 13456728752634676541 - input: 4772559863186558065 + - id: 771059204734299391 + output: 10083439431734657165 + input: 7199274808332462408 + - id: 5345335325942173371 + output: 8064136978874577860 + input: 11165617151178048082 + - id: 12045936758426933960 + output: 14319306040759918754 + input: 4339803792335917988 + - id: 15895413006776543262 + output: 7590843644979289303 + input: 16281659103676467265 Parameters: - name: CurrentSpeed type: Float @@ -900,101 +857,139 @@ AnimationGraph: outputs: - name: Output id: 9596355334609294623 - - id: 4037372283017650440 - type: SequencePlayerNode - state: "{\"location\":{\"x\":114,\"y\":66}}" - nodeSpecific: - {} - inputs: - - name: "" - id: 618220956437004201 - data: 6258146775014869030 - - name: Loop - id: 3114604204655010593 - data: true - - name: Speed - id: 16236054903193339643 - data: 6 - - name: Apply Root Motion - id: 7395332009648184810 - data: false - outputs: - - name: Output - id: 10069388367567677367 - - id: 18363173312177694114 + - id: 13508735938561582046 type: StateMachineNode - state: "{\"location\":{\"x\":435,\"y\":383}}" + state: "{\"location\":{\"x\":81,\"y\":118}}" nodeSpecific: StateMachine: - name: New State Machine - editorState: "{\"nodes\":{\"node:10255543999415026575\":{\"location\":{\"x\":0,\"y\":0}},\"node:2824380456210401004\":{\"location\":{\"x\":3,\"y\":110}},\"node:8314527320702571076\":{\"location\":{\"x\":259,\"y\":-6}}},\"selection\":[\"node:2824380456210401004\"],\"view\":{\"scroll\":{\"x\":-150.780380249023438,\"y\":-193.987319946289062},\"zoom\":1.24999988079071045}}" + name: Add Landing + editorState: "{\"nodes\":{\"node:5632050055213484480\":{\"location\":{\"x\":99,\"y\":186}},\"node:7378244001669989679\":{\"location\":{\"x\":243,\"y\":-50}},\"node:8562540680908861676\":{\"location\":{\"x\":3,\"y\":74}},\"node:87308025963726137\":{\"location\":{\"x\":3,\"y\":-22}},\"node:9115845735109484499\":{\"location\":{\"x\":243,\"y\":62}}},\"selection\":[\"link:17548788581516315937\"],\"view\":{\"scroll\":{\"x\":-161.64935302734375,\"y\":-99.20166015625},\"zoom\":1.25}}" skeletonHandle: 13037238043735750390 States: - name: Entry isEntry: true isAny: false - editorState: "{\"location\":{\"x\":0,\"y\":0}}" - id: 10255543999415026575 - pinId: 4218612207817334503 - pinId2: 13512004326247544924 + editorState: "{\"location\":{\"x\":3,\"y\":-22}}" + id: 87308025963726137 + pinId: 3738512538047820925 + pinId2: 13502015004816526643 Transitions: - - 9852413716433189781 + - 17801615313508712475 - name: Any isEntry: false isAny: true - editorState: "{\"location\":{\"x\":259,\"y\":-6}}" - id: 8314527320702571076 - pinId: 8215778157926147715 - pinId2: 11817364200069612898 + editorState: "{\"location\":{\"x\":243,\"y\":-50}}" + id: 7378244001669989679 + pinId: 11132648557640224110 + pinId2: 10812680530357256609 Transitions: - [] - - name: Idle + - 17548788581516315937 + - name: Grounded isEntry: false isAny: false - editorState: "{\"location\":{\"x\":3,\"y\":110}}" - id: 2824380456210401004 - pinId: 6827110913530388880 - pinId2: 14061245127300807158 + editorState: "{\"location\":{\"x\":3,\"y\":74}}" + id: 8562540680908861676 + pinId: 15783084220271775880 + pinId2: 15176222125992417031 Transitions: - - 9852413716433189781 + - 17801615313508712475 + - 1330539400043594242 skeletonHandle: 13037238043735750390 Graph: Nodes: - - id: 16362999611899321912 + - id: 12467551309719156360 type: OutputPoseNode - state: "{\"location\":{\"x\":168,\"y\":6}}" + state: "" nodeSpecific: {} inputs: - name: Result - id: 13855760947205103266 + id: 15474774621709807742 outputs: [] - - id: 15603655444273743752 + Links: + [] + Parameters: + [] + Events: + [] + - name: InAir + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":243,\"y\":62}}" + id: 9115845735109484499 + pinId: 12611998591606503645 + pinId2: 17594188333569932431 + Transitions: + - 1893562141280302462 + - 17548788581516315937 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 8406027038188628974 + type: OutputPoseNode + state: "" + nodeSpecific: + {} + inputs: + - name: Result + id: 5808635559910010872 + outputs: + [] + Links: + [] + Parameters: + [] + Events: + [] + - name: Landing + isEntry: false + isAny: false + editorState: "{\"location\":{\"x\":99,\"y\":186}}" + id: 5632050055213484480 + pinId: 9402723407348979363 + pinId2: 17571199017241938484 + Transitions: + - 1893562141280302462 + - 1330539400043594242 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 15527431891303545054 + type: OutputPoseNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 18312625959658127682 + outputs: + [] + - id: 4558866686129960023 type: SequencePlayerNode - state: "{\"location\":{\"x\":-190,\"y\":-6}}" + state: "{\"location\":{\"x\":-360,\"y\":-42}}" nodeSpecific: {} inputs: - name: "" - id: 3396135448745199814 - data: 6258146775014869030 + id: 18152595225621744195 + data: 1783046688217532516 - name: Loop - id: 12282045701194949945 - data: true + id: 13614687441524201465 + data: false - name: Speed - id: 5884609386405628936 + id: 16191120713417450286 data: 1 - name: Apply Root Motion - id: 15032609613315241840 + id: 15662741971721370889 data: false outputs: - name: Output - id: 2322189099458714193 + id: 12614550527038772479 Links: - - id: 320056135243155510 - output: 2322189099458714193 - input: 13855760947205103266 + - id: 4328447387372159578 + output: 12614550527038772479 + input: 18312625959658127682 Parameters: - name: CurrentSpeed type: Float @@ -1015,22 +1010,21 @@ AnimationGraph: Events: [] Transitions: - - id: 9852413716433189781 - fromState: 10255543999415026575 - toState: 2824380456210401004 - hasExitTime: false + - id: 17801615313508712475 + fromState: 87308025963726137 + toState: 8562540680908861676 shouldBlend: true blendTime: 1 Graph: Nodes: - - id: 13130306270108144217 + - id: 16922324210143258328 type: TransitionOutputNode state: "" nodeSpecific: {} inputs: - name: Can Enter Transition - id: 7560125829164143497 + id: 13510401290808176093 data: false outputs: [] @@ -1040,15 +1034,228 @@ AnimationGraph: [] Events: [] + - id: 1893562141280302462 + fromState: 9115845735109484499 + toState: 5632050055213484480 + shouldBlend: false + blendTime: 1 + Graph: + Nodes: + - id: 612610595606425626 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 15470900809855580384 + outputs: + [] + - id: 14077063748386931932 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-169,\"y\":-26}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 8891107132845255776 + data: false + Links: + - id: 15092293737054029711 + output: 8891107132845255776 + input: 15470900809855580384 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - id: 1330539400043594242 + fromState: 5632050055213484480 + toState: 8562540680908861676 + shouldBlend: false + blendTime: 1 + Graph: + Nodes: + - id: 14565222387483923525 + type: TransitionOutputNode + state: "{\"location\":{\"x\":72,\"y\":38}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 3110773760107421506 + outputs: + [] + - id: 6944830072073543906 + type: GetRelevantAnimationTimeNormalizedNode + state: "{\"location\":{\"x\":-528,\"y\":6}}" + nodeSpecific: + {} + inputs: + [] + outputs: + - name: Return Value + id: 14507732472554396359 + data: 0 + - id: 3140288915129145340 + type: GreaterThanNodeFloat + state: "{\"location\":{\"x\":-200,\"y\":28}}" + nodeSpecific: + {} + inputs: + - name: A + id: 15394648363667948474 + - name: B + id: 8579033885823588814 + data: 0.99000001 + outputs: + - name: Result + id: 2196271944537374659 + data: false + Links: + - id: 2376786509518098254 + output: 14507732472554396359 + input: 15394648363667948474 + - id: 12405964349234057673 + output: 2196271944537374659 + input: 3110773760107421506 + - id: 15501220185525901658 + output: 2196271944537374659 + input: 3110773760107421506 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] + - id: 17548788581516315937 + fromState: 7378244001669989679 + toState: 9115845735109484499 + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 12760292722810910607 + type: TransitionOutputNode + state: "{\"location\":{\"x\":88,\"y\":6}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 15646550239621634684 + outputs: + [] + - id: 14411896685320382679 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-361,\"y\":6}}" + nodeSpecific: + {} + parameterId: 14089125791968877663 + inputs: + [] + outputs: + - name: Get + id: 5914561532232053650 + data: false + - id: 16167686855606786003 + type: NotNode + state: "{\"location\":{\"x\":-159,\"y\":39}}" + nodeSpecific: + {} + inputs: + - name: Value + id: 4280197253244593424 + outputs: + - name: Result + id: 9694174055951335374 + data: false + Links: + - id: 455716539998670530 + output: 5914561532232053650 + input: 4280197253244593424 + - id: 498268818295714862 + output: 9694174055951335374 + input: 15646550239621634684 + Parameters: + - name: CurrentSpeed + type: Float + id: 14724677624567781970 + data: 0 + - name: YSpeed + type: Float + id: 514367242580045919 + data: 0 + - name: Jump + type: Boolean + id: 1479367072072825218 + data: false + - name: Grounded + type: Boolean + id: 14089125791968877663 + data: false + Events: + [] inputs: [] outputs: - name: Output - id: 17146453387266039233 + id: 1614942447406283931 + - id: 17584398784418846919 + type: AdditiveNode + state: "{\"location\":{\"x\":264,\"y\":86}}" + nodeSpecific: + {} + inputs: + - name: Base Pose + id: 15300227766262742417 + - name: Additive Pose + id: 7567182655145634832 + - name: Alpha + id: 12300756028312173804 + data: 1 + outputs: + - name: Result + id: 15348887883488818158 Links: - - id: 9127606745776540744 - output: 9596355334609294623 + - id: 5696392358544412363 + output: 15348887883488818158 input: 15529003614232630594 + - id: 5277931196798417918 + output: 9596355334609294623 + input: 15300227766262742417 + - id: 8318055603006916811 + output: 1614942447406283931 + input: 7567182655145634832 Parameters: - name: CurrentSpeed type: Float diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp index cb5970f00..8f4187986 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include "Volt/Animation/AnimationManager.h" #include @@ -17,6 +17,8 @@ #include #include +#include + namespace GraphKey { SequencePlayerNode::SequencePlayerNode() @@ -46,6 +48,23 @@ namespace GraphKey return GetInput(1); } + float SequencePlayerNode::GetCurrentAnimationTime() + { + const Volt::AnimationGraphAsset* const animGraph = reinterpret_cast(myGraph); + const float speed = GetInput(2); + const bool looping = GetInput(1); + return GetAnimation()->GetNormalizedCurrentTimeFromStartTime(animGraph->GetStartTime(), speed, looping) * (GetAnimation()->GetDuration() / speed); + } + + float SequencePlayerNode::GetCurrentAnimationTimeNormalized() + { + const Volt::AnimationGraphAsset* const animGraph = reinterpret_cast(myGraph); + const float speed = GetInput(2); + const bool looping = GetInput(1); + + return GetAnimation()->GetNormalizedCurrentTimeFromStartTime(animGraph->GetStartTime(), speed, looping); + } + void SequencePlayerNode::TrySampleAnimation() { const auto animHandle = GetInput(0); @@ -72,6 +91,7 @@ namespace GraphKey const bool shouldLoop = GetInput(1); const float speed = GetInput(2); const bool applyRootMotion = GetInput(3); + const float localTime = Volt::AnimationManager::globalClock - animGraph->GetStartTime(); const uint32_t currentFrame = anim->GetFrameFromStartTime(animGraph->GetStartTime(), speed); /* ANIMATION EVENT STUFF diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.h b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.h index be47750e6..713e45670 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.h +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.h @@ -22,6 +22,9 @@ namespace GraphKey Ref GetAnimation(); const bool IsLooping(); + float GetCurrentAnimationTime(); + float GetCurrentAnimationTimeNormalized(); + private: void TrySampleAnimation(); diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp deleted file mode 100644 index 572d42e5f..000000000 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "gkpch.h" -#include "SrtateMachineTransitionNodes.h" - -#include -#include - -#include -#include -#include - - - -GraphKey::GetRelevantAnimationLengthNode::GetRelevantAnimationLengthNode() -{ - outputs = - { - AttributeConfigDefault("Return Value", AttributeDirection::Output, 0.f, false, GK_BIND_FUNCTION(GetRelevantAnimationLength)) - }; -} - -void GraphKey::GetRelevantAnimationLengthNode::GetRelevantAnimationLength() -{ - auto animTransitionGraph = static_cast(myGraph); - auto stateMachine = animTransitionGraph->GetStateMachine(); - auto transition = stateMachine->GetTransitionById(animTransitionGraph->GetTransitionID()); - auto fromState = stateMachine->GetStateById(transition->fromState); - Volt::AssetHandle relevantAnimationHandle = fromState->stateGraph->GetRelevantAnimationHandle(); - - auto relevantAnimation = Volt::AssetManager::GetAsset(relevantAnimationHandle); - - float length = relevantAnimation->GetDuration(); - SetOutputData(0, length); -} diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h deleted file mode 100644 index 63a3bec78..000000000 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SrtateMachineTransitionNodes.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include "GraphKey/Node.h" -#include "Volt/Core/Base.h" -namespace Volt -{ - class Animation; -} -namespace GraphKey -{ - class GetRelevantAnimationLengthNode : public Node - { - public: - GetRelevantAnimationLengthNode(); - ~GetRelevantAnimationLengthNode() override = default; - - inline const std::string GetName() override { return "Get Relevant Animation Length"; } - inline const glm::vec4 GetColor() override { return { 1.f }; } - private: - void GetRelevantAnimationLength(); - }; - - //class GetRelevantAnimationTime -} diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp new file mode 100644 index 000000000..a00760303 --- /dev/null +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp @@ -0,0 +1,105 @@ +#include "gkpch.h" +#include "StateMachineTransitionNodes.h" + +#include +#include + +#include +#include +#include + +#include "GraphKey/Nodes/Animation/SequenceNodes.h" + +namespace GraphKey +{ + Ref GetRelevantAnimationNode(GraphKey::Graph* aGraph) + { + const auto animTransitionGraph = static_cast(aGraph); + const auto stateMachine = animTransitionGraph->GetStateMachine(); + const auto transition = stateMachine->GetTransitionById(animTransitionGraph->GetTransitionID()); + const auto fromState = stateMachine->GetStateById(transition->fromState); + + return fromState->stateGraph->GetRelevantAnimationNode(); + } + + GraphKey::GetRelevantAnimationLengthNode::GetRelevantAnimationLengthNode() + { + outputs = + { + AttributeConfig("Return Value", AttributeDirection::Output, true, GK_BIND_FUNCTION(GetRelevantAnimationLengthNode::GetRelevantAnimationLength)) + }; + } + + void GraphKey::GetRelevantAnimationLengthNode::GetRelevantAnimationLength() + { + const auto relevantAnimNode = GetRelevantAnimationNode(myGraph); + + if (!relevantAnimNode) + return; + + float duration = 0.f; + if (relevantAnimNode->GetName() == "Sequence Player") + { + auto anim = Volt::AssetManager::GetAsset(relevantAnimNode->GetInput(0)); + if (anim) + { + duration = anim->GetDuration(); + } + } + + SetOutputData(0, duration); + } + + GraphKey::GetRelevantAnimationTimeNode::GetRelevantAnimationTimeNode() + { + outputs = + { + AttributeConfig("Return Value", AttributeDirection::Output, true, GK_BIND_FUNCTION(GetRelevantAnimationTimeNode::GetRelevantAnimationTime)) + }; + } + + void GraphKey::GetRelevantAnimationTimeNode::GetRelevantAnimationTime() + { + const auto relevantAnimNode = GetRelevantAnimationNode(myGraph); + + if (!relevantAnimNode) + return; + + float currentTime = 0.f; + + if (relevantAnimNode->GetName() == "Sequence Player") + { + auto sequencePlayer = std::reinterpret_pointer_cast(relevantAnimNode); + currentTime = sequencePlayer->GetCurrentAnimationTime(); + } + + SetOutputData(0, currentTime); + } + + GetRelevantAnimationTimeNormalizedNode::GetRelevantAnimationTimeNormalizedNode() + { + outputs = + { + AttributeConfig("Return Value", AttributeDirection::Output, true, GK_BIND_FUNCTION(GetRelevantAnimationTimeNormalizedNode::GetRelevantAnimationTimeNormalized)) + }; + } + + void GetRelevantAnimationTimeNormalizedNode::GetRelevantAnimationTimeNormalized() + { + const auto relevantAnimNode = GetRelevantAnimationNode(myGraph); + + if (!relevantAnimNode) + return; + + float currentTime = 0.f; + + if (relevantAnimNode->GetName() == "Sequence Player") + { + auto sequencePlayer = std::reinterpret_pointer_cast(relevantAnimNode); + currentTime = sequencePlayer->GetCurrentAnimationTimeNormalized(); + } + + SetOutputData(0, currentTime); + } + +} diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.h b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.h new file mode 100644 index 000000000..012819ff9 --- /dev/null +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.h @@ -0,0 +1,49 @@ +#pragma once +#include "GraphKey/Node.h" +#include "Volt/Core/Base.h" +namespace Volt +{ + class Animation; +} +namespace GraphKey +{ + inline Ref GetRelevantAnimationNode(GraphKey::Graph* aGraph); + + + class GetRelevantAnimationLengthNode : public Node + { + public: + GetRelevantAnimationLengthNode(); + ~GetRelevantAnimationLengthNode() override = default; + + inline const std::string GetName() override { return "Get Relevant Animation Length"; } + inline const glm::vec4 GetColor() override { return { 1.f }; } + private: + void GetRelevantAnimationLength(); + }; + + class GetRelevantAnimationTimeNode : public Node + { + public: + GetRelevantAnimationTimeNode(); + ~GetRelevantAnimationTimeNode() override = default; + + inline const std::string GetName() override { return "Get Relevant Animation Time"; } + inline const glm::vec4 GetColor() override { return { 1.f }; } + private: + void GetRelevantAnimationTime(); + }; + + class GetRelevantAnimationTimeNormalizedNode : public Node + { + public: + GetRelevantAnimationTimeNormalizedNode(); + ~GetRelevantAnimationTimeNormalizedNode() override = default; + + inline const std::string GetName() override { return "Get Relevant Animation Time Normalized"; } + inline const glm::vec4 GetColor() override { return { 1.f }; } + private: + void GetRelevantAnimationTimeNormalized(); + }; + +} diff --git a/Volt/GraphKey/src/GraphKey/Nodes/NodeRegistry.cpp b/Volt/GraphKey/src/GraphKey/Nodes/NodeRegistry.cpp index d09d8591e..036b10cfd 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/NodeRegistry.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/NodeRegistry.cpp @@ -18,6 +18,7 @@ #include "GraphKey/Nodes/Animation/TransitionNodes.h" #include "GraphKey/Nodes/Animation/AnimationSwitchNode.h" #include "GraphKey/Nodes/Animation/AnimationDurationNode.h" +#include "GraphKey/Nodes/Animation/StateMachineTransitionNodes.h" #include "GraphKey/Nodes/CustomEventNode.h" @@ -86,6 +87,11 @@ namespace GraphKey GK_REGISTER_NODE(RotateBoneNode, "Animation", GraphType::Animation); GK_REGISTER_NODE(AnimationSwitchNode, "Animation", GraphType::Animation); GK_REGISTER_NODE(GetAnimationDurationNode, "Animation", GraphType::Animation); + + GK_REGISTER_NODE(GetRelevantAnimationLengthNode, "Animation", GraphType::Animation); + GK_REGISTER_NODE(GetRelevantAnimationTimeNode, "Animation", GraphType::Animation); + GK_REGISTER_NODE(GetRelevantAnimationTimeNormalizedNode, "Animation", GraphType::Animation); + GK_REGISTER_NODE(MaterialOutputNode, "Material", GraphType::Material); GK_REGISTER_NODE(TextureSampleNode, "Material", GraphType::Material); diff --git a/Volt/GraphKey/src/GraphKey/Registry.cpp b/Volt/GraphKey/src/GraphKey/Registry.cpp index 8442d7fb1..72c2da692 100644 --- a/Volt/GraphKey/src/GraphKey/Registry.cpp +++ b/Volt/GraphKey/src/GraphKey/Registry.cpp @@ -56,4 +56,4 @@ namespace GraphKey return result; } -} \ No newline at end of file +} diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index a3b95c3a8..874b00d70 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -38,6 +38,7 @@ namespace Volt myCurrentState = myStartState; auto startState = myStates.at(myStartState); startState->startTime = AnimationManager::globalClock; + startState->stateGraph->SetStartTime(AnimationManager::globalClock); } } } @@ -356,7 +357,7 @@ namespace Volt newTransition->shouldBlend = transition->shouldBlend; newTransition->transitionGraph = CreateRef(); - newTransition->transitionGraph->SetStateMachine(this); + newTransition->transitionGraph->SetStateMachine(newStateMachine.get()); newTransition->transitionGraph->SetTransitionID(newTransition->id); newTransition->transitionGraph->SetEntity(entity); GraphKey::Graph::Copy(transition->transitionGraph, newTransition->transitionGraph); @@ -516,5 +517,6 @@ namespace Volt auto statePtr = myStates.at(myCurrentState); statePtr->startTime = AnimationManager::globalClock; + statePtr->stateGraph->SetStartTime(AnimationManager::globalClock); } } diff --git a/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h b/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h index 9edd6d458..eff8a0be9 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h +++ b/Volt/Volt/src/Volt/Animation/AnimationTransitionGraph.h @@ -15,14 +15,14 @@ namespace Volt inline void SetState(const std::string& aState) { myGraphState = aState; } inline const std::string& GetState() const { return myGraphState; } - inline void SetStateMachine(const AnimationStateMachine* aStateMachine) { myStateMachineWeak = aStateMachine; } + inline void SetStateMachine(AnimationStateMachine* aStateMachine) { myStateMachineWeak = aStateMachine; } inline const AnimationStateMachine* GetStateMachine() const { return myStateMachineWeak; } inline void SetTransitionID(const UUID& aId) { myTransitionID = aId; } inline const UUID& GetTransitionID() const { return myTransitionID; } private: std::string myGraphState; - const AnimationStateMachine* myStateMachineWeak; + AnimationStateMachine* myStateMachineWeak; UUID myTransitionID; }; } diff --git a/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp b/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp index 21765bcd5..32a8ef127 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp +++ b/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp @@ -253,6 +253,22 @@ namespace Volt return currentFrameIndex; } + const float Animation::GetNormalizedCurrentTimeFromStartTime(float startTime, float speed, bool looping) + { + const float localTime = AnimationManager::globalClock - startTime; + const float normalizedTime = localTime / (myDuration / speed); + + if (looping) + { + return fmodf(normalizedTime, 1.f); + } + else + { + return std::clamp(normalizedTime, 0.f, 1.f); + } + return 0.0f; + } + const Animation::PoseData Animation::GetFrameDataFromAnimation(Animation& animation, const float aNormalizedTime) { PoseData animData{}; diff --git a/Volt/Volt/src/Volt/Asset/Animation/Animation.h b/Volt/Volt/src/Volt/Asset/Animation/Animation.h index 77ae78d9a..6b175fdf3 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/Animation.h +++ b/Volt/Volt/src/Volt/Asset/Animation/Animation.h @@ -30,6 +30,7 @@ namespace Volt const bool HasPassedTime(float startTime, float speed, float time); const uint32_t GetFrameFromStartTime(float startTime, float speed); + const float GetNormalizedCurrentTimeFromStartTime(float startTime, float speed, bool looping); inline const float GetDuration() const { return myDuration; } inline const size_t GetFrameCount() const { return myFrames.size(); } diff --git a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp index 7ef493e13..e32bab95f 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp +++ b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.cpp @@ -15,18 +15,18 @@ namespace Volt return newGraph; } - AssetHandle AnimationGraphAsset::GetRelevantAnimationHandle() + Ref AnimationGraphAsset::GetRelevantAnimationNode() { - auto sequencePlayerNodes = GetNodesOfType("Sequence Player"); - + auto sequencePlayerNodes = GetNodesOfType("SequencePlayerNode"); + if (sequencePlayerNodes.size() == 0) - return Asset::Null(); + return Ref(); //TODO: Update this to check for all the relevant nodes //TODO: Update this to have a relevancy order auto sequencePlayerNode = std::dynamic_pointer_cast(sequencePlayerNodes[0]); - - return sequencePlayerNode->GetAnimation()->handle; + + return sequencePlayerNode; } void AnimationGraphAsset::SetSkeletonHandle(AssetHandle aSkeletonHandle) diff --git a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h index 245f473f0..fc011e01d 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h +++ b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h @@ -39,9 +39,9 @@ namespace Volt Ref CreateCopy(Wire::EntityId entity = 0); + Ref GetRelevantAnimationNode(); private: - Ref GetRelevantAnimationNode(); friend class AnimationGraphImporter; AssetHandle mySkeletonHandle = Asset::Null(); From b9db201d094d8325a2914faff2ea659464b8d920 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Thu, 31 Aug 2023 08:08:15 +0200 Subject: [PATCH 04/18] Fixed a bug where links would not get removed when multiple pins were linked to the same input pin. --- .../AG_NewAnimationGraph.vtanimgraph | 12 +- Volt/GraphKey/src/GraphKey/Graph.cpp | 4 + .../src/Sandbox/NodeGraph/IONodeGraphEditor.h | 143 +++++++++++------- .../src/Sandbox/NodeGraph/NodeGraphEditor.h | 8 +- 4 files changed, 103 insertions(+), 64 deletions(-) diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph index e2d233485..701837938 100644 --- a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph +++ b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph @@ -1,5 +1,5 @@ AnimationGraph: - state: "{\"nodes\":{\"node:13508735938561582046\":{\"location\":{\"x\":81,\"y\":118}},\"node:17301805690779624226\":{\"location\":{\"x\":36,\"y\":38}},\"node:17584398784418846919\":{\"location\":{\"x\":264,\"y\":86}},\"node:17868484199422907988\":{\"location\":{\"x\":536,\"y\":86}}},\"selection\":[\"node:13508735938561582046\"],\"view\":{\"scroll\":{\"x\":-54.6493682861328125,\"y\":-140.20166015625},\"zoom\":1.25}}" + state: "{\"nodes\":{\"node:12463233505869314869\":{\"location\":{\"x\":-50,\"y\":182}},\"node:13508735938561582046\":{\"location\":{\"x\":81,\"y\":118}},\"node:14889568793579757983\":{\"location\":{\"x\":78,\"y\":246}},\"node:17301805690779624226\":{\"location\":{\"x\":36,\"y\":38}},\"node:17584398784418846919\":{\"location\":{\"x\":264,\"y\":86}},\"node:17868484199422907988\":{\"location\":{\"x\":536,\"y\":86}}},\"selection\":null,\"view\":{\"scroll\":{\"x\":7.35063934326171875,\"y\":-67.20166015625},\"zoom\":1.25}}" skeleton: 13037238043735750390 Graph: Nodes: @@ -19,7 +19,7 @@ AnimationGraph: nodeSpecific: StateMachine: name: Main State Machine - editorState: "{\"nodes\":{\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}}},\"selection\":[\"link:13017777191613838390\"],\"view\":{\"scroll\":{\"x\":-121.379241943359375,\"y\":31.9579696655273438},\"zoom\":1.5}}" + editorState: "{\"nodes\":{\"node:12463233505869314869\":{\"location\":{\"x\":-50,\"y\":182}},\"node:13508735938561582046\":{\"location\":{\"x\":81,\"y\":118}},\"node:14889568793579757983\":{\"location\":{\"x\":78,\"y\":246}},\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17301805690779624226\":{\"location\":{\"x\":36,\"y\":38}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:17584398784418846919\":{\"location\":{\"x\":264,\"y\":86}},\"node:17868484199422907988\":{\"location\":{\"x\":536,\"y\":86}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}}},\"selection\":[\"node:17301805690779624226\"],\"view\":{\"scroll\":{\"x\":37.3506393432617188,\"y\":2.79835128784179688},\"zoom\":1.25}}" skeletonHandle: 13037238043735750390 States: - name: Entry @@ -863,7 +863,7 @@ AnimationGraph: nodeSpecific: StateMachine: name: Add Landing - editorState: "{\"nodes\":{\"node:5632050055213484480\":{\"location\":{\"x\":99,\"y\":186}},\"node:7378244001669989679\":{\"location\":{\"x\":243,\"y\":-50}},\"node:8562540680908861676\":{\"location\":{\"x\":3,\"y\":74}},\"node:87308025963726137\":{\"location\":{\"x\":3,\"y\":-22}},\"node:9115845735109484499\":{\"location\":{\"x\":243,\"y\":62}}},\"selection\":[\"link:17548788581516315937\"],\"view\":{\"scroll\":{\"x\":-161.64935302734375,\"y\":-99.20166015625},\"zoom\":1.25}}" + editorState: "" skeletonHandle: 13037238043735750390 States: - name: Entry @@ -1250,12 +1250,12 @@ AnimationGraph: - id: 5696392358544412363 output: 15348887883488818158 input: 15529003614232630594 - - id: 5277931196798417918 - output: 9596355334609294623 - input: 15300227766262742417 - id: 8318055603006916811 output: 1614942447406283931 input: 7567182655145634832 + - id: 5108768561992337379 + output: 9596355334609294623 + input: 15300227766262742417 Parameters: - name: CurrentSpeed type: Float diff --git a/Volt/GraphKey/src/GraphKey/Graph.cpp b/Volt/GraphKey/src/GraphKey/Graph.cpp index b2076dc32..3ef6b154c 100644 --- a/Volt/GraphKey/src/GraphKey/Graph.cpp +++ b/Volt/GraphKey/src/GraphKey/Graph.cpp @@ -67,6 +67,10 @@ namespace GraphKey if (output) { + while (!output->links.empty()) + { + RemoveLink(output->links.front()); + } output->links.emplace_back(newLink.id); } diff --git a/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h b/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h index fd54689f0..5bc8f77e8 100644 --- a/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h +++ b/Volt/Sandbox/src/Sandbox/NodeGraph/IONodeGraphEditor.h @@ -194,6 +194,13 @@ class IONodeGraphEditor : public NodeGraph::Editor private: const IncompatiblePinReason CanLinkPins(const Volt::UUID input, const Volt::UUID output); + void AddNode(Ref node); + void CreateLink(const Volt::UUID id, const Volt::UUID input, const Volt::UUID output) override; + void AddLink(GraphKey::Link link); + + void RemoveLink(const Volt::UUID linkId) override; + void RemoveNode(const Volt::UUID nodeId) override; + void DrawGraphDataPanel(); void DrawNodeContextMenu(); void DrawPinContextMenu(); @@ -572,6 +579,53 @@ inline const IONodeGraphEditor::IncompatiblePinReason return IncompatiblePinReason::None; } +template +inline void IONodeGraphEditor::AddNode(Ref node) +{ + std::vector pins; + for (auto& i : node->inputs) + { + pins.emplace_back(i.id); + } + + for (auto& o : node->outputs) + { + pins.emplace_back(o.id); + } + + Editor::CreateNode(node->id, pins); + myOpenGraph->AddNode(node); +} + +template +inline void IONodeGraphEditor::CreateLink(const Volt::UUID id, const Volt::UUID input, const Volt::UUID output) +{ + Editor::CreateLink(id, input, output); + myOpenGraph->CreateLink(id, input, output); +} + +template +inline void IONodeGraphEditor::AddLink(GraphKey::Link link) +{ + Editor::CreateLink(link.id, link.input, link.output); + myOpenGraph->AddLink(link); +} + +template +inline void IONodeGraphEditor::RemoveLink(const Volt::UUID linkId) +{ + Editor::RemoveLink(linkId); + myOpenGraph->RemoveLink(linkId); + +} + +template +inline void IONodeGraphEditor::RemoveNode(const Volt::UUID nodeId) +{ + Editor::RemoveNode(nodeId); + myOpenGraph->RemoveNode(nodeId); +} + template inline void IONodeGraphEditor::ReconstructGraph() { @@ -673,31 +727,41 @@ inline void IONodeGraphEditor::OnBeginCreate() } else if (ed::AcceptNewItem(ImColor{ 1.f, 1.f, 1.f }, 2.f)) { - if (myGraphType == GraphKey::GraphType::Animation && startAttr->type == GraphKey::AttributeType::Flow) + auto inputDirAttr = startAttr->direction == GraphKey::AttributeDirection::Input ? startAttr : endAttr; + std::vector linksToRemove{}; + if (!inputDirAttr->links.empty()) { - std::vector linksToRemove{}; + linksToRemove.insert(linksToRemove.end(), inputDirAttr->links.begin(), inputDirAttr->links.end()); + } - if (!startAttr->links.empty()) - { - linksToRemove.insert(linksToRemove.end(), startAttr->links.begin(), startAttr->links.end()); - } + for (const auto& l : linksToRemove) + { + RemoveLink(l); + } - if (!endAttr->links.empty()) - { - linksToRemove.insert(linksToRemove.end(), endAttr->links.begin(), endAttr->links.end()); - } + //if (myGraphType == GraphKey::GraphType::Animation && startAttr->type == GraphKey::AttributeType::AnimationPose) + //{ + // std::vector linksToRemove{}; - for (const auto& l : linksToRemove) - { - RemoveLink(l); - myOpenGraph->RemoveLink(l); - } - } + // if (!startAttr->links.empty()) + // { + // linksToRemove.insert(linksToRemove.end(), startAttr->links.begin(), startAttr->links.end()); + // } - myCommandStack->AddCommand(myOpenGraph); + // if (!endAttr->links.empty()) + // { + // linksToRemove.insert(linksToRemove.end(), endAttr->links.begin(), endAttr->links.end()); + // } + + // for (const auto& l : linksToRemove) + // { + // RemoveLink(l); + // } + //} - auto newLink = GetBackend().CreateLink(endPinId.Get(), startPinId.Get()); - myOpenGraph->CreateLink(newLink.id, newLink.input, newLink.output); + myCommandStack->AddCommand(myOpenGraph); + const Volt::UUID id{}; + CreateLink(id, startPinId.Get(), endPinId.Get()); } } @@ -835,7 +899,7 @@ inline void IONodeGraphEditor::OnPaste() } } - linksToCopy.emplace_back(std::pair(std::pair{ inputAttribute, outputAttribute }, *link)); + linksToCopy.emplace_back(std::pair(std::pair{ inputAttribute, outputAttribute }, * link)); } } } @@ -876,26 +940,12 @@ inline void IONodeGraphEditor::OnPaste() for (const auto& n : myNodeCopies) { n->id = {}; - - std::vector pins; - for (auto& i : n->inputs) - { - pins.emplace_back(i.id); - } - - for (auto& o : n->outputs) - { - pins.emplace_back(o.id); - } - - myOpenGraph->AddNode(n); - CreateNode(n->id, pins); + AddNode(n); } for (const auto& l : newLinks) { - myOpenGraph->AddLink(l); - CreateLink(l.id, l.input, l.output); + AddLink(l); } myShouldMoveCopies = true; @@ -1190,21 +1240,7 @@ inline Ref IONodeGraphEditor::DrawNode } myCommandStack->AddCommand(myOpenGraph); - myOpenGraph->AddNode(node); - - std::vector pinIds{}; - - for (const auto& i : node->inputs) - { - pinIds.emplace_back(i.id); - } - - for (const auto& o : node->outputs) - { - pinIds.emplace_back(o.id); - } - - CreateNode(node->id, pinIds); + AddNode(node); } } @@ -1330,7 +1366,6 @@ inline void IONodeGraphEditor::DrawBackgroundContextMe for (const auto& l : linksToRemove) { - myOpenGraph->RemoveLink(l); RemoveLink(l); } } @@ -1343,7 +1378,6 @@ inline void IONodeGraphEditor::DrawBackgroundContextMe if (l.input == endId.Get()) { RemoveLink(l.id); - myOpenGraph->RemoveLink(l.id); } } @@ -1358,7 +1392,8 @@ inline void IONodeGraphEditor::DrawBackgroundContextMe } myCommandStack->AddCommand(myOpenGraph); - const auto id = myOpenGraph->CreateLink(startId.Get(), endId.Get()); + + const Volt::UUID id{}; CreateLink(id, startId.Get(), endId.Get()); break; diff --git a/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditor.h b/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditor.h index 53005ba3e..44fe4f51f 100644 --- a/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditor.h +++ b/Volt/Sandbox/src/Sandbox/NodeGraph/NodeGraphEditor.h @@ -47,11 +47,11 @@ namespace NodeGraph void UpdateMainContent() override; void UpdateContent() override; - void CreateNode(const Volt::UUID id, const std::vector pins); - void CreateLink(const Volt::UUID id, const Volt::UUID input, const Volt::UUID output); + virtual void CreateNode(const Volt::UUID id, const std::vector pins); + virtual void CreateLink(const Volt::UUID id, const Volt::UUID input, const Volt::UUID output); - void RemoveLink(const Volt::UUID linkId); - void RemoveNode(const Volt::UUID nodeId); + virtual void RemoveLink(const Volt::UUID linkId); + virtual void RemoveNode(const Volt::UUID nodeId); const std::vector GetSelectedNodes(); const std::vector GetSelectedLinks(); From b30c0188fb7db71b0f423e6bf60f0e1e45a0ba36 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Wed, 6 Sep 2023 20:38:07 +0200 Subject: [PATCH 05/18] Started Work on converting Animation state to instead be StateMachineState using inheritance, Push to work on different comuter --- .../Nodes/Animation/StateMachineNodes.cpp | 8 +- .../AnimationGraph/AnimationGraphPanel.cpp | 12 +- .../Volt/Animation/AnimationStateMachine.cpp | 120 ++++++++++++------ .../Volt/Animation/AnimationStateMachine.h | 60 ++++++--- 4 files changed, 137 insertions(+), 63 deletions(-) diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp index 2b0a61bee..4b0d1e22d 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp @@ -69,8 +69,8 @@ namespace GraphKey VT_SERIALIZE_PROPERTY(editorState, state->editorState, out); VT_SERIALIZE_PROPERTY(id, state->id, out); - VT_SERIALIZE_PROPERTY(pinId, state->pinId, out); - VT_SERIALIZE_PROPERTY(pinId2, state->pinId2, out); + VT_SERIALIZE_PROPERTY(pinId, state->topPinId, out); + VT_SERIALIZE_PROPERTY(pinId2, state->bottomPinId, out); out << YAML::Key << "Transitions" << YAML::BeginSeq; for (const auto& transition : state->transitions) @@ -142,8 +142,8 @@ namespace GraphKey auto newState = myStateMachine->CreateState(stateName, stateIsEntry, stateId); VT_DESERIALIZE_PROPERTY(editorState, newState->editorState, stateNode, std::string("")); - VT_DESERIALIZE_PROPERTY(pinId, newState->pinId, stateNode, Volt::UUID(0)); - VT_DESERIALIZE_PROPERTY(pinId2, newState->pinId2, stateNode, Volt::UUID(0)); + VT_DESERIALIZE_PROPERTY(pinId, newState->topPinId, stateNode, Volt::UUID(0)); + VT_DESERIALIZE_PROPERTY(pinId2, newState->bottomPinId, stateNode, Volt::UUID(0)); VT_DESERIALIZE_PROPERTY(isAny, newState->isAny, stateNode, false); for (const auto& transitionNode : stateNode["Transitions"]) diff --git a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp index fa942c525..dffb2795f 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp @@ -367,11 +367,11 @@ void AnimationGraphPanel::DrawLinks() if (fromPos.y < toPos.y) { - ed::Link(ed::LinkId(t->id), ed::PinId(fromState->pinId2), ed::PinId(toState->pinId), offset, ax::NodeEditor::ArrowLocation::End); + ed::Link(ed::LinkId(t->id), ed::PinId(fromState->bottomPinId), ed::PinId(toState->topPinId), offset, ax::NodeEditor::ArrowLocation::End); } else { - ed::Link(ed::LinkId(t->id), ed::PinId(fromState->pinId), ed::PinId(toState->pinId2), offset, ax::NodeEditor::ArrowLocation::End); + ed::Link(ed::LinkId(t->id), ed::PinId(fromState->topPinId), ed::PinId(toState->bottomPinId), offset, ax::NodeEditor::ArrowLocation::End); } } @@ -390,11 +390,11 @@ void AnimationGraphPanel::DrawLinks() if (fromPos.y < toPos.y) { - ed::Link(ed::LinkId(t->id), ed::PinId(fromState->pinId2), ed::PinId(toState->pinId), offset * -1.f, ax::NodeEditor::ArrowLocation::End); + ed::Link(ed::LinkId(t->id), ed::PinId(fromState->bottomPinId), ed::PinId(toState->topPinId), offset * -1.f, ax::NodeEditor::ArrowLocation::End); } else { - ed::Link(ed::LinkId(t->id), ed::PinId(fromState->pinId), ed::PinId(toState->pinId2), offset * -1.f, ax::NodeEditor::ArrowLocation::End); + ed::Link(ed::LinkId(t->id), ed::PinId(fromState->topPinId), ed::PinId(toState->bottomPinId), offset * -1.f, ax::NodeEditor::ArrowLocation::End); } } } @@ -612,7 +612,7 @@ void AnimationGraphPanel::DrawStateMachineNodes() ed::PushStyleVar(ed::StyleVar_PinArrowWidth, 10.0f); ed::PushStyleVar(ed::StyleVar_PinCorners, ImDrawFlags_RoundCornersBottom); - ed::BeginPin(ed::PinId(state->pinId), ed::PinKind::Input); + ed::BeginPin(ed::PinId(state->topPinId), ed::PinKind::Input); ed::PinPivotRect(inputsRect.GetTL(), inputsRect.GetBR()); ed::PinRect(inputsRect.GetTL(), inputsRect.GetBR()); ed::EndPin(); @@ -650,7 +650,7 @@ void AnimationGraphPanel::DrawStateMachineNodes() ed::PushStyleVar(ed::StyleVar_PinArrowSize, 10.f); ed::PushStyleVar(ed::StyleVar_PinArrowWidth, 10.0f); ed::PushStyleVar(ed::StyleVar_PinCorners, ImDrawFlags_RoundCornersBottom); - ed::BeginPin(ed::PinId(state->pinId2), ed::PinKind::Output); + ed::BeginPin(ed::PinId(state->bottomPinId), ed::PinKind::Output); ed::PinPivotRect(outputsRect.GetTL(), outputsRect.GetBR()); ed::PinRect(outputsRect.GetTL(), outputsRect.GetBR()); ed::EndPin(); diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index 874b00d70..3d353518c 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -18,8 +18,7 @@ namespace Volt AnimationStateMachine::AnimationStateMachine(const std::string& name, AssetHandle aSkeletonHandle) : myName(name), mySkeletonHandle(aSkeletonHandle) { - AddState("Entry", true); - AddState("Any", false, true); + AddState("Entry", StateMachineStateType::EntryState); } void AnimationStateMachine::Update(float deltaTime) @@ -29,14 +28,14 @@ namespace Volt { for (const auto& state : myStates) { - if (state->isEntry && !state->transitions.empty()) + if (state->stateType == StateMachineStateType::EntryState && !state->transitions.empty()) { auto transition = GetTransitionById(state->transitions.front()); if (transition) { SetStartState(transition->toState); myCurrentState = myStartState; - auto startState = myStates.at(myStartState); + auto startState = std::reinterpret_pointer_cast(myStates.at(myStartState)); startState->startTime = AnimationManager::globalClock; startState->stateGraph->SetStartTime(AnimationManager::globalClock); } @@ -55,7 +54,7 @@ namespace Volt } // Check any state for transitions - for (const auto& state : myStates) + /*for (const auto& state : myStates) { if (state->isAny) { @@ -75,7 +74,7 @@ namespace Volt } break; } - } + }*/ const auto& currState = myStates.at(myCurrentState); @@ -99,9 +98,9 @@ namespace Volt { for (const auto& state : myStates) { - if (state->stateGraph) + if (state->stateType == StateMachineStateType::AnimationState) { - state->stateGraph->OnEvent(e); + AsAnimationState(state)->stateGraph->OnEvent(e); } } @@ -119,9 +118,9 @@ namespace Volt mySkeletonHandle = aSkeletonHandle; for (const auto& state : myStates) { - if (state->stateGraph) + if (state->stateType == StateMachineStateType::AnimationState) { - state->stateGraph->SetSkeletonHandle(aSkeletonHandle); + AsAnimationState(state)->stateGraph->SetSkeletonHandle(aSkeletonHandle); } } } @@ -141,7 +140,7 @@ namespace Volt return {}; } - const auto& currState = myStates.at(myCurrentState); + const auto& currState = GetAnimationState(myCurrentState); const auto nodes = currState->stateGraph->GetNodesOfType("OutputPoseNode"); if (nodes.empty()) { @@ -171,34 +170,55 @@ namespace Volt return sample; } - void AnimationStateMachine::AddState(const std::string& name, bool isEntry, bool isAny) + Ref AnimationStateMachine::CreateTransition(Volt::UUID id) { - auto state = CreateRef(name, isEntry, isAny); - if (!isEntry && !isAny) - { - state->stateGraph = CreateRef(mySkeletonHandle); - state->stateGraph->AddNode(GraphKey::Registry::Create("OutputPoseNode")); - } + auto transition = CreateRef(); + transition->id = id; - myStates.emplace_back(state); + myTransitions.emplace_back(transition); + return transition; } - Ref AnimationStateMachine::CreateState(const std::string& name, bool isEntry, const UUID id) + void AnimationStateMachine::AddState(const std::string& name, StateMachineStateType aStateType, const UUID id) { - auto state = CreateRef(name, isEntry, false); - state->id = id; + switch (aStateType) + { + case StateMachineStateType::AnimationState: + { + auto animationState = CreateRef(name); + animationState->stateGraph = CreateRef(mySkeletonHandle); + animationState->stateGraph->AddNode(GraphKey::Registry::Create("OutputPoseNode")); + myStates.emplace_back(animationState); + break; + } - myStates.emplace_back(state); - return state; - } + case StateMachineStateType::AliasState: + { + auto aliasState = CreateRef(name); + myStates.emplace_back(aliasState); + break; + } - Ref AnimationStateMachine::CreateTransition(Volt::UUID id) - { - auto transition = CreateRef(); - transition->id = id; + case StateMachineStateType::EntryState: + { + bool alreadyHasEntry = false; + for (auto& state : myStates) + { + if (state->stateType == StateMachineStateType::EntryState) + { + alreadyHasEntry = true; + break; + } + } - myTransitions.emplace_back(transition); - return transition; + if (!alreadyHasEntry) + { + auto state = CreateRef("Entry", aStateType); + myStates.emplace_back(state); + } + break; + } + } } void AnimationStateMachine::AddTransition(const UUID startStateId, const UUID endStateId) @@ -215,7 +235,7 @@ namespace Volt startState->transitions.emplace_back(transition->id); endState->transitions.emplace_back(transition->id); } - + transition->transitionGraph = CreateRef(); transition->transitionGraph->SetStateMachine(this); transition->transitionGraph->SetTransitionID(transition->id); @@ -235,7 +255,7 @@ namespace Volt return; } - Ref node = *it; + Ref node = *it; for (const auto& t : node->transitions) { RemoveTransition(t); @@ -277,7 +297,7 @@ namespace Volt } } - AnimationState* AnimationStateMachine::GetStateById(const UUID stateId) const + StateMachineState* AnimationStateMachine::GetStateById(const UUID stateId) const { auto it = std::find_if(myStates.begin(), myStates.end(), [stateId](const auto& lhs) { return lhs->id == stateId; }); if (it != myStates.end()) @@ -301,7 +321,7 @@ namespace Volt AnimationState* AnimationStateMachine::GetStateFromPin(const UUID pinId) const { - auto it = std::find_if(myStates.begin(), myStates.end(), [pinId](const auto& lhs) { return lhs->pinId == pinId || lhs->pinId2 == pinId; }); + auto it = std::find_if(myStates.begin(), myStates.end(), [pinId](const auto& lhs) { return lhs->topPinId == pinId || lhs->bottomPinId == pinId; }); if (it != myStates.end()) { return (*it).get(); @@ -335,8 +355,8 @@ namespace Volt Ref newState = CreateRef(state->name, state->isEntry, state->isAny); newState->transitions = state->transitions; newState->id = state->id; - newState->pinId = state->pinId; - newState->pinId2 = state->pinId2; + newState->topPinId = state->topPinId; + newState->bottomPinId = state->bottomPinId; if (state->stateGraph) { newState->stateGraph = state->stateGraph->CreateCopy(entity); @@ -352,7 +372,7 @@ namespace Volt newTransition->id = transition->id; newTransition->fromState = transition->fromState; newTransition->toState = transition->toState; - + newTransition->blendTime = transition->blendTime; newTransition->shouldBlend = transition->shouldBlend; @@ -500,6 +520,30 @@ namespace Volt return sample; } + Ref AnimationStateMachine::GetAnimationState(uint32_t aIndex) + { + auto state = myStates.at(aIndex); + if (state->stateType == StateMachineStateType::AnimationState) [[likely]] + { + return std::reinterpret_pointer_cast(state); + } + else [[unlikely]] + { + VT_CORE_ERROR("Tried to get AnimationState from an index that does not contain an Animation state"); + return Ref(); + } + } + + Ref AnimationStateMachine::AsAnimationState(Ref aState) + { + if (aState->stateType != StateMachineStateType::AnimationState) [[unlikely]] + { + VT_CORE_ERROR("Tried to convert a StateMachineState to AnimationState that doesnt have that type"); + return Ref(); + } + return std::reinterpret_pointer_cast(aState); + } + void AnimationStateMachine::SetNextState(const UUID targetStateId, const UUID transitionId) { const auto transition = GetTransitionById(transitionId); diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h index 1031fa7c1..03abda4fe 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h @@ -31,27 +31,55 @@ namespace Volt Ref transitionGraph; }; - struct AnimationState + enum class StateMachineStateType { - AnimationState(const std::string& aName, bool aIsEntry, bool aIsAny) - : name(aName), isEntry(aIsEntry), isAny(aIsAny) - {} + AnimationState, + AliasState, + EntryState + }; + struct StateMachineState + { + StateMachineState(const std::string& aName, StateMachineStateType aStateType) + :name(aName), stateType(aStateType) + { + + } std::vector transitions; std::string name; - Ref stateGraph; UUID id{}; - UUID pinId{}; - UUID pinId2{}; + UUID topPinId{}; + UUID bottomPinId{}; + const StateMachineStateType stateType; + + //This is used by the node library to save the positions and stuff for the nodes std::string editorState; - bool isEntry = false; - bool isAny = false; + }; + struct AnimationState : public StateMachineState + { + AnimationState(const std::string& aName) + : StateMachineState(aName, StateMachineStateType::AnimationState) + {} + + Ref stateGraph; + float startTime = 0.f; float speed = 1.f; }; + struct AnimationAliasState : public StateMachineState + { + AnimationAliasState(const std::string& aName) + : StateMachineState(aName, StateMachineStateType::AliasState) + { + } + + std::vector transitionFromStates; + + }; + class AnimationStateMachine { public: @@ -60,10 +88,9 @@ namespace Volt void Update(float deltaTime); const GraphKey::AnimationOutputData Sample(Ref skeleton); - void AddState(const std::string& name, bool isEntry = false, bool isAny = false); + void AddState(const std::string& name, StateMachineStateType aStateType, const UUID id = 0); void AddTransition(const UUID startState, const UUID endState); - Ref CreateState(const std::string& name, bool isEntry, const UUID id); Ref CreateTransition(Volt::UUID id); void RemoveState(const UUID id); @@ -71,17 +98,17 @@ namespace Volt void SetStartState(const UUID stateId); - AnimationState* GetStateById(const UUID stateId) const; + StateMachineState* GetStateById(const UUID stateId) const; AnimationTransition* GetTransitionById(const UUID transitionId) const; - AnimationState* GetStateFromPin(const UUID outputId) const; + StateMachineState* GetStateFromPin(const UUID outputId) const; const int32_t GetStateIndexFromId(const UUID stateId) const; Ref CreateCopy(GraphKey::Graph* ownerGraph, Wire::EntityId entity = 0) const; void OnEvent(Event& e); - inline const std::vector>& GetStates() const { return myStates; } + inline const std::vector>& GetStates() const { return myStates; } inline const std::vector>& GetTransitions() const { return myTransitions; } inline const std::string& GetEditorState() const { return myState; } inline const AssetHandle GetSkeletonHandle() const { return mySkeletonHandle; } @@ -98,6 +125,9 @@ namespace Volt const bool ShouldTransition(const UUID transitionId, const UUID currentStateId) const; const GraphKey::AnimationOutputData CrossfadeTransition(); const GraphKey::AnimationOutputData SampleState(int32_t stateIndex); + + Ref GetAnimationState(uint32_t aIndex); + Ref AsAnimationState(Ref aState); void SetNextState(const UUID targetStateId, const UUID transitionId); @@ -113,7 +143,7 @@ namespace Volt float myCurrentBlendTotalTime = 0.f; float myCurrentBlendingTime = 0.f; - std::vector> myStates; + std::vector> myStates; std::vector> myTransitions; AssetHandle mySkeletonHandle = 0; From 061fc5ff39785cce825ba060e0bcb374086fbb87 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Fri, 8 Sep 2023 18:12:21 +0200 Subject: [PATCH 06/18] =?UTF-8?q?Started=20adding=20some=20utilities=20for?= =?UTF-8?q?=20creating=20enums=20and=20worked=20some=20on=20the=20state=20?= =?UTF-8?q?mach=C3=ADne=20stransition,=20push=20to=20work=20from=20differe?= =?UTF-8?q?nt=20computer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Nodes/Animation/StateMachineNodes.cpp | 3 +- .../Volt/Animation/AnimationStateMachine.cpp | 53 ++++-- .../Volt/Animation/AnimationStateMachine.h | 14 +- Volt/Volt/src/Volt/Utility/EnumUtil.cpp | 3 + Volt/Volt/src/Volt/Utility/EnumUtil.h | 166 ++++++++++++++++++ 5 files changed, 218 insertions(+), 21 deletions(-) create mode 100644 Volt/Volt/src/Volt/Utility/EnumUtil.cpp create mode 100644 Volt/Volt/src/Volt/Utility/EnumUtil.h diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp index 4b0d1e22d..0b899837f 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp @@ -64,9 +64,8 @@ namespace GraphKey out << YAML::BeginMap; { VT_SERIALIZE_PROPERTY(name, state->name, out); - VT_SERIALIZE_PROPERTY(isEntry, state->isEntry, out); - VT_SERIALIZE_PROPERTY(isAny, state->isAny, out); VT_SERIALIZE_PROPERTY(editorState, state->editorState, out); + VT_SERIALIZE_PROPERTY(stateType, static_cast(state->stateType), out); VT_SERIALIZE_PROPERTY(id, state->id, out); VT_SERIALIZE_PROPERTY(pinId, state->topPinId, out); diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index 3d353518c..f4579fd74 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -13,6 +13,14 @@ #include +#include "Volt/Utility/EnumUtil.h" + +CREATE_ENUM(TestEnum, uint32_t, + One, + Two, + Three +); + namespace Volt { AnimationStateMachine::AnimationStateMachine(const std::string& name, AssetHandle aSkeletonHandle) @@ -194,7 +202,7 @@ namespace Volt case StateMachineStateType::AliasState: { - auto aliasState = CreateRef(name); + auto aliasState = CreateRef(name); myStates.emplace_back(aliasState); break; } @@ -278,8 +286,8 @@ namespace Volt auto transition = *it; - AnimationState* fromState = GetStateById(transition->fromState); - AnimationState* toState = GetStateById(transition->toState); + StateMachineState* fromState = GetStateById(transition->fromState); + StateMachineState* toState = GetStateById(transition->toState); fromState->transitions.erase(std::remove(fromState->transitions.begin(), fromState->transitions.end(), transition->id), fromState->transitions.end()); toState->transitions.erase(std::remove(toState->transitions.begin(), toState->transitions.end(), transition->id), toState->transitions.end()); @@ -319,7 +327,7 @@ namespace Volt return nullptr; } - AnimationState* AnimationStateMachine::GetStateFromPin(const UUID pinId) const + StateMachineState* AnimationStateMachine::GetStateFromPin(const UUID pinId) const { auto it = std::find_if(myStates.begin(), myStates.end(), [pinId](const auto& lhs) { return lhs->topPinId == pinId || lhs->bottomPinId == pinId; }); if (it != myStates.end()) @@ -352,16 +360,35 @@ namespace Volt for (const auto& state : myStates) { - Ref newState = CreateRef(state->name, state->isEntry, state->isAny); + Ref newState; + if (state->stateType == StateMachineStateType::AnimationState) + { + newState = CreateRef(state->name, state->stateType); + auto newAnimState = std::reinterpret_pointer_cast(newState); + auto oldAnimState = std::reinterpret_pointer_cast(state); + if (oldAnimState->stateGraph) + { + newAnimState->stateGraph = oldAnimState->stateGraph->CreateCopy(entity); + newAnimState->stateGraph->SetParentBlackboard(&ownerGraph->GetBlackboard()); + } + } + else if (state->stateType == StateMachineStateType::AliasState) + { + newState = CreateRef(state->name); + auto newAliasState = std::reinterpret_pointer_cast(newState); + auto oldAliasState = std::reinterpret_pointer_cast(state); + + newAliasState->transitionFromStates = oldAliasState->transitionFromStates; + } + else + { + newState = CreateRef(state->name, state->stateType); + } newState->transitions = state->transitions; newState->id = state->id; newState->topPinId = state->topPinId; newState->bottomPinId = state->bottomPinId; - if (state->stateGraph) - { - newState->stateGraph = state->stateGraph->CreateCopy(entity); - newState->stateGraph->SetParentBlackboard(&ownerGraph->GetBlackboard()); - } + newState->editorState = state->editorState; newStateMachine->myStates.emplace_back(newState); } @@ -417,7 +444,7 @@ namespace Volt // if (!playerNodes.empty()) // { - // Ref longestAnimation; + // Ref ; // Ref longestPlayer; // float longestAnimationTime = std::numeric_limits::lowest(); // for (const auto& player : playerNodes) @@ -503,7 +530,7 @@ namespace Volt const GraphKey::AnimationOutputData AnimationStateMachine::SampleState(int32_t stateIndex) { - auto state = myStates.at(stateIndex); + auto state = GetAnimationState(stateIndex); if (!state) { return {}; @@ -559,7 +586,7 @@ namespace Volt myCurrentBlendingTime = 0.f; } - auto statePtr = myStates.at(myCurrentState); + auto statePtr = GetAnimationState(myCurrentState); statePtr->startTime = AnimationManager::globalClock; statePtr->stateGraph->SetStartTime(AnimationManager::globalClock); } diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h index 03abda4fe..366d3982d 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h @@ -31,7 +31,7 @@ namespace Volt Ref transitionGraph; }; - enum class StateMachineStateType + enum class StateMachineStateType : uint8_t { AnimationState, AliasState, @@ -45,6 +45,7 @@ namespace Volt { } + std::vector transitions; std::string name; @@ -61,7 +62,8 @@ namespace Volt { AnimationState(const std::string& aName) : StateMachineState(aName, StateMachineStateType::AnimationState) - {} + { + } Ref stateGraph; @@ -69,9 +71,9 @@ namespace Volt float speed = 1.f; }; - struct AnimationAliasState : public StateMachineState + struct AliasState : public StateMachineState { - AnimationAliasState(const std::string& aName) + AliasState(const std::string& aName) : StateMachineState(aName, StateMachineStateType::AliasState) { } @@ -128,12 +130,12 @@ namespace Volt Ref GetAnimationState(uint32_t aIndex); Ref AsAnimationState(Ref aState); - + void SetNextState(const UUID targetStateId, const UUID transitionId); std::string myState; std::string myName; - + int32_t myStartState = -1; int32_t myCurrentState = -1; int32_t myLastState = -1; diff --git a/Volt/Volt/src/Volt/Utility/EnumUtil.cpp b/Volt/Volt/src/Volt/Utility/EnumUtil.cpp new file mode 100644 index 000000000..d754dea54 --- /dev/null +++ b/Volt/Volt/src/Volt/Utility/EnumUtil.cpp @@ -0,0 +1,3 @@ +#include "vtpch.h" +#include "EnumUtil.h" + diff --git a/Volt/Volt/src/Volt/Utility/EnumUtil.h b/Volt/Volt/src/Volt/Utility/EnumUtil.h new file mode 100644 index 000000000..af3977293 --- /dev/null +++ b/Volt/Volt/src/Volt/Utility/EnumUtil.h @@ -0,0 +1,166 @@ +#pragma once +#include "Volt/Core/Base.h" +#include +namespace Utils +{ + /// + /// Class for automatically generating enum to string and string to enum functions. + /// + class EnumUtil + { + public: + static std::string ToString(std::string aEnumName, uint64_t aEnumValue) + { + return myRegistry[aEnumName][aEnumValue]; + } + + //to enum + template + static T ToEnum(std::string aEnumName, std::string aEnumValue) + { + auto enumPair = myRegistry[aEnumName]; + } + + static bool RegisterEnum(const std::string& name, const std::string& definitionData) + { + //parse definition data into umap + std::unordered_map enumMap; + + const std::string allLetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + /* + + enum class Test : uint64_t + { + One = 10, Two = 1 << 2, Three = 0x1000000000010011 + }; inline static bool Test_reg = Utils::EnumUtil::RegisterEnum("Test", "One = 10, Two = 1 << 2, Three = 0x1000000000010011"); inline static std::string ToString(Test aEnumValue) + { + return Utils::EnumUtil::ToString("Test", static_cast(aEnumValue)); + }; + + */ + size_t stringOffset = definitionData.find_first_of(allLetters); + uint64_t highestValueSoFar = 0; + while (stringOffset != std::string::npos) + { + const size_t memberNameEndOffset = definitionData.find_first_not_of(allLetters, stringOffset); + + std::string memberName = definitionData.substr(stringOffset, memberNameEndOffset - stringOffset); + uint64_t memberValue = 0; + + VT_CORE_ASSERT(!memberName.empty(), "When Registering an enum, you must provide a name for each member"); + + //find the comma + size_t endOfMemberOffset = definitionData.find_first_of(',', memberNameEndOffset); + if (endOfMemberOffset == std::string::npos) + { + //this is the last member so instead take the end of the string + endOfMemberOffset = definitionData.size(); + } + + std::string memberValueString = definitionData.substr(memberNameEndOffset, endOfMemberOffset - memberNameEndOffset); + + //if the value string contains a = then we need to parse it else we just increment the highest value so far + if (memberValueString.contains('=')) + { + //remove whitespace + memberValueString.erase(std::remove_if(memberValueString.begin(), memberValueString.end(), isspace), memberValueString.end()); + + //remove the = + memberValueString.erase(std::remove(memberValueString.begin(), memberValueString.end(), '='), memberValueString.end()); + + //if the value is hex + if (memberValueString.contains('x')) + { + memberValue = std::stoull(memberValueString, nullptr, 16); + } + //if the value is binary + else if (memberValueString.contains('b')) + { + memberValue = std::stoull(memberValueString, nullptr, 2); + } + //if the value is bitshifted to the left + else if (memberValueString.contains('<')) + { + //split string along "<<" + const size_t bitshiftOffset = memberValueString.find_first_of('<'); + std::string base = memberValueString.substr(0, bitshiftOffset); + std::string shift = memberValueString.substr(bitshiftOffset + 2, memberValueString.size() - bitshiftOffset - 2); + + memberValue = std::stoull(base, nullptr, 10) << std::stoull(shift, nullptr, 10); + } + //if the value is bitshifted to the right + else if (memberValueString.contains('>')) + { + //split string along ">>" + const size_t bitshiftOffset = memberValueString.find_first_of('>'); + std::string base = memberValueString.substr(0, bitshiftOffset); + std::string shift = memberValueString.substr(bitshiftOffset + 2, memberValueString.size() - bitshiftOffset - 2); + + memberValue = std::stoull(base, nullptr, 10) >> std::stoull(shift, nullptr, 10); + } + //if the value is a number + else + { + memberValue = std::stoull(memberValueString); + } + } + else + { + memberValue = highestValueSoFar + 1; + } + + highestValueSoFar = memberValue; + + enumMap[memberValue] = memberName; + + stringOffset = definitionData.find_first_of(allLetters, endOfMemberOffset); + } + + + myRegistry.insert({ name, enumMap }); + + + //parse definition data + + //add to registry + } + + + + private: + //> + static std::unordered_map> myRegistry; + }; +} + +#define CREATE_ENUM(enumName, type, ...)\ +enum class enumName : type\ +{\ + __VA_ARGS__\ +};\ +inline static bool enumName##_reg = Utils::EnumUtil::RegisterEnum(#enumName, #__VA_ARGS__); \ +inline static std::string ToString(enumName aEnumValue) { return Utils::EnumUtil::ToString(#enumName, static_cast(aEnumValue)); } + +//implicit cast to enum +template +inline T operator|(T aLeft, T aRight) +{ + return static_cast(static_cast(aLeft) | static_cast(aRight)); +} + +enum class Test : uint64_t +{ + One = 10, Two, Three = 0x1000000000010011, Four +}; inline static bool Test_reg = Utils::EnumUtil::RegisterEnum("Test", "One = 10, Two = 1 << 2, Three = 0x1000000000010011"); inline static std::string ToString(Test aEnumValue) +{ + return Utils::EnumUtil::ToString("Test", static_cast(aEnumValue)); +}; + +/* +enum class Test : uint32_t { + One, Two, Three +};inline static bool Test_reg = EnumUtil::RegisterEnum("Test", "One, Two, Three"); inline static std::string ToString(Test aEnumValue) { + return EnumUtil::ToString("Test", static_cast(aEnumValue)); +} +*/ From 0f9622447dfdcfabbfc008b3d64fdbb8a20d8402 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Thu, 28 Sep 2023 21:04:10 +0200 Subject: [PATCH 07/18] Added Enum define and worked on animation graph --- .../Nodes/Animation/StateMachineNodes.cpp | 79 +++++++---- .../Animation/StateMachineTransitionNodes.cpp | 2 +- .../AnimationGraph/AnimationGraphPanel.cpp | 20 +-- .../Volt/Animation/AnimationStateMachine.cpp | 42 ++++-- .../Volt/Animation/AnimationStateMachine.h | 17 +-- Volt/Volt/src/Volt/Utility/EnumUtil.h | 129 +++++++++++------- 6 files changed, 183 insertions(+), 106 deletions(-) diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp index 0b899837f..9cf1f3d41 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp @@ -65,11 +65,11 @@ namespace GraphKey { VT_SERIALIZE_PROPERTY(name, state->name, out); VT_SERIALIZE_PROPERTY(editorState, state->editorState, out); - VT_SERIALIZE_PROPERTY(stateType, static_cast(state->stateType), out); + VT_SERIALIZE_PROPERTY(stateType, ToString(state->stateType), out); VT_SERIALIZE_PROPERTY(id, state->id, out); - VT_SERIALIZE_PROPERTY(pinId, state->topPinId, out); - VT_SERIALIZE_PROPERTY(pinId2, state->bottomPinId, out); + VT_SERIALIZE_PROPERTY(topPinId, state->topPinId, out); + VT_SERIALIZE_PROPERTY(bottomPinId, state->bottomPinId, out); out << YAML::Key << "Transitions" << YAML::BeginSeq; for (const auto& transition : state->transitions) @@ -77,11 +77,24 @@ namespace GraphKey out << transition; } out << YAML::EndSeq; - - if (state->stateGraph) + if (state->stateType == Volt::StateMachineStateType::AnimationState) + { + auto animState = Volt::AnimationStateMachine::AsAnimationState(state); + if (animState->stateGraph) + { + VT_SERIALIZE_PROPERTY(skeletonHandle, animState->stateGraph->GetSkeletonHandle(), out); + Graph::Serialize(animState->stateGraph, out); + } + } + else if (state->stateType == Volt::StateMachineStateType::AliasState) { - VT_SERIALIZE_PROPERTY(skeletonHandle, state->stateGraph->GetSkeletonHandle(), out); - Graph::Serialize(state->stateGraph, out); + auto aliasState = std::reinterpret_pointer_cast(state); + out << YAML::Key << "TransitionFromStates" << YAML::BeginSeq; + for (const auto& transition : aliasState->transitionFromStates) + { + out << transition; + } + out << YAML::EndSeq; } } out << YAML::EndMap; @@ -133,30 +146,45 @@ namespace GraphKey std::string stateName; bool stateIsEntry; Volt::UUID stateId = Volt::UUID(0); + std::string stateTypeString; VT_DESERIALIZE_PROPERTY(name, stateName, stateNode, std::string("Null")); - VT_DESERIALIZE_PROPERTY(isEntry, stateIsEntry, stateNode, false); VT_DESERIALIZE_PROPERTY(id, stateId, stateNode, Volt::UUID(0)); + VT_DESERIALIZE_PROPERTY(stateType, stateTypeString, stateNode, std::string("Null")); + + Volt::StateMachineStateType stateType = ToEnum(stateTypeString); - auto newState = myStateMachine->CreateState(stateName, stateIsEntry, stateId); + auto newState = myStateMachine->AddState(stateName, stateType, stateId); VT_DESERIALIZE_PROPERTY(editorState, newState->editorState, stateNode, std::string("")); - VT_DESERIALIZE_PROPERTY(pinId, newState->topPinId, stateNode, Volt::UUID(0)); - VT_DESERIALIZE_PROPERTY(pinId2, newState->bottomPinId, stateNode, Volt::UUID(0)); - VT_DESERIALIZE_PROPERTY(isAny, newState->isAny, stateNode, false); + VT_DESERIALIZE_PROPERTY(topPinId, newState->topPinId, stateNode, Volt::UUID(0)); + VT_DESERIALIZE_PROPERTY(bottomPinId, newState->bottomPinId, stateNode, Volt::UUID(0)); for (const auto& transitionNode : stateNode["Transitions"]) { newState->transitions.emplace_back(transitionNode.as()); } - if (stateNode["Graph"]) + if (stateType == Volt::StateMachineStateType::AnimationState) + { + auto animState = Volt::AnimationStateMachine::AsAnimationState(newState); + if (stateNode["Graph"]) + { + Volt::AssetHandle characterHandle; + VT_DESERIALIZE_PROPERTY(characterHandle, characterHandle, stateNode, Volt::AssetHandle(0)); + animState->stateGraph = CreateRef(characterHandle); + Graph::Deserialize(animState->stateGraph, stateNode["Graph"]); + } + } + else if (stateType == Volt::StateMachineStateType::AliasState) { - Volt::AssetHandle characterHandle; - VT_DESERIALIZE_PROPERTY(characterHandle, characterHandle, stateNode, Volt::AssetHandle(0)); - newState->stateGraph = CreateRef(characterHandle); - Graph::Deserialize(newState->stateGraph, stateNode["Graph"]); + auto aliasState = std::reinterpret_pointer_cast(newState); + for (const auto& transitionNode : stateNode["TransitionFromStates"]) + { + aliasState->transitionFromStates.emplace_back(transitionNode.as()); + } } + } for (const auto& transitionNode : rootNode["Transitions"]) @@ -172,7 +200,7 @@ namespace GraphKey auto newTransition = myStateMachine->CreateTransition(transitionId); newTransition->fromState = transitionFromState; newTransition->toState = transitionToState; - + VT_DESERIALIZE_PROPERTY(shouldBlend, newTransition->shouldBlend, transitionNode, false); VT_DESERIALIZE_PROPERTY(blendTime, newTransition->blendTime, transitionNode, 1.f); @@ -181,33 +209,26 @@ namespace GraphKey newTransition->transitionGraph = CreateRef(); newTransition->transitionGraph->SetStateMachine(myStateMachine.get()); newTransition->transitionGraph->SetTransitionID(transitionId); - + Graph::Deserialize(std::reinterpret_pointer_cast(newTransition->transitionGraph), transitionNode["Graph"]); } } - bool hasAnyState = false; bool hasEntryState = false; for (const auto& state : myStateMachine->GetStates()) { - hasAnyState |= state->isAny; - hasEntryState |= state->isEntry; + hasEntryState |= state->stateType == Volt::StateMachineStateType::EntryState; - if (hasEntryState && hasAnyState) + if (hasEntryState) { break; } } - if (!hasAnyState) - { - myStateMachine->AddState("Any", false, true); - } - if (!hasEntryState) { - myStateMachine->AddState("Entry", true); + myStateMachine->AddState("Entry", Volt::StateMachineStateType::EntryState); } } diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp index a00760303..e44a92eeb 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineTransitionNodes.cpp @@ -17,7 +17,7 @@ namespace GraphKey const auto animTransitionGraph = static_cast(aGraph); const auto stateMachine = animTransitionGraph->GetStateMachine(); const auto transition = stateMachine->GetTransitionById(animTransitionGraph->GetTransitionID()); - const auto fromState = stateMachine->GetStateById(transition->fromState); + const auto fromState = stateMachine->GetAnimationStateById(transition->fromState); return fromState->stateGraph->GetRelevantAnimationNode(); } diff --git a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp index dffb2795f..068036f59 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp @@ -286,7 +286,7 @@ void AnimationGraphPanel::DrawNodes() // Node { auto id = ed::GetDoubleClickedNode(); - auto state = GetLastEntry().stateMachine->GetStateById(id.Get()); + auto state = GetLastEntry().stateMachine->GetAnimationStateById(id.Get()); if (state && state->stateGraph) { @@ -420,7 +420,7 @@ void AnimationGraphPanel::DrawNodesPanel() { if (ImGui::Button("Add state")) { - GetLastEntry().stateMachine->AddState("New State", false); + GetLastEntry().stateMachine->AddState("New State", Volt::StateMachineStateType::AnimationState); } } ImGui::End(); @@ -462,7 +462,7 @@ void AnimationGraphPanel::OnDeleteNode(const Volt::UUID id) { auto stateMachine = GetLastEntry().stateMachine; auto state = stateMachine->GetStateById(id); - if (state && !state->isEntry && !state->isAny) + if (state && state->stateType != Volt::StateMachineStateType::EntryState) { stateMachine->RemoveState(id); } @@ -725,11 +725,11 @@ void AnimationGraphPanel::DrawStateMachineNodes() auto mainColor = IM_COL32(29, 29, 29, 200); - if (state->isEntry) + if (state->stateType == Volt::StateMachineStateType::EntryState) { mainColor = IM_COL32(255, 174, 0, 255); } - else if (state->isAny) + else if (state->stateType == Volt::StateMachineStateType::EntryState) { mainColor = IM_COL32(92, 171, 255, 255); } @@ -803,23 +803,25 @@ void AnimationGraphPanel::OnBeginCreateStateMachine() return false; }); + const bool endIsEntry = endState->stateType == Volt::StateMachineStateType::EntryState; + const bool endIsAlias = endState->stateType == Volt::StateMachineStateType::AliasState; if (transitionsToEndCount > 1 || sameStateIt != startState->transitions.end()) { ed::RejectNewItem(ImColor{ 255, 0, 0 }, 2.f); showLabel("x States are already connected", ImColor{ 255, 0, 0 }); } - else if (endState->isEntry) + else if (endIsEntry) { ed::RejectNewItem(ImColor{ 255, 0, 0 }, 2.f); showLabel("x You cannot go to Entry state!", ImColor{ 255, 0, 0 }); } - else if (endState->isAny) + else if (endIsAlias) { ed::RejectNewItem(ImColor{ 255, 0, 0 }, 2.f); - showLabel("x You cannot go to Any state!", ImColor{ 255, 0, 0 }); + showLabel("x You cannot go to Alias state!", ImColor{ 255, 0, 0 }); } - if (ed::AcceptNewItem(ImColor{ 1.f, 1.f, 1.f }, 2.f) && sameStateIt == startState->transitions.end() && !endState->isEntry && !endState->isAny) + if (ed::AcceptNewItem(ImColor{ 1.f, 1.f, 1.f }, 2.f) && sameStateIt == startState->transitions.end() && !endIsAlias && !endIsAlias) { stateMachine->AddTransition(startState->id, endState->id); } diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index f4579fd74..3be3f0389 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -15,11 +15,16 @@ #include "Volt/Utility/EnumUtil.h" -CREATE_ENUM(TestEnum, uint32_t, - One, - Two, - Three -); +enum class TestEnum : uint32_t +{ + One, Two, Three +}; inline static bool TestEnum_reg = Utils::EnumUtil::RegisterEnum("TestEnum", "One, Two, Three"); inline static std::string ToString(TestEnum aEnumValue) +{ + return Utils::EnumUtil::ToString("TestEnum", static_cast(aEnumValue)); +}/*template inline static TestEnum ToEnum(const std::string& aEnumString) +{ + return Utils::EnumUtil::ToEnum("TestEnum", aEnumString); +};*/ namespace Volt { @@ -187,7 +192,7 @@ namespace Volt return transition; } - void AnimationStateMachine::AddState(const std::string& name, StateMachineStateType aStateType, const UUID id) + Ref AnimationStateMachine::AddState(const std::string& name, StateMachineStateType aStateType, const UUID id) { switch (aStateType) { @@ -221,12 +226,18 @@ namespace Volt if (!alreadyHasEntry) { - auto state = CreateRef("Entry", aStateType); + auto state = CreateRef("Entry", aStateType); myStates.emplace_back(state); } break; } + + default: + VT_CORE_ASSERT(false, "State type construction not implemented."); + break; } + + return myStates.back(); } void AnimationStateMachine::AddTransition(const UUID startStateId, const UUID endStateId) @@ -316,6 +327,19 @@ namespace Volt return nullptr; } + AnimationState* AnimationStateMachine::GetAnimationStateById(const UUID stateId) const + { + auto it = std::find_if(myStates.begin(), myStates.end(), [stateId](const auto& lhs) { return lhs->id == stateId; }); + if (it != myStates.end()) + { + if (it->get()->stateType == StateMachineStateType::AnimationState) + { + return std::reinterpret_pointer_cast(*it).get(); + } + } + return nullptr; + } + AnimationTransition* AnimationStateMachine::GetTransitionById(const UUID transitionId) const { auto it = std::find_if(myTransitions.begin(), myTransitions.end(), [transitionId](const auto& lhs) { return lhs->id == transitionId; }); @@ -363,7 +387,7 @@ namespace Volt Ref newState; if (state->stateType == StateMachineStateType::AnimationState) { - newState = CreateRef(state->name, state->stateType); + newState = CreateRef(state->name); auto newAnimState = std::reinterpret_pointer_cast(newState); auto oldAnimState = std::reinterpret_pointer_cast(state); if (oldAnimState->stateGraph) @@ -377,7 +401,7 @@ namespace Volt newState = CreateRef(state->name); auto newAliasState = std::reinterpret_pointer_cast(newState); auto oldAliasState = std::reinterpret_pointer_cast(state); - + newAliasState->transitionFromStates = oldAliasState->transitionFromStates; } else diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h index 366d3982d..dc90c4f55 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.h @@ -7,6 +7,8 @@ #include +#include "Volt/Utility/EnumUtil.h" + namespace GraphKey { class Graph; @@ -31,12 +33,10 @@ namespace Volt Ref transitionGraph; }; - enum class StateMachineStateType : uint8_t - { + CREATE_ENUM_TYPED(StateMachineStateType, uint8_t, AnimationState, AliasState, - EntryState - }; + EntryState); struct StateMachineState { @@ -68,7 +68,6 @@ namespace Volt Ref stateGraph; float startTime = 0.f; - float speed = 1.f; }; struct AliasState : public StateMachineState @@ -90,7 +89,7 @@ namespace Volt void Update(float deltaTime); const GraphKey::AnimationOutputData Sample(Ref skeleton); - void AddState(const std::string& name, StateMachineStateType aStateType, const UUID id = 0); + Ref AddState(const std::string& name, StateMachineStateType aStateType, const UUID id = 0); void AddTransition(const UUID startState, const UUID endState); Ref CreateTransition(Volt::UUID id); @@ -101,6 +100,7 @@ namespace Volt void SetStartState(const UUID stateId); StateMachineState* GetStateById(const UUID stateId) const; + AnimationState* GetAnimationStateById(const UUID stateId) const; AnimationTransition* GetTransitionById(const UUID transitionId) const; StateMachineState* GetStateFromPin(const UUID outputId) const; @@ -116,12 +116,14 @@ namespace Volt inline const AssetHandle GetSkeletonHandle() const { return mySkeletonHandle; } inline const std::string& GetName() const { return myName; } - inline void SetEditorState(const std::string& state) { myState = state; } + inline + void SetEditorState(const std::string& state) { myState = state; } inline void SetName(const std::string& name) { myName = name; } void SetSkeletonHandle(AssetHandle aSkeletonHandle); void Clear(); + static Ref AsAnimationState(Ref aState); private: const bool ShouldTransition(const UUID transitionId, const UUID currentStateId) const; @@ -129,7 +131,6 @@ namespace Volt const GraphKey::AnimationOutputData SampleState(int32_t stateIndex); Ref GetAnimationState(uint32_t aIndex); - Ref AsAnimationState(Ref aState); void SetNextState(const UUID targetStateId, const UUID transitionId); diff --git a/Volt/Volt/src/Volt/Utility/EnumUtil.h b/Volt/Volt/src/Volt/Utility/EnumUtil.h index af3977293..23269156d 100644 --- a/Volt/Volt/src/Volt/Utility/EnumUtil.h +++ b/Volt/Volt/src/Volt/Utility/EnumUtil.h @@ -1,6 +1,7 @@ #pragma once #include "Volt/Core/Base.h" #include +#include namespace Utils { /// @@ -18,32 +19,30 @@ namespace Utils template static T ToEnum(std::string aEnumName, std::string aEnumValue) { - auto enumPair = myRegistry[aEnumName]; + auto enumMap = myRegistry[aEnumName]; + for (auto& pair : enumMap) + { + if (pair.second == aEnumValue) + { + return pair.first; + } + } } static bool RegisterEnum(const std::string& name, const std::string& definitionData) { - //parse definition data into umap - std::unordered_map enumMap; - const std::string allLetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - /* - - enum class Test : uint64_t - { - One = 10, Two = 1 << 2, Three = 0x1000000000010011 - }; inline static bool Test_reg = Utils::EnumUtil::RegisterEnum("Test", "One = 10, Two = 1 << 2, Three = 0x1000000000010011"); inline static std::string ToString(Test aEnumValue) - { - return Utils::EnumUtil::ToString("Test", static_cast(aEnumValue)); - }; - - */ size_t stringOffset = definitionData.find_first_of(allLetters); - uint64_t highestValueSoFar = 0; + std::vector enumNames; + std::vector enumValues; while (stringOffset != std::string::npos) { - const size_t memberNameEndOffset = definitionData.find_first_not_of(allLetters, stringOffset); + size_t memberNameEndOffset = definitionData.find_first_not_of(allLetters, stringOffset); + if (memberNameEndOffset == std::string::npos) + { + memberNameEndOffset = definitionData.size(); + } std::string memberName = definitionData.substr(stringOffset, memberNameEndOffset - stringOffset); uint64_t memberValue = 0; @@ -61,7 +60,7 @@ namespace Utils std::string memberValueString = definitionData.substr(memberNameEndOffset, endOfMemberOffset - memberNameEndOffset); //if the value string contains a = then we need to parse it else we just increment the highest value so far - if (memberValueString.contains('=')) + if (memberValueString.find('=') != std::string::npos) { //remove whitespace memberValueString.erase(std::remove_if(memberValueString.begin(), memberValueString.end(), isspace), memberValueString.end()); @@ -70,27 +69,27 @@ namespace Utils memberValueString.erase(std::remove(memberValueString.begin(), memberValueString.end(), '='), memberValueString.end()); //if the value is hex - if (memberValueString.contains('x')) + if (memberValueString.find('x') != std::string::npos) { memberValue = std::stoull(memberValueString, nullptr, 16); } //if the value is binary - else if (memberValueString.contains('b')) + else if (memberValueString.find('b') != std::string::npos) { memberValue = std::stoull(memberValueString, nullptr, 2); } //if the value is bitshifted to the left - else if (memberValueString.contains('<')) + else if (memberValueString.find('<') != std::string::npos) { //split string along "<<" const size_t bitshiftOffset = memberValueString.find_first_of('<'); std::string base = memberValueString.substr(0, bitshiftOffset); std::string shift = memberValueString.substr(bitshiftOffset + 2, memberValueString.size() - bitshiftOffset - 2); - + memberValue = std::stoull(base, nullptr, 10) << std::stoull(shift, nullptr, 10); } //if the value is bitshifted to the right - else if (memberValueString.contains('>')) + else if (memberValueString.find('>') != std::string::npos) { //split string along ">>" const size_t bitshiftOffset = memberValueString.find_first_of('>'); @@ -107,56 +106,86 @@ namespace Utils } else { - memberValue = highestValueSoFar + 1; + memberValue = std::numeric_limits::max(); } - - highestValueSoFar = memberValue; - - enumMap[memberValue] = memberName; stringOffset = definitionData.find_first_of(allLetters, endOfMemberOffset); + enumNames.push_back(memberName); + enumValues.push_back(memberValue); + } + for (int i = 0; i < enumValues.size(); i++) + { + if (enumValues[i] == std::numeric_limits::max()) + { + if (i == 0) + { + enumValues[i] = 0; + } + else + { + enumValues[i] = enumValues[i - 1] + 1; + } + } + } + auto& enumMap = myRegistry[name]; + for (int i = 0; i < enumNames.size(); i++) + { + enumMap.insert({ enumValues[i], enumNames[i] }); } - - myRegistry.insert({ name, enumMap }); - - - //parse definition data - - //add to registry + return true; } private: //> - static std::unordered_map> myRegistry; + inline static std::unordered_map> myRegistry; }; } -#define CREATE_ENUM(enumName, type, ...)\ +template inline static T ToEnum(const std::string& aEnumString) +{ + VT_CORE_ASSERT(false, "Never call this function with a type that does not have a specification, CREATE_ENUM automatically generates a specification for that type."); + return T(); +}; + +#define CREATE_ENUM_TYPED(enumName, type, ...)\ enum class enumName : type\ {\ __VA_ARGS__\ };\ -inline static bool enumName##_reg = Utils::EnumUtil::RegisterEnum(#enumName, #__VA_ARGS__); \ -inline static std::string ToString(enumName aEnumValue) { return Utils::EnumUtil::ToString(#enumName, static_cast(aEnumValue)); } +inline static bool enumName##_enum_reg = Utils::EnumUtil::RegisterEnum(typeid(enumName).name(), #__VA_ARGS__); \ +inline static std::string ToString(enumName aEnumValue) { return Utils::EnumUtil::ToString(#enumName, static_cast(aEnumValue)); }\ +template inline static enumName ToEnum(const std::string& aEnumString) { return Utils::EnumUtil::ToEnum(#enumName, aEnumString); } -//implicit cast to enum -template -inline T operator|(T aLeft, T aRight) -{ - return static_cast(static_cast(aLeft) | static_cast(aRight)); -} +#define CREATE_ENUM(enumName, ...) CREATE_ENUM_TYPED(enumName, uint32_t, __VA_ARGS__) -enum class Test : uint64_t -{ - One = 10, Two, Three = 0x1000000000010011, Four -}; inline static bool Test_reg = Utils::EnumUtil::RegisterEnum("Test", "One = 10, Two = 1 << 2, Three = 0x1000000000010011"); inline static std::string ToString(Test aEnumValue) + + +enum class yoo { - return Utils::EnumUtil::ToString("Test", static_cast(aEnumValue)); + apa = 2, + banan }; +//CREATE_ENUM(Test, uint64_t, +// One = 10, Two, Three = 0x1000000000010011, Four); + +//enum class Test : uint64_t +//{ +// One = 10, Two, Three = 0x1000000000010011, Four +//}; inline static bool Test_reg = Utils::EnumUtil::RegisterEnum("Test", "One = 10, Two, Three = 0x1000000000010011, Four"); inline static std::string ToString(Test aEnumValue) +//{ +// return Utils::EnumUtil::ToString("Test", static_cast(aEnumValue)); +//} +//template<> inline static Test ToEnum(const std::string& aEnumString) +//{ +// return Utils::EnumUtil::ToEnum("Test", aEnumString); +//}; + + + /* enum class Test : uint32_t { One, Two, Three From 45eac0b1a322fbf09ebc822ff35a0304f3e470e1 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Thu, 28 Sep 2023 22:42:58 +0200 Subject: [PATCH 08/18] Can Now save and load newly created animation graphs --- .../Assets/AG_NewAnimationGraph.vtanimgraph | 319 ++++++++++++ .../AG_NewAnimationGraph.vtanimgraph.vtmeta | 7 + .../Scenes/New Scene/Layers/layer_0.vtlayer | 455 ++++++++++++++++++ .../Assets/Scenes/New Scene/New Scene.vtscene | 2 + .../Scenes/New Scene/New Scene.vtscene.vtmeta | 7 + .../Volt-1.0_2023-9-28_21-19-29.dmp | 3 + .../Volt/Animation/AnimationStateMachine.cpp | 12 +- Volt/Volt/src/Volt/Utility/EnumUtil.h | 37 +- 8 files changed, 815 insertions(+), 27 deletions(-) create mode 100644 Project/Assets/AG_NewAnimationGraph.vtanimgraph create mode 100644 Project/Assets/AG_NewAnimationGraph.vtanimgraph.vtmeta create mode 100644 Project/Assets/Scenes/New Scene/Layers/layer_0.vtlayer create mode 100644 Project/Assets/Scenes/New Scene/New Scene.vtscene create mode 100644 Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta create mode 100644 Project/User/DebugDumps/Volt-1.0_2023-9-28_21-19-29.dmp diff --git a/Project/Assets/AG_NewAnimationGraph.vtanimgraph b/Project/Assets/AG_NewAnimationGraph.vtanimgraph new file mode 100644 index 000000000..18a9670b7 --- /dev/null +++ b/Project/Assets/AG_NewAnimationGraph.vtanimgraph @@ -0,0 +1,319 @@ +AnimationGraph: + state: "{\"nodes\":{\"node:15535915886176485439\":{\"location\":{\"x\":405,\"y\":358}},\"node:6385969710449639435\":{\"location\":{\"x\":648,\"y\":358}},\"node:8480674789647244649\":{\"location\":{\"x\":200,\"y\":330}}},\"selection\":[\"node:15535915886176485439\"],\"view\":{\"scroll\":{\"x\":-75.03631591796875,\"y\":81.7004241943359375},\"zoom\":1}}" + skeleton: 13037238043735750390 + Graph: + Nodes: + - id: 6385969710449639435 + type: OutputPoseNode + state: "{\"location\":{\"x\":648,\"y\":358}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 1116223553760952315 + outputs: + [] + - id: 15535915886176485439 + type: StateMachineNode + state: "{\"location\":{\"x\":405,\"y\":358}}" + nodeSpecific: + StateMachine: + name: New State Machine + editorState: "{\"nodes\":{\"node:17432209236957630761\":{\"location\":{\"x\":-60,\"y\":106}},\"node:1950752842845048714\":{\"location\":{\"x\":259,\"y\":106}},\"node:7304774921189200077\":{\"location\":{\"x\":0,\"y\":0}}},\"selection\":[\"link:1572480766934857440\"],\"view\":{\"scroll\":{\"x\":-297.270965576171875,\"y\":-180.524429321289062},\"zoom\":1.25}}" + skeletonHandle: 13037238043735750390 + States: + - name: Entry + editorState: "{\"location\":{\"x\":0,\"y\":0}}" + stateType: "EntryState" + id: 7304774921189200077 + topPinId: 9621627988814579497 + bottomPinId: 4927250641173997226 + Transitions: + - 17005180717603525355 + - name: Idle + editorState: "{\"location\":{\"x\":-60,\"y\":106}}" + stateType: "AnimationState" + id: 17432209236957630761 + topPinId: 15825692490210434475 + bottomPinId: 18324133014359639689 + Transitions: + - 10798705133392895707 + - 1572480766934857440 + - 17005180717603525355 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 17433134002475979740 + type: OutputPoseNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 8452758833709488893 + outputs: + [] + - id: 4996147987047880314 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-360,\"y\":2}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 7133807826044154591 + data: 6258146775014869030 + - name: Loop + id: 12834825700335543729 + data: true + - name: Speed + id: 7862539870619546363 + data: 1 + - name: Apply Root Motion + id: 10705778963449758788 + data: false + outputs: + - name: Output + id: 6010497014040324728 + Links: + - id: 2605469439307868061 + output: 6010497014040324728 + input: 8452758833709488893 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + Events: + [] + - name: Run + editorState: "{\"location\":{\"x\":259,\"y\":106}}" + stateType: "AnimationState" + id: 1950752842845048714 + topPinId: 4740537785744763331 + bottomPinId: 4624657758893323953 + Transitions: + - 10798705133392895707 + - 1572480766934857440 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 13426076502804087481 + type: OutputPoseNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 3421233894172881844 + outputs: + [] + - id: 17361164518170870504 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-424,\"y\":-14}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 14543805727531896772 + data: 6011248127994413100 + - name: Loop + id: 4988107830244877346 + data: true + - name: Speed + id: 8171781571855257977 + data: 1 + - name: Apply Root Motion + id: 2044524993034374907 + data: false + outputs: + - name: Output + id: 9820479950708669671 + Links: + - id: 17585703629848582944 + output: 9820479950708669671 + input: 3421233894172881844 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + Events: + [] + Transitions: + - id: 10798705133392895707 + fromState: 17432209236957630761 + toState: 1950752842845048714 + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 8633465504995857727 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 6283147234656143207 + outputs: + [] + - id: 15807458420179881769 + type: GetParameterFloat + state: "{\"location\":{\"x\":-434,\"y\":-26}}" + nodeSpecific: + {} + parameterId: 14039312185190483105 + inputs: + [] + outputs: + - name: Get + id: 17275541298324790604 + data: 0 + - id: 15138946532809883082 + type: GreaterThanNodeFloat + state: "{\"location\":{\"x\":-242,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: A + id: 15696274333971313495 + - name: B + id: 11572818433878567726 + data: 0.100000001 + outputs: + - name: Result + id: 7856391236549055648 + data: false + Links: + - id: 13665517633536683163 + output: 17275541298324790604 + input: 15696274333971313495 + - id: 11585084276723524783 + output: 7856391236549055648 + input: 6283147234656143207 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + Events: + [] + - id: 1572480766934857440 + fromState: 1950752842845048714 + toState: 17432209236957630761 + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 11811852917554264831 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 11696602043312855633 + outputs: + [] + - id: 6017078998554066927 + type: GetParameterFloat + state: "{\"location\":{\"x\":-466,\"y\":-10}}" + nodeSpecific: + {} + parameterId: 14039312185190483105 + inputs: + [] + outputs: + - name: Get + id: 3513545324590096529 + data: 0 + - id: 18262687194589351001 + type: LessThanNodeFloat + state: "{\"location\":{\"x\":-242,\"y\":28}}" + nodeSpecific: + {} + inputs: + - name: A + id: 16397881548503721767 + - name: B + id: 2880304990197283531 + data: 0.100000001 + outputs: + - name: Result + id: 8676350156264158797 + data: false + Links: + - id: 4102669916862002986 + output: 3513545324590096529 + input: 16397881548503721767 + - id: 16871075764672729521 + output: 8676350156264158797 + input: 11696602043312855633 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + Events: + [] + - id: 17005180717603525355 + fromState: 7304774921189200077 + toState: 17432209236957630761 + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 10160640609203915498 + type: TransitionOutputNode + state: "" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 8988458859617994958 + data: false + outputs: + [] + Links: + [] + Parameters: + [] + Events: + [] + inputs: + [] + outputs: + - name: Output + id: 4742437693566564646 + - id: 3101149124820700979 + type: SequencePlayerNode + state: "" + nodeSpecific: + {} + inputs: + - name: "" + id: 13157588941493601162 + data: 0 + - name: Loop + id: 13522739356889349303 + data: false + - name: Speed + id: 12740760014915239130 + data: 1 + - name: Apply Root Motion + id: 10642464686899377943 + data: false + outputs: + - name: Output + id: 18242652916695624758 + Links: + - id: 2779138869868000945 + output: 4742437693566564646 + input: 1116223553760952315 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + Events: + [] \ No newline at end of file diff --git a/Project/Assets/AG_NewAnimationGraph.vtanimgraph.vtmeta b/Project/Assets/AG_NewAnimationGraph.vtanimgraph.vtmeta new file mode 100644 index 000000000..065e10c8b --- /dev/null +++ b/Project/Assets/AG_NewAnimationGraph.vtanimgraph.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 2057522637158420406 + filePath: Assets/AG_NewAnimationGraph.vtanimgraph + type: 131072 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/Assets/Scenes/New Scene/Layers/layer_0.vtlayer b/Project/Assets/Scenes/New Scene/Layers/layer_0.vtlayer new file mode 100644 index 000000000..a6b59787c --- /dev/null +++ b/Project/Assets/Scenes/New Scene/Layers/layer_0.vtlayer @@ -0,0 +1,455 @@ +Layer: + name: Main + id: 0 + visible: true + locked: false + Entities: + - Entity: + id: 216860815 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Directional Light + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0.866025448, 0, 0, 0.49999997] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [4956947959302657279, 6431008363526150588] + properties: + - type: 7 + vectorType: 13 + name: Intensity + data: 1 + - type: 17 + vectorType: 13 + name: Color + data: [1, 1, 1] + - type: 7 + vectorType: 13 + name: Light Size + data: 1 + - type: 0 + vectorType: 13 + name: Soft Shadows + data: true + - type: 0 + vectorType: 13 + name: Cast Shadows + data: true + - Entity: + id: 608838673 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Camera + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 71.9000015, -500] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5524573352483143404, 11007889460122951339] + properties: + - type: 7 + vectorType: 13 + name: Aperture + data: 16 + - type: 7 + vectorType: 13 + name: Shutter Speed + data: 0.00999999978 + - type: 7 + vectorType: 13 + name: ISO + data: 100 + - type: 7 + vectorType: 13 + name: Field of View + data: 60 + - type: 7 + vectorType: 13 + name: Near plane + data: 1 + - type: 7 + vectorType: 13 + name: Far plane + data: 100000 + - type: 2 + vectorType: 13 + name: Priority + data: 0 + - Entity: + id: 1164275951 + components: + - guid: [5594831065701184629, 5808174883320445581] + properties: + - type: 10 + vectorType: 13 + name: Half Size + data: [50, 50, 50] + - type: 10 + vectorType: 13 + name: Offset + data: [0, 0, 0] + - type: 0 + vectorType: 13 + name: Is Trigger + data: false + - type: 16 + vectorType: 13 + name: Physics Material + data: 57928654030491085 + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Cube + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [23, 1, 30.6000004] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 10149696181569838305 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - Entity: + id: 3394346520 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Player + - guid: [4626977537440075682, 8666096866538760379] + properties: + - type: 16 + vectorType: 13 + name: Animation Graph + data: 2057522637158420406 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - type: 16 + vectorType: 13 + name: Override Skin + data: 0 + - type: 0 + vectorType: 13 + name: Apply Root Motion + data: false + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 52, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 15314435918099419685 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - guid: [5428802467633469958, 3006162545260469436] + properties: + - type: 21 + vectorType: 12 + name: ScriptNames + data: + - value: Project.Player + - type: 21 + vectorType: 16 + name: ScriptIds + data: + - value: 4135337104190223331 + MonoScripts: + - ScriptEntry: + name: Project.Player + id: 4135337104190223331 + properties: + - type: 7 + name: acceleration + enumName: "" + data: 10 + - type: 7 + name: runSpeed + enumName: "" + data: 350 + - type: 7 + name: sprintSpeed + enumName: "" + data: 472 + - type: 7 + name: deceleration + enumName: "" + data: 10 + - type: 7 + name: jumpForce + enumName: "" + data: 100 + - type: 7 + name: rotationSpeed + enumName: "" + data: 10 + - Entity: + id: 3963347453 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Skylight + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5130770350572262273, 9533246575187293344] + properties: + - type: 16 + vectorType: 13 + name: Environment Map + data: 0 + - type: 7 + vectorType: 13 + name: Intensity + data: 1 + - type: 7 + vectorType: 13 + name: LOD + data: 0 + - type: 7 + vectorType: 13 + name: Turbidity + data: 2 + - type: 7 + vectorType: 13 + name: Azimuth + data: 0 + - type: 7 + vectorType: 13 + name: Inclination + data: 0 + - type: 0 + vectorType: 13 + name: Show + data: true \ No newline at end of file diff --git a/Project/Assets/Scenes/New Scene/New Scene.vtscene b/Project/Assets/Scenes/New Scene/New Scene.vtscene new file mode 100644 index 000000000..c57cbadd7 --- /dev/null +++ b/Project/Assets/Scenes/New Scene/New Scene.vtscene @@ -0,0 +1,2 @@ +Scene: + name: New Scene \ No newline at end of file diff --git a/Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta b/Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta new file mode 100644 index 000000000..0b3e469e7 --- /dev/null +++ b/Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta @@ -0,0 +1,7 @@ +Metadata: + assetHandle: 9065200771951254108 + filePath: Assets/Scenes/New Scene/New Scene.vtscene + type: 256 + Dependencies: + [] + ? Properties \ No newline at end of file diff --git a/Project/User/DebugDumps/Volt-1.0_2023-9-28_21-19-29.dmp b/Project/User/DebugDumps/Volt-1.0_2023-9-28_21-19-29.dmp new file mode 100644 index 000000000..484f071c7 --- /dev/null +++ b/Project/User/DebugDumps/Volt-1.0_2023-9-28_21-19-29.dmp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5fa915af3c13b8dc043dff020ff118dee29e2b4686e27877f4247346d8e1073 +size 19235002 diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index 3be3f0389..eb43f2785 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -15,17 +15,6 @@ #include "Volt/Utility/EnumUtil.h" -enum class TestEnum : uint32_t -{ - One, Two, Three -}; inline static bool TestEnum_reg = Utils::EnumUtil::RegisterEnum("TestEnum", "One, Two, Three"); inline static std::string ToString(TestEnum aEnumValue) -{ - return Utils::EnumUtil::ToString("TestEnum", static_cast(aEnumValue)); -}/*template inline static TestEnum ToEnum(const std::string& aEnumString) -{ - return Utils::EnumUtil::ToEnum("TestEnum", aEnumString); -};*/ - namespace Volt { AnimationStateMachine::AnimationStateMachine(const std::string& name, AssetHandle aSkeletonHandle) @@ -237,6 +226,7 @@ namespace Volt break; } + myStates.back()->id = id; return myStates.back(); } diff --git a/Volt/Volt/src/Volt/Utility/EnumUtil.h b/Volt/Volt/src/Volt/Utility/EnumUtil.h index 23269156d..f72b7ea9d 100644 --- a/Volt/Volt/src/Volt/Utility/EnumUtil.h +++ b/Volt/Volt/src/Volt/Utility/EnumUtil.h @@ -5,26 +5,30 @@ namespace Utils { /// - /// Class for automatically generating enum to string and string to enum functions. + /// Class for automatically generating enum to string and string to enum functions. DO NOT CALL THESE FUNCTIONS DIRECTLY. /// class EnumUtil { public: - static std::string ToString(std::string aEnumName, uint64_t aEnumValue) + template + static std::string ToString(uint64_t aEnumValue) { - return myRegistry[aEnumName][aEnumValue]; + VT_CORE_ASSERT(myRegistry.contains(typeid(EnumType).name()), "Tried to Convert enum to string with an enum that is not registered! EnumName: {0}", typeid(EnumType).name()); + + return myRegistry[typeid(EnumType).name()][aEnumValue]; } //to enum - template - static T ToEnum(std::string aEnumName, std::string aEnumValue) + template + static EnumType ToEnum(std::string aEnumValue) { - auto enumMap = myRegistry[aEnumName]; - for (auto& pair : enumMap) + VT_CORE_ASSERT(myRegistry.contains(typeid(EnumType).name()), "Tried to convert string to enum that has not been registered! EnumName: {0}", typeid(EnumType).name()); + const auto& enumMap = myRegistry[typeid(EnumType).name()]; + for (const auto& pair : enumMap) { if (pair.second == aEnumValue) { - return pair.first; + return static_cast(pair.first); } } } @@ -146,18 +150,19 @@ namespace Utils template inline static T ToEnum(const std::string& aEnumString) { - VT_CORE_ASSERT(false, "Never call this function with a type that does not have a specification, CREATE_ENUM automatically generates a specification for that type."); - return T(); + return Utils::EnumUtil::ToEnum(aEnumString); }; #define CREATE_ENUM_TYPED(enumName, type, ...)\ -enum class enumName : type\ -{\ - __VA_ARGS__\ -};\ +enum class enumName : type \ +{ \ + __VA_ARGS__ \ +}; \ inline static bool enumName##_enum_reg = Utils::EnumUtil::RegisterEnum(typeid(enumName).name(), #__VA_ARGS__); \ -inline static std::string ToString(enumName aEnumValue) { return Utils::EnumUtil::ToString(#enumName, static_cast(aEnumValue)); }\ -template inline static enumName ToEnum(const std::string& aEnumString) { return Utils::EnumUtil::ToEnum(#enumName, aEnumString); } +inline static std::string ToString(enumName aEnumValue) \ +{ \ + return Utils::EnumUtil::ToString(static_cast(aEnumValue)); \ +} #define CREATE_ENUM(enumName, ...) CREATE_ENUM_TYPED(enumName, uint32_t, __VA_ARGS__) From 6c3bcd5586a63f0dc70db984b8cc4f29c8cf8dc8 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Sun, 1 Oct 2023 18:53:30 +0200 Subject: [PATCH 09/18] Upgraded project to 0.1.1 --- .../Icons/icon_graph_pin_anim_pose.dds.vtmeta | 8 ++++++++ .../icon_graph_pin_anim_pose_filled.dds.vtmeta | 8 ++++++++ Project/Assets/Materials/M_Grey.vtmat.vtmeta | 2 +- .../Meshes/Cart/foodstandMaterial.fbx.vtmeta | 4 +++- .../Meshes/Cart/foodstandMaterial.vtmat.vtmeta | 4 +++- .../Meshes/Cart/foodstandMaterial.vtmesh.vtmeta | 4 +++- .../Meshes/SM_Apartment_Bottom_01.fbx.vtmeta | 4 +++- .../Assets/Meshes/TestFolder/galil.vtmat.vtmeta | 4 +++- .../Assets/Meshes/TestFolder/galil.vtmesh.vtmeta | 4 +++- .../Assets/Meshes/foodstandMaterial.fbx.vtmeta | 4 +++- .../AG_NewAnimationGraph.vtanimgraph.vtmeta | 3 ++- .../Player Test/CH_Player_01_MAT_C.dds.vtmeta | 3 ++- .../Player Test/CH_Player_01_MAT_M.dds.vtmeta | 3 ++- .../Player Test/CH_Player_01_MAT_N.dds.vtmeta | 3 ++- .../CH_Player_Gauntlet_01_MAT_C.dds.vtmeta | 3 ++- .../CH_Player_Gauntlet_01_MAT_M.dds.vtmeta | 3 ++- .../CH_Player_Gauntlet_01_MAT_N.dds.vtmeta | 3 ++- Project/Assets/Player Test/Player.cs.vtmeta | 3 ++- .../PlayerTestGym/New Scene.vtscene.vtmeta | 3 ++- .../Assets/Player Test/Test.vtanimgraph.vtmeta | 3 ++- .../Player Test/playerCharacter_sk.fbx.vtmeta | 3 ++- .../Player Test/playerCharacter_sk.vtmat.vtmeta | 3 ++- .../Player Test/playerCharacter_sk.vtmesh.vtmeta | 3 ++- .../Player Test/playerCharacter_sk.vtsk.vtmeta | 3 ++- .../Assets/Player Test/playerIdle_anim.fbx.vtmeta | 3 ++- .../Player Test/playerIdle_anim.vtanim.vtmeta | 3 ++- .../Player Test/player_inAir_anim.fbx.vtmeta | 3 ++- .../Player Test/player_inAir_anim.vtanim.vtmeta | 3 ++- .../Player Test/player_jumpUp_anim.fbx.vtmeta | 3 ++- .../Player Test/player_jumpUp_anim.vtanim.vtmeta | 3 ++- .../Player Test/player_landing_anim.fbx.vtmeta | 3 ++- .../Player Test/player_landing_anim.vtanim.vtmeta | 3 ++- .../Player Test/player_run_anim.vtanim.vtmeta | 3 ++- .../Player Test/player_sprint_anim.fbx.vtmeta | 3 ++- .../Player Test/player_sprint_anim.vtanim.vtmeta | 3 ++- .../Scenes/New Scene/New Scene.vtscene.vtmeta | 3 ++- Project/Project.vtproj | 15 ++++++++------- .../GraphKey/Nodes/Animation/SequenceNodes.cpp | 2 +- .../Nodes/Animation/StateMachineNodes.cpp | 1 - Volt/Volt/src/Volt/Asset/Animation/Animation.cpp | 2 +- Volt/Volt/src/Volt/Utility/EnumUtil.h | 2 ++ 41 files changed, 102 insertions(+), 44 deletions(-) create mode 100644 Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds.vtmeta create mode 100644 Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds.vtmeta diff --git a/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds.vtmeta b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds.vtmeta new file mode 100644 index 000000000..75f62bc20 --- /dev/null +++ b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose.dds.vtmeta @@ -0,0 +1,8 @@ +Metadata: + assetHandle: 5946711586121204777 + filePath: Editor/Textures/Icons/icon_graph_pin_anim_pose.dds + type: 16 + Dependencies: + [] + Properties: + {} \ No newline at end of file diff --git a/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds.vtmeta b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds.vtmeta new file mode 100644 index 000000000..084ab92f7 --- /dev/null +++ b/Engine/Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds.vtmeta @@ -0,0 +1,8 @@ +Metadata: + assetHandle: 564425915908266328 + filePath: Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds + type: 16 + Dependencies: + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Materials/M_Grey.vtmat.vtmeta b/Project/Assets/Materials/M_Grey.vtmat.vtmeta index d21f44386..c62a3dabd 100644 --- a/Project/Assets/Materials/M_Grey.vtmat.vtmeta +++ b/Project/Assets/Materials/M_Grey.vtmat.vtmeta @@ -1,6 +1,6 @@ Metadata: assetHandle: 4375374330609413162 - filePath: Assets/Materials\M_Grey.vtmat + filePath: Assets/Materials/M_Grey.vtmat type: 32 Dependencies: [] diff --git a/Project/Assets/Meshes/Cart/foodstandMaterial.fbx.vtmeta b/Project/Assets/Meshes/Cart/foodstandMaterial.fbx.vtmeta index 6309d892a..f46eddcdc 100644 --- a/Project/Assets/Meshes/Cart/foodstandMaterial.fbx.vtmeta +++ b/Project/Assets/Meshes/Cart/foodstandMaterial.fbx.vtmeta @@ -3,4 +3,6 @@ Metadata: filePath: Assets/Meshes/Cart/foodstandMaterial.fbx type: 2 Dependencies: - [] \ No newline at end of file + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Meshes/Cart/foodstandMaterial.vtmat.vtmeta b/Project/Assets/Meshes/Cart/foodstandMaterial.vtmat.vtmeta index d5f46cc77..e654297b9 100644 --- a/Project/Assets/Meshes/Cart/foodstandMaterial.vtmat.vtmeta +++ b/Project/Assets/Meshes/Cart/foodstandMaterial.vtmat.vtmeta @@ -3,4 +3,6 @@ Metadata: filePath: Assets/Meshes/Cart/foodstandMaterial.vtmat type: 32 Dependencies: - [] \ No newline at end of file + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Meshes/Cart/foodstandMaterial.vtmesh.vtmeta b/Project/Assets/Meshes/Cart/foodstandMaterial.vtmesh.vtmeta index fc778bb28..fb52eb1f1 100644 --- a/Project/Assets/Meshes/Cart/foodstandMaterial.vtmesh.vtmeta +++ b/Project/Assets/Meshes/Cart/foodstandMaterial.vtmesh.vtmeta @@ -3,4 +3,6 @@ Metadata: filePath: Assets/Meshes/Cart/foodstandMaterial.vtmesh type: 1 Dependencies: - [] \ No newline at end of file + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Meshes/SM_Apartment_Bottom_01.fbx.vtmeta b/Project/Assets/Meshes/SM_Apartment_Bottom_01.fbx.vtmeta index fae9b4ce3..90d3deb9f 100644 --- a/Project/Assets/Meshes/SM_Apartment_Bottom_01.fbx.vtmeta +++ b/Project/Assets/Meshes/SM_Apartment_Bottom_01.fbx.vtmeta @@ -3,4 +3,6 @@ Metadata: filePath: Assets/Meshes/SM_Apartment_Bottom_01.fbx type: 2 Dependencies: - [] \ No newline at end of file + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Meshes/TestFolder/galil.vtmat.vtmeta b/Project/Assets/Meshes/TestFolder/galil.vtmat.vtmeta index 77bd2e695..aa5c91837 100644 --- a/Project/Assets/Meshes/TestFolder/galil.vtmat.vtmeta +++ b/Project/Assets/Meshes/TestFolder/galil.vtmat.vtmeta @@ -3,4 +3,6 @@ Metadata: filePath: Assets/Meshes/TestFolder/galil.vtmat type: 32 Dependencies: - [] \ No newline at end of file + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Meshes/TestFolder/galil.vtmesh.vtmeta b/Project/Assets/Meshes/TestFolder/galil.vtmesh.vtmeta index 3b7c15fdc..eec8cf643 100644 --- a/Project/Assets/Meshes/TestFolder/galil.vtmesh.vtmeta +++ b/Project/Assets/Meshes/TestFolder/galil.vtmesh.vtmeta @@ -3,4 +3,6 @@ Metadata: filePath: Assets/Meshes/TestFolder/galil.vtmesh type: 1 Dependencies: - [] \ No newline at end of file + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Meshes/foodstandMaterial.fbx.vtmeta b/Project/Assets/Meshes/foodstandMaterial.fbx.vtmeta index d56e2af44..6e34fbed0 100644 --- a/Project/Assets/Meshes/foodstandMaterial.fbx.vtmeta +++ b/Project/Assets/Meshes/foodstandMaterial.fbx.vtmeta @@ -3,4 +3,6 @@ Metadata: filePath: Assets/Meshes/foodstandMaterial.fbx type: 2 Dependencies: - [] \ No newline at end of file + [] + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta index eaad5da92..74916ea52 100644 --- a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta +++ b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 131072 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta b/Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta index b82338587..28fa30f40 100644 --- a/Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta +++ b/Project/Assets/Player Test/CH_Player_01_MAT_C.dds.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 16 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta b/Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta index b23ff4966..2229bfbab 100644 --- a/Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta +++ b/Project/Assets/Player Test/CH_Player_01_MAT_M.dds.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 16 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta b/Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta index e006a9501..b28926595 100644 --- a/Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta +++ b/Project/Assets/Player Test/CH_Player_01_MAT_N.dds.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 16 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta index a6cfc9037..6dd2ff76d 100644 --- a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_C.dds.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 16 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta index 71e400182..bf8dbe393 100644 --- a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_M.dds.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 16 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta index 010ec89a1..b4e24b5ac 100644 --- a/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta +++ b/Project/Assets/Player Test/CH_Player_Gauntlet_01_MAT_N.dds.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 16 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/Player.cs.vtmeta b/Project/Assets/Player Test/Player.cs.vtmeta index f89d27355..9921479ab 100644 --- a/Project/Assets/Player Test/Player.cs.vtmeta +++ b/Project/Assets/Player Test/Player.cs.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 524288 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta index 3c3e97cdb..14ec9582e 100644 --- a/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta +++ b/Project/Assets/Player Test/PlayerTestGym/New Scene.vtscene.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 256 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/Test.vtanimgraph.vtmeta b/Project/Assets/Player Test/Test.vtanimgraph.vtmeta index 985d935e5..d9f64cced 100644 --- a/Project/Assets/Player Test/Test.vtanimgraph.vtmeta +++ b/Project/Assets/Player Test/Test.vtanimgraph.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 131072 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta index 76ff2a41b..bf698f20e 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.fbx.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 2 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta index 9587dd870..617880283 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmat.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 32 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta index 7fbc8c5ef..34f810bd8 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.vtmesh.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 1 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta b/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta index dc361688a..ba15097f2 100644 --- a/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta +++ b/Project/Assets/Player Test/playerCharacter_sk.vtsk.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 8 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta b/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta index aa3736cbd..2fdeb09bc 100644 --- a/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/playerIdle_anim.fbx.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 2 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta b/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta index 59e045bc7..dc459eb9a 100644 --- a/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/playerIdle_anim.vtanim.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 4 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta b/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta index 2ffd72584..470e13d29 100644 --- a/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_inAir_anim.fbx.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 2 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta index e385c6b18..4f1be75c5 100644 --- a/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_inAir_anim.vtanim.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 4 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta b/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta index 43e94ee07..b81fbbae4 100644 --- a/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_jumpUp_anim.fbx.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 2 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta index c980f048b..d0ee8cfc6 100644 --- a/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_jumpUp_anim.vtanim.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 4 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta b/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta index ba5457b55..9ce39b460 100644 --- a/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_landing_anim.fbx.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 2 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta index 0df9c37d0..3a9682407 100644 --- a/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_landing_anim.vtanim.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 4 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta index 968d052e4..69091571f 100644 --- a/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_run_anim.vtanim.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 4 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta b/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta index da35dead7..f36b3d167 100644 --- a/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta +++ b/Project/Assets/Player Test/player_sprint_anim.fbx.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 2 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta b/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta index bf5a7566f..d8c728d46 100644 --- a/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta +++ b/Project/Assets/Player Test/player_sprint_anim.vtanim.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 4 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta b/Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta index 0b3e469e7..8d3c0e738 100644 --- a/Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta +++ b/Project/Assets/Scenes/New Scene/New Scene.vtscene.vtmeta @@ -4,4 +4,5 @@ Metadata: type: 256 Dependencies: [] - ? Properties \ No newline at end of file + Properties: + {} \ No newline at end of file diff --git a/Project/Project.vtproj b/Project/Project.vtproj index c003ffea7..1d9cf3812 100644 --- a/Project/Project.vtproj +++ b/Project/Project.vtproj @@ -1,8 +1,9 @@ Project: - Name: Project - CompanyName: Default - AssetsPath: Assets - AudioBanksPath: Audio/Banks # Starts in the defined assets path - IconPath: "" - CursorPath: "" - StartScene: "" \ No newline at end of file + EngineVersion: 0.1.1 + Name: Project + CompanyName: Default + AssetsDirectory: Assets + AudioBanksDirectory: Audio/Banks + IconPath: "" + CursorPath: "" + StartScenePath: "" \ No newline at end of file diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp index 8f4187986..2615cca78 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/SequenceNodes.cpp @@ -91,7 +91,7 @@ namespace GraphKey const bool shouldLoop = GetInput(1); const float speed = GetInput(2); const bool applyRootMotion = GetInput(3); - const float localTime = Volt::AnimationManager::globalClock - animGraph->GetStartTime(); + //const float localTime = Volt::AnimationManager::globalClock - animGraph->GetStartTime(); const uint32_t currentFrame = anim->GetFrameFromStartTime(animGraph->GetStartTime(), speed); /* ANIMATION EVENT STUFF diff --git a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp index 9cf1f3d41..71f4bd904 100644 --- a/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp +++ b/Volt/GraphKey/src/GraphKey/Nodes/Animation/StateMachineNodes.cpp @@ -144,7 +144,6 @@ namespace GraphKey for (const auto& stateNode : rootNode["States"]) { std::string stateName; - bool stateIsEntry; Volt::UUID stateId = Volt::UUID(0); std::string stateTypeString; diff --git a/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp b/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp index f07484319..f0677d05b 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp +++ b/Volt/Volt/src/Volt/Asset/Animation/Animation.cpp @@ -263,7 +263,7 @@ namespace Volt { return std::clamp(normalizedTime, 0.f, 1.f); } - return 0.0f; + //return 0.0f; } const Animation::PoseData Animation::GetFrameDataFromAnimation(Animation& animation, const float aNormalizedTime) diff --git a/Volt/Volt/src/Volt/Utility/EnumUtil.h b/Volt/Volt/src/Volt/Utility/EnumUtil.h index f72b7ea9d..9d3d1c863 100644 --- a/Volt/Volt/src/Volt/Utility/EnumUtil.h +++ b/Volt/Volt/src/Volt/Utility/EnumUtil.h @@ -31,6 +31,8 @@ namespace Utils return static_cast(pair.first); } } + VT_CORE_ERROR("Tried to convert string to enum that does not exist! EnumName: {0}, EnumValue: {1}", typeid(EnumType).name(), aEnumValue); + return static_cast(0); } static bool RegisterEnum(const std::string& name, const std::string& definitionData) From 2e46372c2423af0cbe9e35ac42f174642040fa88 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Sun, 1 Oct 2023 18:54:14 +0200 Subject: [PATCH 10/18] Fixed a bug causing a crash when upgrading the project --- Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp index 91148a9fb..6cf7e4f5f 100644 --- a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp +++ b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp @@ -125,7 +125,7 @@ std::pair ProjectUpgradeModal::Deseria streamReader.EnterScope("Metadata"); resultAssetFilePath = streamReader.ReadKey("filePath", std::string("")); - resultAssetHandle = streamReader.ReadKey("assetHandle", 0u); + resultAssetHandle = streamReader.ReadKey("assetHandle", uint64_t(0)); streamReader.ExitScope(); } From 7b955d278d8b21806f5e1b5c2ab9f5587693ede0 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Tue, 10 Oct 2023 20:50:39 +0200 Subject: [PATCH 11/18] Fixed a bug in imgui node editor causing states not being able to be moved if on top of eachother --- Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp b/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp index 9492996b3..b580e437b 100644 --- a/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp +++ b/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp @@ -2182,8 +2182,8 @@ ed::Control ed::EditorContext::BuildControl(bool allowOffscreen) // Check for interaction with background. auto backgroundClicked = emitInteractiveArea(NodeId(0), editorRect); auto backgroundDoubleClicked = !doubleClickedObject && ImGui::IsItemHovered() ? ImGui::IsMouseDoubleClicked(0) : false; - auto isBackgroundActive = ImGui::IsItemActive(); auto isBackgroundHot = !hotObject; + auto isBackgroundActive = ImGui::IsItemActive() && isBackgroundHot; auto isDragging = ImGui::IsMouseDragging(0, 1) || ImGui::IsMouseDragging(1, 1) || ImGui::IsMouseDragging(2, 1); if (backgroundDoubleClicked) From ab89c013a4d72b4355d10b0e796438f934d0ae3f Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Tue, 10 Oct 2023 21:10:06 +0200 Subject: [PATCH 12/18] Fixed the actual bug and reverted the previous false fix --- Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp | 6 ++++-- Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index fb43203f9..977629663 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -225,8 +225,10 @@ namespace Volt VT_CORE_ASSERT(false, "State type construction not implemented."); break; } - - myStates.back()->id = id; + if (id != 0) + { + myStates.back()->id = id; + } return myStates.back(); } diff --git a/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp b/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp index b580e437b..f6ea263af 100644 --- a/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp +++ b/Volt/Volt/vendor/imgui-node-editor/imgui_node_editor.cpp @@ -1409,7 +1409,7 @@ void ed::EditorContext::End() ImDrawList_ChannelsGrow(drawList, userChannel + channelsToCopy); for (int i = 0; i < channelsToCopy; ++i) ImDrawList_SwapChannels(drawList, userChannel + i, c_UserLayerChannelStart + i); -} + } # endif # if 0 @@ -2182,8 +2182,8 @@ ed::Control ed::EditorContext::BuildControl(bool allowOffscreen) // Check for interaction with background. auto backgroundClicked = emitInteractiveArea(NodeId(0), editorRect); auto backgroundDoubleClicked = !doubleClickedObject && ImGui::IsItemHovered() ? ImGui::IsMouseDoubleClicked(0) : false; + auto isBackgroundActive = ImGui::IsItemActive(); auto isBackgroundHot = !hotObject; - auto isBackgroundActive = ImGui::IsItemActive() && isBackgroundHot; auto isDragging = ImGui::IsMouseDragging(0, 1) || ImGui::IsMouseDragging(1, 1) || ImGui::IsMouseDragging(2, 1); if (backgroundDoubleClicked) From a39e54d4e262638e53db98e4f947de93ec9e3f25 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Wed, 11 Oct 2023 20:30:43 +0200 Subject: [PATCH 13/18] Fixed a crash when the level saved in user settings fails to load --- Volt/Sandbox/src/Sandbox/Sandbox.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Volt/Sandbox/src/Sandbox/Sandbox.cpp b/Volt/Sandbox/src/Sandbox/Sandbox.cpp index 82f26f631..a36095fbc 100644 --- a/Volt/Sandbox/src/Sandbox/Sandbox.cpp +++ b/Volt/Sandbox/src/Sandbox/Sandbox.cpp @@ -205,6 +205,11 @@ void Sandbox::OnAttach() OpenScene(userSettings.sceneSettings.lastOpenScene); } + if(!myRuntimeScene) + { + NewScene(); + } + constexpr int64_t discordAppId = 1108502963447681106; Volt::DiscordSDK::Init(discordAppId, false); From f6f59f65c66594c473b38729c5b755a881929d8f Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Wed, 11 Oct 2023 22:14:35 +0200 Subject: [PATCH 14/18] The alias states now work in the state machine --- .../Icons/icon_statemachine_alias_state.dds | 3 + .../icon_statemachine_animation_state.dds | 3 + .../Assets/AG_NewAnimationGraph.vtanimgraph | 632 +++++++- .../AG_NewAnimationGraph.vtanimgraph | 1277 ----------------- .../AG_NewAnimationGraph.vtanimgraph.vtmeta | 8 - Project/Assets/Player Test/Player.cs.vtmeta | 2 +- .../Scenes/PlayerScene/Layers/layer_0.vtlayer | 903 ++++++++++++ .../Scenes/PlayerScene/PlayerScene.vtscene | 2 + .../PlayerScene/PlayerScene.vtscene.vtmeta | 8 + .../src/Sandbox/Utility/EditorResources.cpp | 3 + .../src/Sandbox/Utility/EditorResources.h | 4 + .../AnimationGraph/AnimationGraphPanel.cpp | 64 +- .../Volt/Animation/AnimationStateMachine.cpp | 31 +- 13 files changed, 1626 insertions(+), 1314 deletions(-) create mode 100644 Engine/Editor/Textures/Icons/icon_statemachine_alias_state.dds create mode 100644 Engine/Editor/Textures/Icons/icon_statemachine_animation_state.dds delete mode 100644 Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph delete mode 100644 Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta create mode 100644 Project/Assets/Scenes/PlayerScene/Layers/layer_0.vtlayer create mode 100644 Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene create mode 100644 Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene.vtmeta diff --git a/Engine/Editor/Textures/Icons/icon_statemachine_alias_state.dds b/Engine/Editor/Textures/Icons/icon_statemachine_alias_state.dds new file mode 100644 index 000000000..31614ae9c --- /dev/null +++ b/Engine/Editor/Textures/Icons/icon_statemachine_alias_state.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24bd20acf08946c5ae9f752d66c790dcc023e4535dbacc2cb2c48d902a7df9d7 +size 262292 diff --git a/Engine/Editor/Textures/Icons/icon_statemachine_animation_state.dds b/Engine/Editor/Textures/Icons/icon_statemachine_animation_state.dds new file mode 100644 index 000000000..5d90c9dec --- /dev/null +++ b/Engine/Editor/Textures/Icons/icon_statemachine_animation_state.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08b7a24948f241e6a06018c65fa291cfdabe7c75aff473f69ebffa4bacf5ff1d +size 262292 diff --git a/Project/Assets/AG_NewAnimationGraph.vtanimgraph b/Project/Assets/AG_NewAnimationGraph.vtanimgraph index 18a9670b7..108a48937 100644 --- a/Project/Assets/AG_NewAnimationGraph.vtanimgraph +++ b/Project/Assets/AG_NewAnimationGraph.vtanimgraph @@ -1,5 +1,5 @@ AnimationGraph: - state: "{\"nodes\":{\"node:15535915886176485439\":{\"location\":{\"x\":405,\"y\":358}},\"node:6385969710449639435\":{\"location\":{\"x\":648,\"y\":358}},\"node:8480674789647244649\":{\"location\":{\"x\":200,\"y\":330}}},\"selection\":[\"node:15535915886176485439\"],\"view\":{\"scroll\":{\"x\":-75.03631591796875,\"y\":81.7004241943359375},\"zoom\":1}}" + state: "{\"nodes\":{\"node:15535915886176485439\":{\"location\":{\"x\":405,\"y\":358}},\"node:3101149124820700979\":{\"location\":{\"x\":0,\"y\":0}},\"node:6385969710449639435\":{\"location\":{\"x\":648,\"y\":358}}},\"selection\":[\"node:15535915886176485439\"],\"view\":{\"scroll\":{\"x\":68.8987579345703125,\"y\":66.9809494018554688},\"zoom\":0.749999940395355225}}" skeleton: 13037238043735750390 Graph: Nodes: @@ -19,20 +19,20 @@ AnimationGraph: nodeSpecific: StateMachine: name: New State Machine - editorState: "{\"nodes\":{\"node:17432209236957630761\":{\"location\":{\"x\":-60,\"y\":106}},\"node:1950752842845048714\":{\"location\":{\"x\":259,\"y\":106}},\"node:7304774921189200077\":{\"location\":{\"x\":0,\"y\":0}}},\"selection\":[\"link:1572480766934857440\"],\"view\":{\"scroll\":{\"x\":-297.270965576171875,\"y\":-180.524429321289062},\"zoom\":1.25}}" + editorState: "{\"nodes\":{\"node:17432209236957630761\":{\"location\":{\"x\":-282,\"y\":122}},\"node:1855343218774780254\":{\"location\":{\"x\":-156,\"y\":-70}},\"node:1950752842845048714\":{\"location\":{\"x\":3,\"y\":122}},\"node:2246485898384117447\":{\"location\":{\"x\":323,\"y\":-134}},\"node:3953818392584059527\":{\"location\":{\"x\":307,\"y\":-6}},\"node:7304774921189200077\":{\"location\":{\"x\":-284,\"y\":234}},\"node:8133136018950043992\":{\"location\":{\"x\":83,\"y\":-70}}},\"selection\":[\"link:1572480766934857440\"],\"view\":{\"scroll\":{\"x\":-420.1063232421875,\"y\":-15.717437744140625},\"zoom\":2}}" skeletonHandle: 13037238043735750390 States: - name: Entry - editorState: "{\"location\":{\"x\":0,\"y\":0}}" - stateType: "EntryState" + editorState: "{\"location\":{\"x\":-284,\"y\":234}}" + stateType: EntryState id: 7304774921189200077 topPinId: 9621627988814579497 bottomPinId: 4927250641173997226 Transitions: - 17005180717603525355 - name: Idle - editorState: "{\"location\":{\"x\":-60,\"y\":106}}" - stateType: "AnimationState" + editorState: "{\"location\":{\"x\":-282,\"y\":122}}" + stateType: AnimationState id: 17432209236957630761 topPinId: 15825692490210434475 bottomPinId: 18324133014359639689 @@ -40,6 +40,7 @@ AnimationGraph: - 10798705133392895707 - 1572480766934857440 - 17005180717603525355 + - 1617300261649355116 skeletonHandle: 13037238043735750390 Graph: Nodes: @@ -86,8 +87,8 @@ AnimationGraph: Events: [] - name: Run - editorState: "{\"location\":{\"x\":259,\"y\":106}}" - stateType: "AnimationState" + editorState: "{\"location\":{\"x\":3,\"y\":122}}" + stateType: AnimationState id: 1950752842845048714 topPinId: 4740537785744763331 bottomPinId: 4624657758893323953 @@ -139,12 +140,213 @@ AnimationGraph: data: 0 Events: [] + - name: FromGrounded + editorState: "{\"location\":{\"x\":323,\"y\":-134}}" + stateType: AliasState + id: 2246485898384117447 + topPinId: 13423537809168202192 + bottomPinId: 11564371872883157017 + Transitions: + - 8988813395304945701 + - 3446944367760847740 + TransitionFromStates: + - 17432209236957630761 + - 1950752842845048714 + - name: Jump + editorState: "{\"location\":{\"x\":307,\"y\":-6}}" + stateType: AnimationState + id: 3953818392584059527 + topPinId: 14646039127832473724 + bottomPinId: 18273233674272904198 + Transitions: + - 8988813395304945701 + - 7015533178709811337 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 677823500697305441 + type: OutputPoseNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 3094565165647328405 + outputs: + [] + - id: 800101145708884421 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-392,\"y\":-22}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 2723244501686776130 + data: 92487431340345286 + - name: Loop + id: 3606993726326176389 + data: false + - name: Speed + id: 15448567875512809674 + data: 1 + - name: Apply Root Motion + id: 10299901852546188772 + data: false + outputs: + - name: Output + id: 16970878044148482226 + Links: + - id: 2165051239551345947 + output: 16970878044148482226 + input: 3094565165647328405 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] + - name: InAir + editorState: "{\"location\":{\"x\":83,\"y\":-70}}" + stateType: AnimationState + id: 8133136018950043992 + topPinId: 3711603314674241521 + bottomPinId: 3615249211312319543 + Transitions: + - 3446944367760847740 + - 7015533178709811337 + - 7517114224778952441 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 4821303756008367670 + type: OutputPoseNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 13870525144304698603 + outputs: + [] + - id: 9109307813187420028 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-408,\"y\":-42}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 735758419584480757 + data: 18438903370085448471 + - name: Loop + id: 12713256876259839182 + data: true + - name: Speed + id: 14727838542742701858 + data: 1 + - name: Apply Root Motion + id: 3788184091235293645 + data: false + outputs: + - name: Output + id: 10771395814599406813 + Links: + - id: 16102977097566751741 + output: 10771395814599406813 + input: 13870525144304698603 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] + - name: Land + editorState: "{\"location\":{\"x\":-156,\"y\":-70}}" + stateType: AnimationState + id: 1855343218774780254 + topPinId: 12741939376404989503 + bottomPinId: 10334487212494625972 + Transitions: + - 7517114224778952441 + - 1617300261649355116 + - 14060594779089040345 + - 14060594779089040345 + skeletonHandle: 13037238043735750390 + Graph: + Nodes: + - id: 11059521314908274504 + type: OutputPoseNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Result + id: 17311684045403103186 + outputs: + [] + - id: 13658773059018866104 + type: SequencePlayerNode + state: "{\"location\":{\"x\":-408,\"y\":-26}}" + nodeSpecific: + {} + inputs: + - name: "" + id: 9978018667759353995 + data: 1783046688217532516 + - name: Loop + id: 4584352619866640130 + data: false + - name: Speed + id: 18346089107734686268 + data: 1 + - name: Apply Root Motion + id: 1103225232412181784 + data: false + outputs: + - name: Output + id: 6810285305526454927 + Links: + - id: 13849487739795994862 + output: 6810285305526454927 + input: 17311684045403103186 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] Transitions: - id: 10798705133392895707 fromState: 17432209236957630761 toState: 1950752842845048714 shouldBlend: true - blendTime: 1 + blendTime: 0.100000001 Graph: Nodes: - id: 8633465504995857727 @@ -202,7 +404,7 @@ AnimationGraph: fromState: 1950752842845048714 toState: 17432209236957630761 shouldBlend: true - blendTime: 1 + blendTime: 0.200000003 Graph: Nodes: - id: 11811852917554264831 @@ -254,6 +456,14 @@ AnimationGraph: type: Float id: 14039312185190483105 data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false Events: [] - id: 17005180717603525355 @@ -280,6 +490,398 @@ AnimationGraph: [] Events: [] + - id: 8988813395304945701 + fromState: 2246485898384117447 + toState: 3953818392584059527 + shouldBlend: true + blendTime: 0 + Graph: + Nodes: + - id: 2657894279699955305 + type: TransitionOutputNode + state: "{\"location\":{\"x\":-24,\"y\":134}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 17409922870237724360 + outputs: + [] + - id: 1109282034609333419 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-397,\"y\":54}}" + nodeSpecific: + {} + parameterId: 7040222003813015953 + inputs: + [] + outputs: + - name: Get + id: 9411227102609750766 + data: false + - id: 12363801642812595003 + type: AndNode + state: "{\"location\":{\"x\":-239,\"y\":134}}" + nodeSpecific: + {} + inputs: + - name: A + id: 6831226286547882628 + - name: B + id: 2149286177818292460 + outputs: + - name: Result + id: 12967785164726497865 + data: false + - id: 4177759187863867490 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-425,\"y\":166}}" + nodeSpecific: + {} + parameterId: 4410245817735864108 + inputs: + [] + outputs: + - name: Get + id: 7149448816789015821 + data: false + Links: + - id: 16220811622196984154 + output: 9411227102609750766 + input: 6831226286547882628 + - id: 12052513478314897282 + output: 7149448816789015821 + input: 2149286177818292460 + - id: 10743492838281959852 + output: 12967785164726497865 + input: 17409922870237724360 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] + - id: 3446944367760847740 + fromState: 2246485898384117447 + toState: 8133136018950043992 + shouldBlend: true + blendTime: 0 + Graph: + Nodes: + - id: 12881929718705894605 + type: TransitionOutputNode + state: "{\"location\":{\"x\":168,\"y\":-10}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 8342771784287666478 + outputs: + [] + - id: 4490435825568150490 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-441,\"y\":70}}" + nodeSpecific: + {} + parameterId: 4410245817735864108 + inputs: + [] + outputs: + - name: Get + id: 17874244944200406102 + data: false + - id: 18190910687485065735 + type: NotNode + state: "{\"location\":{\"x\":-280,\"y\":92}}" + nodeSpecific: + {} + inputs: + - name: Value + id: 2108693528209979995 + outputs: + - name: Result + id: 16494527957041588039 + data: false + - id: 12851779301579884142 + type: NotNode + state: "{\"location\":{\"x\":-280,\"y\":-52}}" + nodeSpecific: + {} + inputs: + - name: Value + id: 17194792555770288445 + outputs: + - name: Result + id: 8705689356548655279 + data: false + - id: 552011300903665285 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-428,\"y\":-58}}" + nodeSpecific: + {} + parameterId: 7040222003813015953 + inputs: + [] + outputs: + - name: Get + id: 6772888804765984506 + data: false + - id: 17557399882680872178 + type: AndNode + state: "{\"location\":{\"x\":-47,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: A + id: 13279288628810159807 + - name: B + id: 10143783254779187468 + outputs: + - name: Result + id: 7186849014467093740 + data: false + Links: + - id: 5956261468821141364 + output: 17874244944200406102 + input: 2108693528209979995 + - id: 8277614310930492356 + output: 6772888804765984506 + input: 17194792555770288445 + - id: 17851642902236785029 + output: 8705689356548655279 + input: 13279288628810159807 + - id: 16024550189472459656 + output: 16494527957041588039 + input: 10143783254779187468 + - id: 15228655622916133000 + output: 7186849014467093740 + input: 8342771784287666478 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] + - id: 7015533178709811337 + fromState: 3953818392584059527 + toState: 8133136018950043992 + shouldBlend: true + blendTime: 0 + Graph: + Nodes: + - id: 16932419592610447451 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 9135269666626593006 + outputs: + [] + - id: 6339129987385674412 + type: GreaterThanNodeFloat + state: "{\"location\":{\"x\":-211,\"y\":-20}}" + nodeSpecific: + {} + inputs: + - name: A + id: 6144415433595842890 + - name: B + id: 8947140368315339203 + data: 0.899999976 + outputs: + - name: Result + id: 2657637046355593297 + data: false + - id: 15040451827604757514 + type: GetRelevantAnimationTimeNormalizedNode + state: "{\"location\":{\"x\":-624,\"y\":-42}}" + nodeSpecific: + {} + inputs: + [] + outputs: + - name: Return Value + id: 6879390953251788470 + data: 0 + Links: + - id: 2802408556512252311 + output: 2657637046355593297 + input: 9135269666626593006 + - id: 12604545193132080351 + output: 6879390953251788470 + input: 6144415433595842890 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] + - id: 7517114224778952441 + fromState: 8133136018950043992 + toState: 1855343218774780254 + shouldBlend: true + blendTime: 0 + Graph: + Nodes: + - id: 4248394184821701217 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 8998797481875344995 + outputs: + [] + - id: 14798732366817525764 + type: GetParameterBoolean + state: "{\"location\":{\"x\":-329,\"y\":-10}}" + nodeSpecific: + {} + parameterId: 4410245817735864108 + inputs: + [] + outputs: + - name: Get + id: 4816004918995484642 + data: false + Links: + - id: 2250415317395873773 + output: 4816004918995484642 + input: 8998797481875344995 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] + - id: 1617300261649355116 + fromState: 1855343218774780254 + toState: 17432209236957630761 + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 14099101058076275246 + type: TransitionOutputNode + state: "{\"location\":{\"x\":0,\"y\":0}}" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 6869115738675692142 + outputs: + [] + - id: 17250428434685179428 + type: GetRelevantAnimationTimeNormalizedNode + state: "{\"location\":{\"x\":-640,\"y\":-42}}" + nodeSpecific: + {} + inputs: + [] + outputs: + - name: Return Value + id: 13468440445692019446 + data: 0 + - id: 11097731068169343728 + type: GreaterThanNodeFloat + state: "{\"location\":{\"x\":-250,\"y\":-7}}" + nodeSpecific: + {} + inputs: + - name: A + id: 16157563364457088194 + - name: B + id: 3413005068110244196 + data: 0.899999976 + outputs: + - name: Result + id: 5582566992904693748 + data: false + Links: + - id: 13191266265963990610 + output: 13468440445692019446 + input: 16157563364457088194 + - id: 13735352182964775825 + output: 5582566992904693748 + input: 6869115738675692142 + Parameters: + - name: CurrentSpeed + type: Float + id: 14039312185190483105 + data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false + Events: + [] + - id: 14060594779089040345 + fromState: 1855343218774780254 + toState: 1855343218774780254 + shouldBlend: true + blendTime: 1 + Graph: + Nodes: + - id: 18272813084859507583 + type: TransitionOutputNode + state: "" + nodeSpecific: + {} + inputs: + - name: Can Enter Transition + id: 5835037397224209053 + data: false + outputs: + [] + Links: + [] + Parameters: + [] + Events: + [] inputs: [] outputs: @@ -287,7 +889,7 @@ AnimationGraph: id: 4742437693566564646 - id: 3101149124820700979 type: SequencePlayerNode - state: "" + state: "{\"location\":{\"x\":0,\"y\":0}}" nodeSpecific: {} inputs: @@ -315,5 +917,13 @@ AnimationGraph: type: Float id: 14039312185190483105 data: 0 + - name: Grounded + type: Boolean + id: 4410245817735864108 + data: false + - name: Jump + type: Boolean + id: 7040222003813015953 + data: false Events: [] \ No newline at end of file diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph deleted file mode 100644 index 701837938..000000000 --- a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph +++ /dev/null @@ -1,1277 +0,0 @@ -AnimationGraph: - state: "{\"nodes\":{\"node:12463233505869314869\":{\"location\":{\"x\":-50,\"y\":182}},\"node:13508735938561582046\":{\"location\":{\"x\":81,\"y\":118}},\"node:14889568793579757983\":{\"location\":{\"x\":78,\"y\":246}},\"node:17301805690779624226\":{\"location\":{\"x\":36,\"y\":38}},\"node:17584398784418846919\":{\"location\":{\"x\":264,\"y\":86}},\"node:17868484199422907988\":{\"location\":{\"x\":536,\"y\":86}}},\"selection\":null,\"view\":{\"scroll\":{\"x\":7.35063934326171875,\"y\":-67.20166015625},\"zoom\":1.25}}" - skeleton: 13037238043735750390 - Graph: - Nodes: - - id: 17868484199422907988 - type: OutputPoseNode - state: "{\"location\":{\"x\":536,\"y\":86}}" - nodeSpecific: - {} - inputs: - - name: Result - id: 15529003614232630594 - outputs: - [] - - id: 17301805690779624226 - type: StateMachineNode - state: "{\"location\":{\"x\":36,\"y\":38}}" - nodeSpecific: - StateMachine: - name: Main State Machine - editorState: "{\"nodes\":{\"node:12463233505869314869\":{\"location\":{\"x\":-50,\"y\":182}},\"node:13508735938561582046\":{\"location\":{\"x\":81,\"y\":118}},\"node:14889568793579757983\":{\"location\":{\"x\":78,\"y\":246}},\"node:16788735106587868172\":{\"location\":{\"x\":355,\"y\":254}},\"node:17301805690779624226\":{\"location\":{\"x\":36,\"y\":38}},\"node:17362013720582400113\":{\"location\":{\"x\":-12,\"y\":314}},\"node:17584398784418846919\":{\"location\":{\"x\":264,\"y\":86}},\"node:17868484199422907988\":{\"location\":{\"x\":536,\"y\":86}},\"node:2878473185253437245\":{\"location\":{\"x\":243,\"y\":14}},\"node:3665464684957549364\":{\"location\":{\"x\":-28,\"y\":58}},\"node:3681991280272765136\":{\"location\":{\"x\":-12,\"y\":174}},\"node:4959086316646373199\":{\"location\":{\"x\":195,\"y\":154}}},\"selection\":[\"node:17301805690779624226\"],\"view\":{\"scroll\":{\"x\":37.3506393432617188,\"y\":2.79835128784179688},\"zoom\":1.25}}" - skeletonHandle: 13037238043735750390 - States: - - name: Entry - isEntry: true - isAny: false - editorState: "{\"location\":{\"x\":-28,\"y\":58}}" - id: 3665464684957549364 - pinId: 12902782254156092098 - pinId2: 14258103125107884637 - Transitions: - - 15724984446624483268 - - name: Any - isEntry: false - isAny: true - editorState: "{\"location\":{\"x\":243,\"y\":14}}" - id: 2878473185253437245 - pinId: 5269647802711289343 - pinId2: 10660380611335689211 - Transitions: - - 7924813067403359603 - - 16741418222055495425 - - name: Idle - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":-12,\"y\":174}}" - id: 3681991280272765136 - pinId: 2894418162706173443 - pinId2: 13804721687551360234 - Transitions: - - 15724984446624483268 - - 2885412559387363311 - - 1559816839792901889 - - 11217119714873309087 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 14536892748128745780 - type: OutputPoseNode - state: "{\"location\":{\"x\":392,\"y\":214}}" - nodeSpecific: - {} - inputs: - - name: Result - id: 14105913789575905908 - outputs: - [] - - id: 16221844271113134588 - type: SequencePlayerNode - state: "{\"location\":{\"x\":34,\"y\":210}}" - nodeSpecific: - {} - inputs: - - name: "" - id: 10580947816370530482 - data: 6258146775014869030 - - name: Loop - id: 123450497769363306 - data: true - - name: Speed - id: 8336879108405323436 - data: 1 - - name: Apply Root Motion - id: 11090811506985761982 - data: false - outputs: - - name: Output - id: 3099520766036006655 - Links: - - id: 9662818189681954966 - output: 3099520766036006655 - input: 14105913789575905908 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - name: Run - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":-12,\"y\":314}}" - id: 17362013720582400113 - pinId: 7817618331721326880 - pinId2: 9430452183247307602 - Transitions: - - 2885412559387363311 - - 1559816839792901889 - - 13017777191613838390 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 13182824102293636283 - type: OutputPoseNode - state: "{\"location\":{\"x\":56,\"y\":-26}}" - nodeSpecific: - {} - inputs: - - name: Result - id: 2434102622300016631 - outputs: - [] - - id: 16767149402094149869 - type: SequencePlayerNode - state: "{\"location\":{\"x\":-302,\"y\":-14}}" - nodeSpecific: - {} - inputs: - - name: "" - id: 10031653943577889520 - data: 6011248127994413100 - - name: Loop - id: 3012088715339929536 - data: true - - name: Speed - id: 14780628045392394899 - data: 1 - - name: Apply Root Motion - id: 11703811859076888858 - data: false - outputs: - - name: Output - id: 3273018439142468825 - Links: - - id: 14411293871932759808 - output: 3273018439142468825 - input: 2434102622300016631 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - name: StartJump - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":195,\"y\":154}}" - id: 4959086316646373199 - pinId: 10295643871073811521 - pinId2: 16267254125773997612 - Transitions: - - 7924813067403359603 - - 13269834706927116307 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 12596166692664476774 - type: OutputPoseNode - state: "{\"location\":{\"x\":392,\"y\":214}}" - nodeSpecific: - {} - inputs: - - name: Result - id: 5861817840940044885 - outputs: - [] - - id: 15180245410823459525 - type: SequencePlayerNode - state: "{\"location\":{\"x\":82,\"y\":210}}" - nodeSpecific: - {} - inputs: - - name: "" - id: 16262223745919603949 - data: 92487431340345286 - - name: Loop - id: 12070280934059552080 - data: false - - name: Speed - id: 4387072234620904110 - data: 1 - - name: Apply Root Motion - id: 11149968965430831207 - data: false - outputs: - - name: Output - id: 17182538447330918633 - Links: - - id: 7423060123162994628 - output: 17182538447330918633 - input: 5861817840940044885 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - name: InAir - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":355,\"y\":254}}" - id: 16788735106587868172 - pinId: 12345812838632408803 - pinId2: 13133448969614549550 - Transitions: - - 16741418222055495425 - - 13269834706927116307 - - 11217119714873309087 - - 13017777191613838390 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 10375549879072757522 - type: OutputPoseNode - state: "{\"location\":{\"x\":168,\"y\":118}}" - nodeSpecific: - {} - inputs: - - name: Result - id: 7993111188786885993 - outputs: - [] - - id: 72906687750208911 - type: SequencePlayerNode - state: "{\"location\":{\"x\":24,\"y\":222}}" - nodeSpecific: - {} - inputs: - - name: "" - id: 10867885091214013952 - data: 18438903370085448471 - - name: Loop - id: 9146347772134529951 - data: true - - name: Speed - id: 15267910550696299263 - data: 1 - - name: Apply Root Motion - id: 11935242591066892335 - data: false - outputs: - - name: Output - id: 11680064864603595249 - Links: - - id: 1881370631314135528 - output: 11680064864603595249 - input: 7993111188786885993 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - Transitions: - - id: 15724984446624483268 - fromState: 3665464684957549364 - toState: 3681991280272765136 - shouldBlend: true - blendTime: 1 - Graph: - Nodes: - - id: 3623410152680394859 - type: TransitionOutputNode - state: "{\"location\":{\"x\":0,\"y\":0}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 5330600848135263334 - data: false - outputs: - [] - Links: - [] - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - Events: - [] - - id: 2885412559387363311 - fromState: 3681991280272765136 - toState: 17362013720582400113 - shouldBlend: true - blendTime: 0 - Graph: - Nodes: - - id: 11731338212989462854 - type: TransitionOutputNode - state: "{\"location\":{\"x\":120,\"y\":118}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 12462159291396020858 - outputs: - [] - - id: 5005875258605301911 - type: GetParameterFloat - state: "{\"location\":{\"x\":-34,\"y\":230}}" - nodeSpecific: - {} - parameterId: 14724677624567781970 - inputs: - [] - outputs: - - name: Get - id: 18275963554927969773 - data: 0 - - id: 2811085383675707505 - type: GreaterThanNodeFloat - state: "{\"location\":{\"x\":-104,\"y\":128}}" - nodeSpecific: - {} - inputs: - - name: A - id: 10872483824638756943 - - name: B - id: 9457170580670463800 - data: 0.100000001 - outputs: - - name: Result - id: 5036612592930820697 - data: false - Links: - - id: 7146303879928486359 - output: 18275963554927969773 - input: 10872483824638756943 - - id: 12870605454712754654 - output: 5036612592930820697 - input: 12462159291396020858 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - Events: - [] - - id: 1559816839792901889 - fromState: 17362013720582400113 - toState: 3681991280272765136 - shouldBlend: true - blendTime: 0 - Graph: - Nodes: - - id: 4353185446893683017 - type: TransitionOutputNode - state: "{\"location\":{\"x\":216,\"y\":118}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 3827972964461496599 - outputs: - [] - - id: 8401262388928910263 - type: GetParameterFloat - state: "{\"location\":{\"x\":-34,\"y\":214}}" - nodeSpecific: - {} - parameterId: 14724677624567781970 - inputs: - [] - outputs: - - name: Get - id: 6726792203143162984 - data: 0 - - id: 7227732160314416901 - type: LessThanNodeFloat - state: "{\"location\":{\"x\":142,\"y\":252}}" - nodeSpecific: - {} - inputs: - - name: A - id: 12187121267027445680 - - name: B - id: 13814791514744881313 - data: 0.100000001 - outputs: - - name: Result - id: 738529439542813677 - data: false - Links: - - id: 15904718365980337666 - output: 6726792203143162984 - input: 12187121267027445680 - - id: 11862470462851682223 - output: 738529439542813677 - input: 3827972964461496599 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - Events: - [] - - id: 7924813067403359603 - fromState: 2878473185253437245 - toState: 4959086316646373199 - shouldBlend: true - blendTime: 1 - Graph: - Nodes: - - id: 11062424893867846629 - type: TransitionOutputNode - state: "{\"location\":{\"x\":280,\"y\":166}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 8334824368944772969 - outputs: - [] - - id: 8824535931127518854 - type: GetParameterBoolean - state: "{\"location\":{\"x\":-61,\"y\":134}}" - nodeSpecific: - {} - parameterId: 1479367072072825218 - inputs: - [] - outputs: - - name: Get - id: 15363129655624191644 - data: false - - id: 17282162711169094560 - type: AndNode - state: "{\"location\":{\"x\":88,\"y\":124}}" - nodeSpecific: - {} - inputs: - - name: A - id: 10132646139662137838 - - name: B - id: 11743468572293499736 - outputs: - - name: Result - id: 11010260275052348966 - data: false - - id: 13484925391025310362 - type: GetParameterBoolean - state: "{\"location\":{\"x\":-201,\"y\":54}}" - nodeSpecific: - {} - parameterId: 14089125791968877663 - inputs: - [] - outputs: - - name: Get - id: 2365682830968910570 - data: false - Links: - - id: 8924923132298007691 - output: 15363129655624191644 - input: 11743468572293499736 - - id: 17403562062281532048 - output: 11010260275052348966 - input: 8334824368944772969 - - id: 1399652018617867899 - output: 2365682830968910570 - input: 10132646139662137838 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - id: 16741418222055495425 - fromState: 2878473185253437245 - toState: 16788735106587868172 - shouldBlend: true - blendTime: 1 - Graph: - Nodes: - - id: 15319280053520300675 - type: TransitionOutputNode - state: "{\"location\":{\"x\":184,\"y\":326}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 17511013795618814745 - outputs: - [] - - id: 2365174270754884041 - type: GetParameterBoolean - state: "{\"location\":{\"x\":222,\"y\":186}}" - nodeSpecific: - {} - parameterId: 14089125791968877663 - inputs: - [] - outputs: - - name: Get - id: 9256431525144238956 - data: false - - id: 5203943386703931362 - type: NotNode - state: "{\"location\":{\"x\":152,\"y\":268}}" - nodeSpecific: - {} - inputs: - - name: Value - id: 8850764303543511227 - outputs: - - name: Result - id: 7683167445072757152 - data: false - Links: - - id: 11848749067612066567 - output: 9256431525144238956 - input: 8850764303543511227 - - id: 17677665878225347876 - output: 7683167445072757152 - input: 17511013795618814745 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - id: 13269834706927116307 - fromState: 4959086316646373199 - toState: 16788735106587868172 - shouldBlend: false - blendTime: 1 - Graph: - Nodes: - - id: 15364653686485468151 - type: TransitionOutputNode - state: "{\"location\":{\"x\":248,\"y\":54}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 353687032276741306 - data: true - outputs: - [] - Links: - [] - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - id: 11217119714873309087 - fromState: 16788735106587868172 - toState: 3681991280272765136 - shouldBlend: true - blendTime: 0.100000001 - Graph: - Nodes: - - id: 6653287450800999759 - type: TransitionOutputNode - state: "{\"location\":{\"x\":216,\"y\":6}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 15457581589838815982 - outputs: - [] - - id: 9003178911700325979 - type: GetParameterFloat - state: "{\"location\":{\"x\":-418,\"y\":-10}}" - nodeSpecific: - {} - parameterId: 14724677624567781970 - inputs: - [] - outputs: - - name: Get - id: 16985901984330133842 - data: 0 - - id: 4170492445078746776 - type: LessThanNodeFloat - state: "{\"location\":{\"x\":-210,\"y\":0}}" - nodeSpecific: - {} - inputs: - - name: A - id: 1838333731896890928 - - name: B - id: 16265345965886430070 - data: 0.100000001 - outputs: - - name: Result - id: 1722172169532499763 - data: false - - id: 9708513926336064775 - type: AndNode - state: "{\"location\":{\"x\":-8,\"y\":76}}" - nodeSpecific: - {} - inputs: - - name: A - id: 7856883403591827304 - - name: B - id: 5263988595647403898 - outputs: - - name: Result - id: 4505037697392663919 - data: false - - id: 5216124704156292756 - type: GetParameterBoolean - state: "{\"location\":{\"x\":-201,\"y\":134}}" - nodeSpecific: - {} - parameterId: 14089125791968877663 - inputs: - [] - outputs: - - name: Get - id: 4825889497295237971 - data: false - Links: - - id: 17681043406700314896 - output: 16985901984330133842 - input: 1838333731896890928 - - id: 14011397835430996303 - output: 1722172169532499763 - input: 7856883403591827304 - - id: 13597328408190451023 - output: 4505037697392663919 - input: 15457581589838815982 - - id: 9037891135471372692 - output: 4825889497295237971 - input: 5263988595647403898 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - id: 13017777191613838390 - fromState: 16788735106587868172 - toState: 17362013720582400113 - shouldBlend: true - blendTime: 0.100000001 - Graph: - Nodes: - - id: 1036577216395848322 - type: TransitionOutputNode - state: "{\"location\":{\"x\":440,\"y\":102}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 4339803792335917988 - outputs: - [] - - id: 3837004825119610696 - type: GetParameterFloat - state: "{\"location\":{\"x\":-242,\"y\":-26}}" - nodeSpecific: - {} - parameterId: 14724677624567781970 - inputs: - [] - outputs: - - name: Get - id: 10083439431734657165 - data: 0 - - id: 8146112023182747983 - type: GreaterThanNodeFloat - state: "{\"location\":{\"x\":-50,\"y\":-16}}" - nodeSpecific: - {} - inputs: - - name: A - id: 7199274808332462408 - - name: B - id: 8248371284444495255 - data: 0.100000001 - outputs: - - name: Result - id: 8064136978874577860 - data: false - - id: 1916275998856333282 - type: AndNode - state: "{\"location\":{\"x\":206,\"y\":85}}" - nodeSpecific: - {} - inputs: - - name: A - id: 11165617151178048082 - - name: B - id: 16281659103676467265 - outputs: - - name: Result - id: 14319306040759918754 - data: false - - id: 11239840720661179165 - type: GetParameterBoolean - state: "{\"location\":{\"x\":2,\"y\":138}}" - nodeSpecific: - {} - parameterId: 14089125791968877663 - inputs: - [] - outputs: - - name: Get - id: 7590843644979289303 - data: false - Links: - - id: 771059204734299391 - output: 10083439431734657165 - input: 7199274808332462408 - - id: 5345335325942173371 - output: 8064136978874577860 - input: 11165617151178048082 - - id: 12045936758426933960 - output: 14319306040759918754 - input: 4339803792335917988 - - id: 15895413006776543262 - output: 7590843644979289303 - input: 16281659103676467265 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - inputs: - [] - outputs: - - name: Output - id: 9596355334609294623 - - id: 13508735938561582046 - type: StateMachineNode - state: "{\"location\":{\"x\":81,\"y\":118}}" - nodeSpecific: - StateMachine: - name: Add Landing - editorState: "" - skeletonHandle: 13037238043735750390 - States: - - name: Entry - isEntry: true - isAny: false - editorState: "{\"location\":{\"x\":3,\"y\":-22}}" - id: 87308025963726137 - pinId: 3738512538047820925 - pinId2: 13502015004816526643 - Transitions: - - 17801615313508712475 - - name: Any - isEntry: false - isAny: true - editorState: "{\"location\":{\"x\":243,\"y\":-50}}" - id: 7378244001669989679 - pinId: 11132648557640224110 - pinId2: 10812680530357256609 - Transitions: - - 17548788581516315937 - - name: Grounded - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":3,\"y\":74}}" - id: 8562540680908861676 - pinId: 15783084220271775880 - pinId2: 15176222125992417031 - Transitions: - - 17801615313508712475 - - 1330539400043594242 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 12467551309719156360 - type: OutputPoseNode - state: "" - nodeSpecific: - {} - inputs: - - name: Result - id: 15474774621709807742 - outputs: - [] - Links: - [] - Parameters: - [] - Events: - [] - - name: InAir - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":243,\"y\":62}}" - id: 9115845735109484499 - pinId: 12611998591606503645 - pinId2: 17594188333569932431 - Transitions: - - 1893562141280302462 - - 17548788581516315937 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 8406027038188628974 - type: OutputPoseNode - state: "" - nodeSpecific: - {} - inputs: - - name: Result - id: 5808635559910010872 - outputs: - [] - Links: - [] - Parameters: - [] - Events: - [] - - name: Landing - isEntry: false - isAny: false - editorState: "{\"location\":{\"x\":99,\"y\":186}}" - id: 5632050055213484480 - pinId: 9402723407348979363 - pinId2: 17571199017241938484 - Transitions: - - 1893562141280302462 - - 1330539400043594242 - skeletonHandle: 13037238043735750390 - Graph: - Nodes: - - id: 15527431891303545054 - type: OutputPoseNode - state: "{\"location\":{\"x\":0,\"y\":0}}" - nodeSpecific: - {} - inputs: - - name: Result - id: 18312625959658127682 - outputs: - [] - - id: 4558866686129960023 - type: SequencePlayerNode - state: "{\"location\":{\"x\":-360,\"y\":-42}}" - nodeSpecific: - {} - inputs: - - name: "" - id: 18152595225621744195 - data: 1783046688217532516 - - name: Loop - id: 13614687441524201465 - data: false - - name: Speed - id: 16191120713417450286 - data: 1 - - name: Apply Root Motion - id: 15662741971721370889 - data: false - outputs: - - name: Output - id: 12614550527038772479 - Links: - - id: 4328447387372159578 - output: 12614550527038772479 - input: 18312625959658127682 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - Transitions: - - id: 17801615313508712475 - fromState: 87308025963726137 - toState: 8562540680908861676 - shouldBlend: true - blendTime: 1 - Graph: - Nodes: - - id: 16922324210143258328 - type: TransitionOutputNode - state: "" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 13510401290808176093 - data: false - outputs: - [] - Links: - [] - Parameters: - [] - Events: - [] - - id: 1893562141280302462 - fromState: 9115845735109484499 - toState: 5632050055213484480 - shouldBlend: false - blendTime: 1 - Graph: - Nodes: - - id: 612610595606425626 - type: TransitionOutputNode - state: "{\"location\":{\"x\":0,\"y\":0}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 15470900809855580384 - outputs: - [] - - id: 14077063748386931932 - type: GetParameterBoolean - state: "{\"location\":{\"x\":-169,\"y\":-26}}" - nodeSpecific: - {} - parameterId: 14089125791968877663 - inputs: - [] - outputs: - - name: Get - id: 8891107132845255776 - data: false - Links: - - id: 15092293737054029711 - output: 8891107132845255776 - input: 15470900809855580384 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - id: 1330539400043594242 - fromState: 5632050055213484480 - toState: 8562540680908861676 - shouldBlend: false - blendTime: 1 - Graph: - Nodes: - - id: 14565222387483923525 - type: TransitionOutputNode - state: "{\"location\":{\"x\":72,\"y\":38}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 3110773760107421506 - outputs: - [] - - id: 6944830072073543906 - type: GetRelevantAnimationTimeNormalizedNode - state: "{\"location\":{\"x\":-528,\"y\":6}}" - nodeSpecific: - {} - inputs: - [] - outputs: - - name: Return Value - id: 14507732472554396359 - data: 0 - - id: 3140288915129145340 - type: GreaterThanNodeFloat - state: "{\"location\":{\"x\":-200,\"y\":28}}" - nodeSpecific: - {} - inputs: - - name: A - id: 15394648363667948474 - - name: B - id: 8579033885823588814 - data: 0.99000001 - outputs: - - name: Result - id: 2196271944537374659 - data: false - Links: - - id: 2376786509518098254 - output: 14507732472554396359 - input: 15394648363667948474 - - id: 12405964349234057673 - output: 2196271944537374659 - input: 3110773760107421506 - - id: 15501220185525901658 - output: 2196271944537374659 - input: 3110773760107421506 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - - id: 17548788581516315937 - fromState: 7378244001669989679 - toState: 9115845735109484499 - shouldBlend: true - blendTime: 1 - Graph: - Nodes: - - id: 12760292722810910607 - type: TransitionOutputNode - state: "{\"location\":{\"x\":88,\"y\":6}}" - nodeSpecific: - {} - inputs: - - name: Can Enter Transition - id: 15646550239621634684 - outputs: - [] - - id: 14411896685320382679 - type: GetParameterBoolean - state: "{\"location\":{\"x\":-361,\"y\":6}}" - nodeSpecific: - {} - parameterId: 14089125791968877663 - inputs: - [] - outputs: - - name: Get - id: 5914561532232053650 - data: false - - id: 16167686855606786003 - type: NotNode - state: "{\"location\":{\"x\":-159,\"y\":39}}" - nodeSpecific: - {} - inputs: - - name: Value - id: 4280197253244593424 - outputs: - - name: Result - id: 9694174055951335374 - data: false - Links: - - id: 455716539998670530 - output: 5914561532232053650 - input: 4280197253244593424 - - id: 498268818295714862 - output: 9694174055951335374 - input: 15646550239621634684 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] - inputs: - [] - outputs: - - name: Output - id: 1614942447406283931 - - id: 17584398784418846919 - type: AdditiveNode - state: "{\"location\":{\"x\":264,\"y\":86}}" - nodeSpecific: - {} - inputs: - - name: Base Pose - id: 15300227766262742417 - - name: Additive Pose - id: 7567182655145634832 - - name: Alpha - id: 12300756028312173804 - data: 1 - outputs: - - name: Result - id: 15348887883488818158 - Links: - - id: 5696392358544412363 - output: 15348887883488818158 - input: 15529003614232630594 - - id: 8318055603006916811 - output: 1614942447406283931 - input: 7567182655145634832 - - id: 5108768561992337379 - output: 9596355334609294623 - input: 15300227766262742417 - Parameters: - - name: CurrentSpeed - type: Float - id: 14724677624567781970 - data: 0 - - name: YSpeed - type: Float - id: 514367242580045919 - data: 0 - - name: Jump - type: Boolean - id: 1479367072072825218 - data: false - - name: Grounded - type: Boolean - id: 14089125791968877663 - data: false - Events: - [] \ No newline at end of file diff --git a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta b/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta deleted file mode 100644 index 74916ea52..000000000 --- a/Project/Assets/Player Test/AG_NewAnimationGraph.vtanimgraph.vtmeta +++ /dev/null @@ -1,8 +0,0 @@ -Metadata: - assetHandle: 4734108098716078210 - filePath: Assets/Player Test/AG_NewAnimationGraph.vtanimgraph - type: 131072 - Dependencies: - [] - Properties: - {} \ No newline at end of file diff --git a/Project/Assets/Player Test/Player.cs.vtmeta b/Project/Assets/Player Test/Player.cs.vtmeta index 9921479ab..a7c48770c 100644 --- a/Project/Assets/Player Test/Player.cs.vtmeta +++ b/Project/Assets/Player Test/Player.cs.vtmeta @@ -1,5 +1,5 @@ Metadata: - assetHandle: 4232354692353249525 + assetHandle: 16246908528411893914 filePath: Assets/Player Test/Player.cs type: 524288 Dependencies: diff --git a/Project/Assets/Scenes/PlayerScene/Layers/layer_0.vtlayer b/Project/Assets/Scenes/PlayerScene/Layers/layer_0.vtlayer new file mode 100644 index 000000000..b1e2db34a --- /dev/null +++ b/Project/Assets/Scenes/PlayerScene/Layers/layer_0.vtlayer @@ -0,0 +1,903 @@ +Layer: + name: Main + id: 0 + visible: true + locked: false + Entities: + - Entity: + id: 108342541 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Player + - guid: [4801038614670344234, 17500621051426503811] + properties: + - type: 24 + vectorType: 13 + name: Climbing Mode + data: 0 + - type: 7 + vectorType: 13 + name: Slope Limit + data: 20 + - type: 7 + vectorType: 13 + name: Invisible Wall Height + data: 200 + - type: 7 + vectorType: 13 + name: Max Jump Height + data: 100 + - type: 7 + vectorType: 13 + name: Contact Offset + data: 1 + - type: 7 + vectorType: 13 + name: Step Offset + data: 10 + - type: 7 + vectorType: 13 + name: Density + data: 1 + - type: 2 + vectorType: 13 + name: Layer + data: 0 + - type: 0 + vectorType: 13 + name: Has Gravity + data: true + - guid: [5272442441707063634, 16349525528562408586] + properties: + - type: 7 + vectorType: 13 + name: Radius + data: 50 + - type: 7 + vectorType: 13 + name: Height + data: 100 + - type: 10 + vectorType: 13 + name: Offset + data: [0, 100, 0] + - type: 0 + vectorType: 13 + name: Is Trigger + data: false + - type: 16 + vectorType: 13 + name: Physics Material + data: 13487565 + - guid: [4626977537440075682, 8666096866538760379] + properties: + - type: 16 + vectorType: 13 + name: Animation Graph + data: 2057522637158420406 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - type: 16 + vectorType: 13 + name: Override Skin + data: 0 + - type: 0 + vectorType: 13 + name: Apply Root Motion + data: false + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 15314435918099419685 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 33.7689972, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5428802467633469958, 3006162545260469436] + properties: + - type: 21 + vectorType: 12 + name: ScriptNames + data: + - value: Project.Player + - type: 21 + vectorType: 16 + name: ScriptIds + data: + - value: 4720912078553674082 + MonoScripts: + - ScriptEntry: + name: Project.Player + id: 4720912078553674082 + properties: + - type: 7 + name: acceleration + enumName: "" + data: 10 + - type: 7 + name: runSpeed + enumName: "" + data: 350 + - type: 7 + name: sprintSpeed + enumName: "" + data: 472 + - type: 7 + name: deceleration + enumName: "" + data: 10 + - type: 7 + name: jumpForce + enumName: "" + data: 100 + - type: 7 + name: rotationSpeed + enumName: "" + data: 10 + - Entity: + id: 920868302 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Skylight + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5130770350572262273, 9533246575187293344] + properties: + - type: 16 + vectorType: 13 + name: Environment Map + data: 0 + - type: 7 + vectorType: 13 + name: Intensity + data: 1 + - type: 7 + vectorType: 13 + name: LOD + data: 0 + - type: 7 + vectorType: 13 + name: Turbidity + data: 2 + - type: 7 + vectorType: 13 + name: Azimuth + data: 0 + - type: 7 + vectorType: 13 + name: Inclination + data: 0 + - type: 0 + vectorType: 13 + name: Show + data: true + - Entity: + id: 1707526472 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Directional Light + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0.866025448, 0, 0, 0.49999997] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [4956947959302657279, 6431008363526150588] + properties: + - type: 7 + vectorType: 13 + name: Intensity + data: 1 + - type: 17 + vectorType: 13 + name: Color + data: [1, 1, 1] + - type: 7 + vectorType: 13 + name: Light Size + data: 1 + - type: 0 + vectorType: 13 + name: Soft Shadows + data: true + - type: 0 + vectorType: 13 + name: Cast Shadows + data: true + - Entity: + id: 2382627872 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: TransitionCamera + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5524573352483143404, 11007889460122951339] + properties: + - type: 7 + vectorType: 13 + name: Aperture + data: 16 + - type: 7 + vectorType: 13 + name: Shutter Speed + data: 0.00999999978 + - type: 7 + vectorType: 13 + name: ISO + data: 100 + - type: 7 + vectorType: 13 + name: Field of View + data: 60 + - type: 7 + vectorType: 13 + name: Near plane + data: 1 + - type: 7 + vectorType: 13 + name: Far plane + data: 100000 + - type: 2 + vectorType: 13 + name: Priority + data: 0 + - guid: [5459167153101153946, 11768209997352591234] + properties: + - type: 7 + vectorType: 13 + name: Blend Time + data: 1 + - type: 7 + vectorType: 13 + name: Field Of View + data: 60 + - type: 21 + vectorType: 2 + name: Ignored Layers + data: + [] + - type: 24 + vectorType: 13 + name: Camera Type + data: 0 + - type: 24 + vectorType: 13 + name: Blend Type + data: 0 + - type: 7 + vectorType: 13 + name: Damping + data: 0 + - type: 10 + vectorType: 13 + name: Offset + data: [0, 0, 0] + - type: 22 + vectorType: 13 + name: Follow + data: 0 + - type: 22 + vectorType: 13 + name: LookAt + data: 0 + - type: 22 + vectorType: 13 + name: Collision Focus Point + data: 0 + - type: 7 + vectorType: 13 + name: Focal Distance + data: 1000 + - type: 7 + vectorType: 13 + name: Mouse Sensitivity + data: 0.150000006 + - type: 7 + vectorType: 13 + name: Collision Sphere Radius + data: 100 + - type: 0 + vectorType: 13 + name: Collision + data: false + - type: 0 + vectorType: 13 + name: Is Default + data: false + - type: 0 + vectorType: 13 + name: X FollowLock + data: false + - type: 0 + vectorType: 13 + name: Y FollowLock + data: false + - type: 0 + vectorType: 13 + name: Z FollowLock + data: false + - type: 0 + vectorType: 13 + name: X ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Y ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Z ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Additive Blend + data: false + - Entity: + id: 3150351803 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Camera + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, 0, -500] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5524573352483143404, 11007889460122951339] + properties: + - type: 7 + vectorType: 13 + name: Aperture + data: 16 + - type: 7 + vectorType: 13 + name: Shutter Speed + data: 0.00999999978 + - type: 7 + vectorType: 13 + name: ISO + data: 100 + - type: 7 + vectorType: 13 + name: Field of View + data: 60 + - type: 7 + vectorType: 13 + name: Near plane + data: 1 + - type: 7 + vectorType: 13 + name: Far plane + data: 100000 + - type: 2 + vectorType: 13 + name: Priority + data: 0 + - Entity: + id: 3452176958 + components: + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: VCam0 + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [-130.454041, 298.975098, 164.592163] + - type: 25 + vectorType: 13 + name: Rotation + data: [0.0867790058, 0.910905302, -0.249195546, 0.317210555] + - type: 10 + vectorType: 13 + name: Scale + data: [1, 1, 1] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 + - guid: [5524573352483143404, 11007889460122951339] + properties: + - type: 7 + vectorType: 13 + name: Aperture + data: 16 + - type: 7 + vectorType: 13 + name: Shutter Speed + data: 0.00999999978 + - type: 7 + vectorType: 13 + name: ISO + data: 100 + - type: 7 + vectorType: 13 + name: Field of View + data: 60 + - type: 7 + vectorType: 13 + name: Near plane + data: 1 + - type: 7 + vectorType: 13 + name: Far plane + data: 100000 + - type: 2 + vectorType: 13 + name: Priority + data: 1 + - guid: [5459167153101153946, 11768209997352591234] + properties: + - type: 7 + vectorType: 13 + name: Blend Time + data: 1 + - type: 7 + vectorType: 13 + name: Field Of View + data: 60 + - type: 21 + vectorType: 2 + name: Ignored Layers + data: + [] + - type: 24 + vectorType: 13 + name: Camera Type + data: 1 + - type: 24 + vectorType: 13 + name: Blend Type + data: 0 + - type: 7 + vectorType: 13 + name: Damping + data: 0 + - type: 10 + vectorType: 13 + name: Offset + data: [0, 141, 756] + - type: 22 + vectorType: 13 + name: Follow + data: 108342541 + - type: 22 + vectorType: 13 + name: LookAt + data: 108342541 + - type: 22 + vectorType: 13 + name: Collision Focus Point + data: 0 + - type: 7 + vectorType: 13 + name: Focal Distance + data: 1000 + - type: 7 + vectorType: 13 + name: Mouse Sensitivity + data: 0.150000006 + - type: 7 + vectorType: 13 + name: Collision Sphere Radius + data: 100 + - type: 0 + vectorType: 13 + name: Collision + data: false + - type: 0 + vectorType: 13 + name: Is Default + data: false + - type: 0 + vectorType: 13 + name: X FollowLock + data: false + - type: 0 + vectorType: 13 + name: Y FollowLock + data: false + - type: 0 + vectorType: 13 + name: Z FollowLock + data: false + - type: 0 + vectorType: 13 + name: X ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Y ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Z ShouldDamp + data: true + - type: 0 + vectorType: 13 + name: Additive Blend + data: false + - Entity: + id: 3925541712 + components: + - guid: [5594831065701184629, 5808174883320445581] + properties: + - type: 10 + vectorType: 13 + name: Half Size + data: [50, 50, 50] + - type: 10 + vectorType: 13 + name: Offset + data: [0, 0, 0] + - type: 0 + vectorType: 13 + name: Is Trigger + data: false + - type: 16 + vectorType: 13 + name: Physics Material + data: 57928654030491085 + - guid: [4738578920687929342, 8095123518747964547] + properties: + - type: 12 + vectorType: 13 + name: GraphState + data: "" + - guid: [5241627842114713378, 11179844935521484427] + properties: + - type: 24 + vectorType: 13 + name: Type + data: 0 + - type: 2 + vectorType: 13 + name: Layer ID + data: 0 + - type: 7 + vectorType: 13 + name: Mass + data: 1 + - type: 7 + vectorType: 13 + name: Linear Drag + data: 0.00999999978 + - type: 2 + vectorType: 13 + name: Lock Flags + data: 0 + - type: 7 + vectorType: 13 + name: Angular Drag + data: 0.0500000007 + - type: 24 + vectorType: 13 + name: Collision Type + data: 0 + - type: 0 + vectorType: 13 + name: Disable Graivity + data: true + - type: 0 + vectorType: 13 + name: Is Kinematic + data: false + - guid: [5177849256600380923, 13689713549658374275] + properties: + - type: 12 + vectorType: 13 + name: Tag + data: Cube + - guid: [5579790378469427390, 5138106327942809248] + properties: + - type: 16 + vectorType: 13 + name: Mesh + data: 10149696181569838305 + - type: 16 + vectorType: 13 + name: Material + data: 0 + - guid: [5152712443922219371, 10617432012782403218] + properties: + - type: 10 + vectorType: 13 + name: Position + data: [0, -67.2309952, 0] + - type: 25 + vectorType: 13 + name: Rotation + data: [0, 0, 0, 1] + - type: 10 + vectorType: 13 + name: Scale + data: [20, 1, 20] + - type: 0 + vectorType: 13 + name: "Visible " + data: true + - type: 0 + vectorType: 13 + name: "Locked " + data: false + - guid: [5115013315947959062, 13305215203298195585] + properties: + - type: 2 + vectorType: 13 + name: "LayerId " + data: 0 + - guid: [5086337540049333714, 3220959922222851753] + properties: + - type: 21 + vectorType: 22 + name: Children + data: + [] + - type: 22 + vectorType: 13 + name: Parent + data: 0 \ No newline at end of file diff --git a/Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene b/Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene new file mode 100644 index 000000000..16892a1a7 --- /dev/null +++ b/Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene @@ -0,0 +1,2 @@ +Scene: + name: PlayerScene \ No newline at end of file diff --git a/Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene.vtmeta b/Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene.vtmeta new file mode 100644 index 000000000..e8b3b943f --- /dev/null +++ b/Project/Assets/Scenes/PlayerScene/PlayerScene.vtscene.vtmeta @@ -0,0 +1,8 @@ +Metadata: + assetHandle: 1032841075789737429 + filePath: Assets/Scenes/PlayerScene/PlayerScene.vtscene + type: 256 + Dependencies: + [] + Properties: + {} \ No newline at end of file diff --git a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp index edee17723..8ee949f60 100644 --- a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp +++ b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.cpp @@ -83,6 +83,9 @@ void EditorResources::Initialize() myEditorIcons[EditorIcon::GraphPinAnimationPose] = TryLoadIcon("Editor/Textures/Icons/icon_graph_pin_anim_pose.dds"); myEditorIcons[EditorIcon::GraphPinAnimationPoseFilled] = TryLoadIcon("Editor/Textures/Icons/icon_graph_pin_anim_pose_filled.dds"); + myEditorIcons[EditorIcon::StateMachineAliasState] = TryLoadIcon("Editor/Textures/Icons/icon_statemachine_alias_state.dds"); + myEditorIcons[EditorIcon::StateMachineAnimationState] = TryLoadIcon("Editor/Textures/Icons/icon_statemachine_animation_state.dds"); + myEditorIcons[EditorIcon::Volt] = TryLoadIcon("Editor/Textures/Icons/icon_volt.dds"); } diff --git a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h index ac6b1a571..d4d1fc956 100644 --- a/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h +++ b/Volt/Sandbox/src/Sandbox/Utility/EditorResources.h @@ -57,6 +57,10 @@ enum class EditorIcon GraphPinAnimationPose, GraphPinAnimationPoseFilled, + StateMachineAliasState, + StateMachineAnimationState, + + Volt, }; diff --git a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp index 55ebf2b43..6180fcfbe 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AnimationGraph/AnimationGraphPanel.cpp @@ -5,14 +5,17 @@ #include #include + #include #include #include + #include #include #include + #include #include #include @@ -422,6 +425,11 @@ void AnimationGraphPanel::DrawNodesPanel() { GetLastEntry().stateMachine->AddState("New State", Volt::StateMachineStateType::AnimationState); } + + if (ImGui::Button("Add Alias")) + { + GetLastEntry().stateMachine->AddState("New Alias", Volt::StateMachineStateType::AliasState); + } } ImGui::End(); } @@ -623,13 +631,32 @@ void AnimationGraphPanel::DrawStateMachineNodes() // Content { + Ref Icon; + if (state->stateType == Volt::StateMachineStateType::AnimationState) + { + Icon = EditorResources::GetEditorIcon(EditorIcon::StateMachineAnimationState); + + } + else if (state->stateType == Volt::StateMachineStateType::AliasState) + { + Icon = EditorResources::GetEditorIcon(EditorIcon::StateMachineAliasState); + } + ImGui::BeginHorizontal("content_frame"); ImGui::Spring(1, padding); ImGui::BeginVertical("content", ImVec2(0.0f, 0.0f)); - ImGui::Dummy(ImVec2(160, 0)); + ImGui::Dummy(ImVec2(160.f, 0)); ImGui::Spring(1); + + ImGui::BeginHorizontal("contentinfo"); + if (Icon) + { + ImGui::Image(UI::GetTextureID(Icon), ImVec2(20, 20)); + } ImGui::TextUnformatted(state->name.c_str()); + ImGui::EndHorizontal(); + ImGui::Spring(1); ImGui::EndVertical(); contentRect = ImGui_GetItemRect(); @@ -910,8 +937,8 @@ void AnimationGraphPanel::DrawStateMachineProperties() } else { - auto node = GetLastEntry().stateMachine->GetStateById(selectedNodes.at(0)); - if (!node) + auto selectedNode = GetLastEntry().stateMachine->GetStateById(selectedNodes.at(0)); + if (!selectedNode) { return; } @@ -919,9 +946,36 @@ void AnimationGraphPanel::DrawStateMachineProperties() UI::PushID(); if (UI::BeginProperties("stateProperties")) { - if (node->name != "Entry") + if (selectedNode->name != "Entry") + { + UI::Property("Name", selectedNode->name); + } + + if (selectedNode->stateType == Volt::StateMachineStateType::AliasState) { - UI::Property("Name", node->name); + auto aliasState = reinterpret_cast(selectedNode); + + UI::Header("Transition from states"); + for (auto state : GetLastEntry().stateMachine->GetStates()) + { + if (state->stateType == Volt::StateMachineStateType::AnimationState) + { + auto it = std::find(aliasState->transitionFromStates.begin(), aliasState->transitionFromStates.end(), state->id); + bool value = it != aliasState->transitionFromStates.end(); + if (UI::Property(state->name, value)) + { + if (value) // changed from false to true + { + aliasState->transitionFromStates.push_back(state->id); + } + else //changed from true to false + { + aliasState->transitionFromStates.erase(it); + } + } + } + } + } UI::EndProperties(); diff --git a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp index 977629663..e7936c07d 100644 --- a/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp +++ b/Volt/Volt/src/Volt/Animation/AnimationStateMachine.cpp @@ -55,31 +55,38 @@ namespace Volt myCurrentBlendingTime += deltaTime; } - // Check any state for transitions - /*for (const auto& state : myStates) + // Check alias states for transitions + for (const auto& state : myStates) { - if (state->isAny) + if (state->stateType == StateMachineStateType::AliasState) { - for (const auto transitionId : state->transitions) + Ref aliasState = std::reinterpret_pointer_cast(state); + auto it = std::find(aliasState->transitionFromStates.begin(), aliasState->transitionFromStates.end(), GetAnimationState(myCurrentState)->id); + if (it != aliasState->transitionFromStates.end()) { - if (ShouldTransition(transitionId, state->id)) + for (const auto transitionId : state->transitions) { - const auto transition = GetTransitionById(transitionId); - if (transition->toState == myStates.at(myCurrentState)->id) + if (ShouldTransition(transitionId, state->id)) { - continue; + const auto transition = GetTransitionById(transitionId); + if (transition->toState == myStates.at(myCurrentState)->id) + { + continue; + } + + SetNextState(transition->toState, transitionId); + return; } - - SetNextState(transition->toState, transitionId); - return; } } break; } - }*/ + } const auto& currState = myStates.at(myCurrentState); + VT_WARN("{}", currState->name); + for (const auto& id : currState->transitions) { const auto transition = GetTransitionById(id); From 0c1d46e9c4776fea4e7d3bd42acc07683c7c6d15 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Wed, 18 Oct 2023 00:17:45 +0200 Subject: [PATCH 15/18] Upgrade function for animation graphs to 0.1.2 --- .../Sandbox/Modals/ProjectUpgradeModal.cpp | 385 ++++++++++++++++++ .../src/Sandbox/Modals/ProjectUpgradeModal.h | 2 +- .../AssetBrowser/EditorAssetRegistry.cpp | 5 +- Volt/Volt/src/Volt/Core/Base.h | 2 +- 4 files changed, 391 insertions(+), 3 deletions(-) diff --git a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp index 6cf7e4f5f..840b5a3ea 100644 --- a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp +++ b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp @@ -4,7 +4,16 @@ #include #include +#include +#include +#include + +#include + #include +#include + +#include "Wire/WireGUID.h" ProjectUpgradeModal::ProjectUpgradeModal(const std::string& strId) : Modal(strId) @@ -59,6 +68,10 @@ void ProjectUpgradeModal::UpgradeCurrentProject() { ConvertMetaFilesFromV0(); } + if (projectVersion.GetPatch() < 2 && projectVersion.GetMinor() < 2 && projectVersion.GetMajor() == 0) + { + ConvertAnimationGraphsToV0_1_2(); + } Volt::ProjectManager::OnProjectUpgraded(); Volt::ProjectManager::SerializeProject(); @@ -107,6 +120,378 @@ void ProjectUpgradeModal::ConvertMetaFilesFromV0() } } +void ProjectUpgradeModal::ConvertAnimationGraphsToV0_1_2() +{ + auto& project = Volt::ProjectManager::GetProject(); + + const std::filesystem::path assetsPath = project.projectDirectory / project.assetsDirectory; + + std::vector animGraphsToConvert; + std::vector characterAssets; + std::vector layerAssets; + std::vector prefabAssets; + for (const auto& entry : std::filesystem::recursive_directory_iterator(assetsPath)) + { + if (entry.path().extension().string() == ".vtanimgraph") + { + animGraphsToConvert.emplace_back(entry.path()); + } + + if (entry.path().extension().string() == ".vtchr") + { + characterAssets.emplace_back(entry.path()); + } + + if (entry.path().extension().string() == ".vtlayer") + { + layerAssets.emplace_back(entry.path()); + } + + if (entry.path().extension().string() == ".vtprefab") + { + prefabAssets.emplace_back(entry.path()); + } + } + + auto parseCharacterWithHandle = [characterAssets](Volt::AssetHandle handle, Volt::AssetHandle& outSkinHandle, Volt::AssetHandle& outSkeletonHandle) + { + for (const auto& characterPath : characterAssets) + { + Volt::YAMLStreamReader metaStreamReader{}; + + if (!metaStreamReader.OpenFile(characterPath.string() + ".vtmeta")) + { + return false; + } + + Volt::AssetHandle characterAssetHandle = 0; + + metaStreamReader.EnterScope("Metadata"); + + characterAssetHandle = metaStreamReader.ReadKey("assetHandle", uint64_t(0)); + + if (characterAssetHandle == handle) + { + Volt::YAMLStreamReader charStreamReader{}; + + if (!charStreamReader.OpenFile(characterPath)) + { + return false; + } + + charStreamReader.EnterScope("AnimatedCharacter"); + outSkeletonHandle = charStreamReader.ReadKey("skeleton", uint64_t(0)); + outSkinHandle = charStreamReader.ReadKey("skin", uint64_t(0)); + return true; + } + } + return false; + }; + + struct AnimGraphDescriptor + { + Volt::AssetHandle handle = 0; + Volt::AssetHandle skeletonHandle = 0; + Volt::AssetHandle skinHandle = 0; + }; + + std::vector animGraphDescriptors; + animGraphDescriptors.resize(animGraphsToConvert.size()); + + for (const auto& animGraphPath : animGraphsToConvert) + { + AnimGraphDescriptor& descriptor = animGraphDescriptors.emplace_back(); + { // convert the animgraph + {// parse meta + Volt::YAMLStreamReader metaStreamReader{}; + + if (!metaStreamReader.OpenFile(animGraphPath.string() + ".vtmeta")) + { + VT_CORE_ASSERT(false); + } + + Volt::AssetHandle characterAssetHandle = 0; + + metaStreamReader.EnterScope("Metadata"); + + descriptor.handle = metaStreamReader.ReadKey("assetHandle", uint64_t(0)); + } + + std::ifstream input(animGraphPath); + if (!input.is_open()) + { + VT_CORE_ERROR("Failed to convert: File {0} not found!", animGraphPath); + continue; + } + + std::stringstream sstream; + sstream << input.rdbuf(); + input.close(); + + YAML::Node root; + + root = YAML::Load(sstream.str()); + + YAML::Node rootNode = root["AnimationGraph"]; + Volt::AssetHandle characterHandle = rootNode["character"].as(); + rootNode.remove("character"); + + parseCharacterWithHandle(characterHandle, descriptor.skinHandle, descriptor.skeletonHandle); + + uint64_t apa2 = descriptor.skinHandle; + apa2; + + uint64_t skeletonHandleInt = static_cast(descriptor.skeletonHandle); + rootNode.force_insert("skeleton", skeletonHandleInt); + + + YAML::Node graphNode = rootNode["Graph"]; + + for (int nodeIndex = 0; graphNode["Nodes"][nodeIndex]; nodeIndex++) + { + auto node = graphNode["Nodes"][nodeIndex]; + if (node["type"].as() == "StateMachineNode") + { + auto nodeSpecific = node["nodeSpecific"]; + auto stateMachineNode = nodeSpecific["StateMachine"]; + stateMachineNode.remove("characterHandle"); + stateMachineNode.force_insert("skeletonHandle", skeletonHandleInt); + + //loop through all states + for (int i = 0; stateMachineNode["States"][i]; i++) + { + auto state = stateMachineNode["States"][i]; + + if (state["characterHandle"]) + { + state.remove("characterHandle"); + state.force_insert("skeletonHandle", skeletonHandleInt); + } + state.force_insert("topPinId", state["pinId"].as()); + state.force_insert("bottomPinId", state["pinId2"].as()); + state.remove("pinId"); + state.remove("pinId2"); + + bool isAny = state["isAny"].as(); + bool isEntry = state["isEntry"].as(); + state.force_insert("stateType", isAny ? "AliasState" : isEntry ? "EntryState" : "AnimationState"); + + if (isAny) + { + YAML::Node arrayNode(YAML::NodeType::Sequence); // Create a new Node of Sequence type. + for (auto stateLoopTwo : stateMachineNode["States"]) + { + if (!(stateLoopTwo["isAny"].as()) && !(stateLoopTwo["isEntry"].as())) + { + arrayNode.push_back(stateLoopTwo["id"].as()); // Add elements to the Sequence Node. + } + } + + state.force_insert("TransitionFromStates", arrayNode); + } + } + //loop through them again and remove the bools + for (int i = 0; stateMachineNode["States"][i]; i++) + { + auto state = stateMachineNode["States"][i]; + state.remove("isAny"); + state.remove("isEntry"); + } + } + } + + std::ofstream output(animGraphPath); + if (!output.is_open()) + { + VT_CORE_ERROR("Failed to convert: File {0} not found!", animGraphPath); + continue; + } + + output << root; + output.close(); + } + } + + auto createMeshComponentNode = [](Volt::AssetHandle skinHandle) + { + YAML::Node meshComponentNode; + + YAML::Node guidNode(YAML::NodeType::Sequence); + guidNode.push_back(5579790378469427390); + guidNode.push_back(5138106327942809248); + meshComponentNode.force_insert("guid", guidNode); // guid for mesh component + + YAML::Node propertiesNode(YAML::NodeType::Sequence); + + YAML::Node propertyNodeMesh; + propertyNodeMesh["type"] = 16; + propertyNodeMesh["vectorType"] = 13; + propertyNodeMesh["name"] = "Mesh"; + propertyNodeMesh["data"] = static_cast(skinHandle); + propertiesNode.push_back(propertyNodeMesh); + + YAML::Node propertyNodeMaterial; + propertyNodeMaterial["type"] = 16; + propertyNodeMaterial["vectorType"] = 13; + propertyNodeMaterial["name"] = "Material"; + propertyNodeMaterial["data"] = 0; + propertiesNode.push_back(propertyNodeMaterial); + + meshComponentNode.force_insert("properties", propertiesNode); + return meshComponentNode; + }; + + for (auto& layer : layerAssets) + { + bool modified = false; + std::ifstream input(layer); + if (!input.is_open()) + { + VT_CORE_ERROR("Failed to convert: File {0} not found!", layer); + continue; + } + + std::stringstream sstream; + sstream << input.rdbuf(); + input.close(); + + YAML::Node root; + + root = YAML::Load(sstream.str()); + + YAML::Node rootNode = root["Layer"]; + + if (rootNode["Entities"]) + { + for (int entityIndex = 0; rootNode["Entities"][entityIndex]; entityIndex++) + { + auto entity = rootNode["Entities"][entityIndex]["Entity"]; + if (entity["components"]) + { + + for (int componentIndex = 0; entity["components"][componentIndex]; componentIndex++) + { + auto compNode = entity["components"][componentIndex]; + WireGUID componentGUID; + componentGUID.hiPart = compNode["guid"][0].as(); + componentGUID.loPart = compNode["guid"][1].as(); + if (componentGUID == WireGUID::Null()) + { + continue; + } + + // check if the component is an animation controller + if (componentGUID.hiPart == 4626977537440075682 && componentGUID.loPart == 8666096866538760379) + { + if (compNode["properties"].size() > 0) + { + uint64_t compGraphAssetId = compNode["properties"][0]["data"].as(); + + for (auto& descriptor : animGraphDescriptors) + { + if (descriptor.handle == compGraphAssetId) + { + entity["components"].push_back(createMeshComponentNode(descriptor.skinHandle)); + modified = true; + break; + } + } + } + } + } + } + } + } + + if (modified) + { + std::ofstream output(layer); + if (!output.is_open()) + { + VT_CORE_ERROR("Failed to convert: File {0} not found!", layer); + continue; + } + + output << root; + output.close(); + } + } + + for (auto& prefab : prefabAssets) + { + bool modified = false; + std::ifstream input(prefab); + if (!input.is_open()) + { + VT_CORE_ERROR("Failed to convert: File {0} not found!", prefab); + continue; + } + + std::stringstream sstream; + sstream << input.rdbuf(); + input.close(); + + YAML::Node root; + + root = YAML::Load(sstream.str()); + + YAML::Node rootNode = root["Prefab"]; + + if (rootNode["entities"]) + { + for (int entityIndex = 0; rootNode["entities"][entityIndex]; entityIndex++) + { + auto entity = rootNode["entities"][entityIndex]; + if (entity["components"]) + { + + for (int componentIndex = 0; entity["components"][componentIndex]; componentIndex++) + { + auto compNode = entity["components"][componentIndex]; + WireGUID componentGUID; + componentGUID.hiPart = compNode["guid"][0].as(); + componentGUID.loPart = compNode["guid"][1].as(); + if (componentGUID == WireGUID::Null()) + { + continue; + } + + // check if the component is an animation controller + if (componentGUID.hiPart == 4626977537440075682 && componentGUID.loPart == 8666096866538760379) + { + if (compNode["properties"].size() > 0) + { + uint64_t compGraphAssetId = compNode["properties"][0]["data"].as(); + for (auto& descriptor : animGraphDescriptors) + { + if (descriptor.handle == compGraphAssetId) + { + modified = true; + entity["components"].push_back(createMeshComponentNode(descriptor.skinHandle)); + break; + } + } + } + } + } + } + } + } + if (modified) + { + std::ofstream output(prefab); + if (!output.is_open()) + { + VT_CORE_ERROR("Failed to convert: File {0} not found!", prefab); + continue; + } + + output << root; + output.close(); + } + } +} + std::pair ProjectUpgradeModal::DeserializeV0MetaFile(const std::filesystem::path& metaPath) { Volt::YAMLStreamReader streamReader{}; diff --git a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.h b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.h index 324ef4ac2..4fd85a409 100644 --- a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.h +++ b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.h @@ -18,6 +18,6 @@ class ProjectUpgradeModal : public Modal private: void UpgradeCurrentProject(); void ConvertMetaFilesFromV0(); - + void ConvertAnimationGraphsToV0_1_2(); std::pair DeserializeV0MetaFile(const std::filesystem::path& metaPath); }; diff --git a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp index 155ad7e47..8574c9402 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/EditorAssetRegistry.cpp @@ -152,7 +152,10 @@ std::unordered_map EditorAssetRegistry::myAsse ASSET_BROWSER_POPUP_DATA_FUNCTION_IDENTIFIER(aAssetHandle) { auto asset = Volt::AssetManager::GetAsset(aAssetHandle); - + if (!asset->IsValid()) + { + return std::vector>(); + } const auto skeletonFilePath = Volt::AssetManager::GetFilePathFromAssetHandle(asset->GetSkeleton()->handle).string(); const auto meshFilePath = Volt::AssetManager::GetFilePathFromAssetHandle(asset->GetSkin()->handle).string(); diff --git a/Volt/Volt/src/Volt/Core/Base.h b/Volt/Volt/src/Volt/Core/Base.h index e011162a2..cb1d452ed 100644 --- a/Volt/Volt/src/Volt/Core/Base.h +++ b/Volt/Volt/src/Volt/Core/Base.h @@ -4,7 +4,7 @@ #include #include -#define VT_VERSION Version::Create(0, 1, 1) +#define VT_VERSION Version::Create(0, 1, 2) #define BIT(X) (1 << (X)) #define TO_NORMALIZEDRGB(r, g, b) glm::vec4{ r / 255.f, g / 255.f, b / 255.f, 1.f } From 2b7f22a23e05c763931fd270aa541e80b8e4ee27 Mon Sep 17 00:00:00 2001 From: cooltomten Date: Wed, 1 Nov 2023 21:28:11 +0100 Subject: [PATCH 16/18] Started work on Weave --- Volt/Volt/src/Volt/Asset/Asset.h | 3 ++- .../Volt/src/Volt/Components/RenderingComponents.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Volt/Volt/src/Volt/Asset/Asset.h b/Volt/Volt/src/Volt/Asset/Asset.h index fc1312121..422e14199 100644 --- a/Volt/Volt/src/Volt/Asset/Asset.h +++ b/Volt/Volt/src/Volt/Asset/Asset.h @@ -51,7 +51,8 @@ namespace Volt Timeline = BIT(23), NetContract = BIT(24), PostProcessingMaterial = BIT(25), - PostProcessingStack = BIT(26) + PostProcessingStack = BIT(26), + MotionWeaver = BIT(27), }; inline AssetType operator|(AssetType aLhs, AssetType aRhs) diff --git a/Volt/Volt/src/Volt/Components/RenderingComponents.h b/Volt/Volt/src/Volt/Components/RenderingComponents.h index 42ca39921..c030cb68f 100644 --- a/Volt/Volt/src/Volt/Components/RenderingComponents.h +++ b/Volt/Volt/src/Volt/Components/RenderingComponents.h @@ -145,6 +145,20 @@ namespace Volt REGISTER_COMPONENT(AnimationControllerComponent); }; + struct MotionWeaveComponent + { + AssetHandle motionWeave = Asset::Null(); + + static void ReflectType(TypeDesc& reflect) + { + reflect.SetGUID("{5D3B2C0D-5457-43D8-9623-98730E1556F4}"_guid); + reflect.SetLabel("Motion Weave Component"); + reflect.AddMember(&MotionWeaveComponent::motionWeave, "motionGraph", "Motion Graph", "", Asset::Null(), AssetType::MotionWeave); + } + + REGISTER_COMPONENT(MotionWeaveComponent); + }; + struct VertexPaintedComponent { AssetHandle meshHandle = Asset::Null(); From 4cdace79fbe17d28b1232f1bd99aad0d687431e2 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Thu, 2 Nov 2023 19:52:53 +0100 Subject: [PATCH 17/18] Move animation graph upgrade to the correct spot --- Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp index 2729f31d6..bb7f0b4eb 100644 --- a/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp +++ b/Volt/Sandbox/src/Sandbox/Modals/ProjectUpgradeModal.cpp @@ -196,15 +196,16 @@ void ProjectUpgradeModal::UpgradeCurrentProject() ConvertMetaFilesToV011(); } + if (projectVersion.GetPatch() < 2 && projectVersion.GetMinor() < 2 && projectVersion.GetMajor() == 0) + { + ConvertAnimationGraphsToV0_1_2(); + } + if (projectVersion.GetMinor() < 3 && projectVersion.GetMajor() == 0) { ConvertPrefabsToV113(); ConvertScenesToV113(); } - if (projectVersion.GetPatch() < 2 && projectVersion.GetMinor() < 2 && projectVersion.GetMajor() == 0) - { - ConvertAnimationGraphsToV0_1_2(); - } Volt::ProjectManager::OnProjectUpgraded(); Volt::ProjectManager::SerializeProject(); From 3ae4ca5c138cc72c4199f471f1e8ce49db3d0ef3 Mon Sep 17 00:00:00 2001 From: Cooltomten Date: Wed, 13 Dec 2023 23:42:42 +0100 Subject: [PATCH 18/18] Fixed some compilation errors --- Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h | 1 + Volt/Volt/src/Volt/Asset/Asset.h | 2 +- Volt/Volt/src/Volt/Vision/TimelinePlayer.cpp | 2 +- Volt/Volt/src/Volt/Vision/Vision.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h index 4fe46e7a8..9daae894d 100644 --- a/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h +++ b/Volt/Volt/src/Volt/Asset/Animation/AnimationGraphAsset.h @@ -39,6 +39,7 @@ namespace Volt Ref CreateCopy(EntityID entity = Entity::NullID()); + Ref GetRelevantAnimationNode(); private: friend class AnimationGraphImporter; diff --git a/Volt/Volt/src/Volt/Asset/Asset.h b/Volt/Volt/src/Volt/Asset/Asset.h index 422e14199..3d63c8708 100644 --- a/Volt/Volt/src/Volt/Asset/Asset.h +++ b/Volt/Volt/src/Volt/Asset/Asset.h @@ -52,7 +52,7 @@ namespace Volt NetContract = BIT(24), PostProcessingMaterial = BIT(25), PostProcessingStack = BIT(26), - MotionWeaver = BIT(27), + MotionWeave = BIT(27), }; inline AssetType operator|(AssetType aLhs, AssetType aRhs) diff --git a/Volt/Volt/src/Volt/Vision/TimelinePlayer.cpp b/Volt/Volt/src/Volt/Vision/TimelinePlayer.cpp index d81e5dae0..36d36a7df 100644 --- a/Volt/Volt/src/Volt/Vision/TimelinePlayer.cpp +++ b/Volt/Volt/src/Volt/Vision/TimelinePlayer.cpp @@ -153,7 +153,7 @@ void Volt::TimelinePlayer::PlayTimeline(const float& deltaTime, Scene* scene) if (myCurrentPlaybackTime <= track.clips.at(0).startTime) { - if (vision.GetActiveCamera() != track.clips[0].activeCamera) + if (vision.GetActiveCamera().GetID() != track.clips[0].activeCamera) { vision.SetActiveCamera(track.clips[0].activeCamera, 0, Volt::eBlendType::None); myCurrentPlaybackTime += deltaTime; diff --git a/Volt/Volt/src/Volt/Vision/Vision.cpp b/Volt/Volt/src/Volt/Vision/Vision.cpp index 8a4b957a3..ab1e9c96c 100644 --- a/Volt/Volt/src/Volt/Vision/Vision.cpp +++ b/Volt/Volt/src/Volt/Vision/Vision.cpp @@ -72,7 +72,7 @@ void Volt::Vision::Update(float aDeltaTime) if (myTransitionCamera) { - cams.erase(std::remove(cams.begin(), cams.end(), myTransitionCamera.GetID()), cams.end()); + cams.erase(std::remove(cams.begin(), cams.end(), myTransitionCamera), cams.end()); } if (myVTCams.size() != cams.size())