diff --git a/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas index 8569d7686b..391ad295a5 100644 --- a/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas +++ b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 1874297699023155003 + "id": 8461866310375259320 }, "Name": "CameraController", "Components": { @@ -579,17 +579,88 @@ }, { "Id": { - "id": 58633135722148 + "id": 214400860662419 + }, + "Name": "SC Node(GetVariable)", + "Components": { + "Component_[1359072869693534631]": { + "$type": "GetVariableNode", + "Id": 1359072869693534631, + "Slots": [ + { + "id": { + "m_id": "{7500DE86-7349-4213-B3D6-F2872EDF15A6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8C8D3DD7-F821-42F4-AF51-5D976133DAE4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5E4734A2-3CAF-4E29-AC72-5689FF1FD619}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "m_variableId": { + "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" + }, + "m_variableDataOutSlotId": { + "m_id": "{5E4734A2-3CAF-4E29-AC72-5689FF1FD619}" + } + } + } + }, + { + "Id": { + "id": 58581596114596 }, "Name": "SC-Node(OperatorMul)", "Components": { - "Component_[13427352953117170385]": { + "Component_[14210959117790557692]": { "$type": "OperatorMul", - "Id": 13427352953117170385, + "Id": 14210959117790557692, "Slots": [ { "id": { - "m_id": "{B6D38C30-7BB4-4549-AFFA-C5A52AE9796E}" + "m_id": "{374AA17F-7CC0-4808-8269-6CC4F64579C3}" }, "contracts": [ { @@ -604,7 +675,7 @@ }, { "id": { - "m_id": "{86D20026-0D06-4DFB-B3CD-9BE5038B8121}" + "m_id": "{1E111259-19D2-4180-81A1-F648F79B004D}" }, "contracts": [ { @@ -619,7 +690,7 @@ }, { "id": { - "m_id": "{F9E6233F-EAFB-43F5-A10D-96A3A41763A7}" + "m_id": "{E7D6A002-7522-4915-BCCB-89A29E3D5582}" }, "DynamicTypeOverride": 3, "contracts": [ @@ -648,10 +719,10 @@ ] } ], - "slotName": "Number", + "slotName": "Transform", "toolTip": "An operand to use in performing the specified Operation", "DisplayDataType": { - "m_type": 3 + "m_type": 7 }, "DisplayGroup": { "Value": 1114760223 @@ -667,7 +738,7 @@ }, { "id": { - "m_id": "{9D3D613C-ABE4-4028-A1CC-22E6E036376C}" + "m_id": "{0ABC384E-FBE6-40F8-B5C3-7652B814102C}" }, "DynamicTypeOverride": 3, "contracts": [ @@ -696,10 +767,10 @@ ] } ], - "slotName": "Number", + "slotName": "Transform", "toolTip": "An operand to use in performing the specified Operation", "DisplayDataType": { - "m_type": 3 + "m_type": 7 }, "DisplayGroup": { "Value": 1114760223 @@ -715,7 +786,7 @@ }, { "id": { - "m_id": "{C0EA31C9-71C6-4CCF-A31B-33E7385C78D0}" + "m_id": "{7DA1EC3E-277C-4DDA-94FD-EF2EC66CD272}" }, "DynamicTypeOverride": 3, "contracts": [ @@ -747,7 +818,7 @@ "slotName": "Result", "toolTip": "The result of the specified operation", "DisplayDataType": { - "m_type": 3 + "m_type": 7 }, "DisplayGroup": { "Value": 1114760223 @@ -765,110 +836,65 @@ "Datums": [ { "scriptCanvasType": { - "m_type": 3 + "m_type": 7 }, "isNullPointer": false, - "$type": "double", - "value": 1.0, - "label": "Number" + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform" }, { "scriptCanvasType": { - "m_type": 3 + "m_type": 7 }, "isNullPointer": false, - "$type": "double", - "value": -90.0, - "label": "Number" - } - ] - } - } - }, - { - "Id": { - "id": 214400860662419 - }, - "Name": "SC Node(GetVariable)", - "Components": { - "Component_[1359072869693534631]": { - "$type": "GetVariableNode", - "Id": 1359072869693534631, - "Slots": [ - { - "id": { - "m_id": "{7500DE86-7349-4213-B3D6-F2872EDF15A6}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{8C8D3DD7-F821-42F4-AF51-5D976133DAE4}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{5E4734A2-3CAF-4E29-AC72-5689FF1FD619}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Number", - "DisplayDataType": { - "m_type": 3 - }, - "Descriptor": { - "ConnectionType": 2, - "SlotType": 2 + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 }, - "DataType": 1 + "label": "Transform" } - ], - "m_variableId": { - "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" - }, - "m_variableDataOutSlotId": { - "m_id": "{5E4734A2-3CAF-4E29-AC72-5689FF1FD619}" - } + ] } } }, { "Id": { - "id": 58577301147300 + "id": 213241219492499 }, - "Name": "SC-Node(OperatorMul)", + "Name": "SC-Node(OperatorAdd)", "Components": { - "Component_[14055904483179664364]": { - "$type": "OperatorMul", - "Id": 14055904483179664364, + "Component_[14948826965328970882]": { + "$type": "OperatorAdd", + "Id": 14948826965328970882, "Slots": [ { "id": { - "m_id": "{F5BE2CBC-3CA3-44BD-B7D4-71D9CAC023B3}" + "m_id": "{56805D2B-0C98-4145-80FB-AA1DCB16CF1A}" }, "contracts": [ { @@ -883,7 +909,7 @@ }, { "id": { - "m_id": "{4CD5D25E-73DA-4936-89E9-8F0A7946DED1}" + "m_id": "{008FCEC7-3E86-4249-A736-F158EFDB0EFA}" }, "contracts": [ { @@ -898,7 +924,7 @@ }, { "id": { - "m_id": "{2F0B4FC7-0B48-42A9-8073-8493E9F1D2E5}" + "m_id": "{DB849F77-66D0-4D64-A45F-122F93E1E80C}" }, "DynamicTypeOverride": 3, "contracts": [ @@ -907,7 +933,6 @@ }, { "$type": "MathOperatorContract", - "OperatorType": "Multiply", "NativeTypes": [ { "m_type": 3 @@ -916,7 +941,19 @@ "m_type": 6 }, { - "m_type": 7 + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 }, { "m_type": 14 @@ -946,7 +983,7 @@ }, { "id": { - "m_id": "{67B729E8-73F9-4B97-A67C-C986E874BD01}" + "m_id": "{CA8ABF3F-BF80-4A8B-A2B2-A1D2C16278C1}" }, "DynamicTypeOverride": 3, "contracts": [ @@ -955,7 +992,6 @@ }, { "$type": "MathOperatorContract", - "OperatorType": "Multiply", "NativeTypes": [ { "m_type": 3 @@ -964,7 +1000,19 @@ "m_type": 6 }, { - "m_type": 7 + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 }, { "m_type": 14 @@ -994,7 +1042,7 @@ }, { "id": { - "m_id": "{785A9BC8-8F65-4DFE-8809-7C8E937A8D8B}" + "m_id": "{53895246-F759-4328-AABB-D26E49E5208D}" }, "DynamicTypeOverride": 3, "contracts": [ @@ -1003,7 +1051,6 @@ }, { "$type": "MathOperatorContract", - "OperatorType": "Multiply", "NativeTypes": [ { "m_type": 3 @@ -1012,414 +1059,10 @@ "m_type": 6 }, { - "m_type": 7 + "m_type": 8 }, { - "m_type": 14 - }, - { - "m_type": 15 - } - ] - } - ], - "slotName": "Result", - "toolTip": "The result of the specified operation", - "DisplayDataType": { - "m_type": 3 - }, - "DisplayGroup": { - "Value": 1114760223 - }, - "Descriptor": { - "ConnectionType": 2, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 - } - ], - "Datums": [ - { - "scriptCanvasType": { - "m_type": 3 - }, - "isNullPointer": false, - "$type": "double", - "value": 1.0, - "label": "Number" - }, - { - "scriptCanvasType": { - "m_type": 3 - }, - "isNullPointer": false, - "$type": "double", - "value": 1.0, - "label": "Number" - } - ] - } - } - }, - { - "Id": { - "id": 58581596114596 - }, - "Name": "SC-Node(OperatorMul)", - "Components": { - "Component_[14210959117790557692]": { - "$type": "OperatorMul", - "Id": 14210959117790557692, - "Slots": [ - { - "id": { - "m_id": "{374AA17F-7CC0-4808-8269-6CC4F64579C3}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{1E111259-19D2-4180-81A1-F648F79B004D}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{E7D6A002-7522-4915-BCCB-89A29E3D5582}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "OperatorType": "Multiply", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 7 - }, - { - "m_type": 14 - }, - { - "m_type": 15 - } - ] - } - ], - "slotName": "Transform", - "toolTip": "An operand to use in performing the specified Operation", - "DisplayDataType": { - "m_type": 7 - }, - "DisplayGroup": { - "Value": 1114760223 - }, - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 - }, - { - "id": { - "m_id": "{0ABC384E-FBE6-40F8-B5C3-7652B814102C}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "OperatorType": "Multiply", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 7 - }, - { - "m_type": 14 - }, - { - "m_type": 15 - } - ] - } - ], - "slotName": "Transform", - "toolTip": "An operand to use in performing the specified Operation", - "DisplayDataType": { - "m_type": 7 - }, - "DisplayGroup": { - "Value": 1114760223 - }, - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 - }, - { - "id": { - "m_id": "{7DA1EC3E-277C-4DDA-94FD-EF2EC66CD272}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "OperatorType": "Multiply", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 7 - }, - { - "m_type": 14 - }, - { - "m_type": 15 - } - ] - } - ], - "slotName": "Result", - "toolTip": "The result of the specified operation", - "DisplayDataType": { - "m_type": 7 - }, - "DisplayGroup": { - "Value": 1114760223 - }, - "Descriptor": { - "ConnectionType": 2, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 - } - ], - "Datums": [ - { - "scriptCanvasType": { - "m_type": 7 - }, - "isNullPointer": false, - "$type": "Transform", - "value": { - "Translation": [ - 0.0, - 0.0, - 0.0 - ], - "Rotation": [ - 0.0, - 0.0, - 0.0, - 1.0 - ], - "Scale": 1.0 - }, - "label": "Transform" - }, - { - "scriptCanvasType": { - "m_type": 7 - }, - "isNullPointer": false, - "$type": "Transform", - "value": { - "Translation": [ - 0.0, - 0.0, - 0.0 - ], - "Rotation": [ - 0.0, - 0.0, - 0.0, - 1.0 - ], - "Scale": 1.0 - }, - "label": "Transform" - } - ] - } - } - }, - { - "Id": { - "id": 213241219492499 - }, - "Name": "SC-Node(OperatorAdd)", - "Components": { - "Component_[14948826965328970882]": { - "$type": "OperatorAdd", - "Id": 14948826965328970882, - "Slots": [ - { - "id": { - "m_id": "{56805D2B-0C98-4145-80FB-AA1DCB16CF1A}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{008FCEC7-3E86-4249-A736-F158EFDB0EFA}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{DB849F77-66D0-4D64-A45F-122F93E1E80C}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 8 - }, - { - "m_type": 9 - }, - { - "m_type": 10 - }, - { - "m_type": 11 - }, - { - "m_type": 12 - }, - { - "m_type": 14 - }, - { - "m_type": 15 - } - ] - } - ], - "slotName": "Number", - "toolTip": "An operand to use in performing the specified Operation", - "DisplayDataType": { - "m_type": 3 - }, - "DisplayGroup": { - "Value": 1114760223 - }, - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 - }, - { - "id": { - "m_id": "{CA8ABF3F-BF80-4A8B-A2B2-A1D2C16278C1}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 8 - }, - { - "m_type": 9 + "m_type": 9 }, { "m_type": 10 @@ -1439,8 +1082,8 @@ ] } ], - "slotName": "Number", - "toolTip": "An operand to use in performing the specified Operation", + "slotName": "Result", + "toolTip": "The result of the specified operation", "DisplayDataType": { "m_type": 3 }, @@ -1448,7 +1091,7 @@ "Value": 1114760223 }, "Descriptor": { - "ConnectionType": 1, + "ConnectionType": 2, "SlotType": 2 }, "DynamicGroup": { @@ -1458,7 +1101,7 @@ }, { "id": { - "m_id": "{53895246-F759-4328-AABB-D26E49E5208D}" + "m_id": "{095D00D3-962F-47DD-8400-F025C008E579}" }, "DynamicTypeOverride": 3, "contracts": [ @@ -1498,8 +1141,8 @@ ] } ], - "slotName": "Result", - "toolTip": "The result of the specified operation", + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", "DisplayDataType": { "m_type": 3 }, @@ -1507,7 +1150,7 @@ "Value": 1114760223 }, "Descriptor": { - "ConnectionType": 2, + "ConnectionType": 1, "SlotType": 2 }, "DynamicGroup": { @@ -1534,6 +1177,16 @@ "$type": "double", "value": 0.0, "label": "Number" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" } ] } @@ -1582,296 +1235,86 @@ "DataType": 1 }, { - "id": { - "m_id": "{6BB59597-64B4-458F-9C96-B3E0DA73279A}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{44A7845D-724A-4BB6-99F1-12B2E7979D93}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - } - ], - "Datums": [ - { - "scriptCanvasType": { - "m_type": 1 - }, - "isNullPointer": false, - "$type": "EntityId", - "value": { - "id": 2901262558 - }, - "label": "Transform" - }, - { - "scriptCanvasType": { - "m_type": 7 - }, - "isNullPointer": false, - "$type": "Transform", - "value": { - "Translation": [ - 0.0, - 0.0, - 0.0 - ], - "Rotation": [ - 0.0, - 0.0, - 0.0, - 1.0 - ], - "Scale": 1.0 - }, - "label": "Transform: 1" - } - ], - "methodType": 0, - "methodName": "SetWorldTM", - "className": "TransformBus", - "resultSlotIDs": [ - {} - ], - "inputSlots": [ - { - "m_id": "{785CBBEE-E704-4049-A180-8E99E3E1E1F2}" - }, - { - "m_id": "{A7826FF9-C3B2-4E28-815D-9B07A6EE0949}" - } - ], - "prettyClassName": "TransformBus" - } - } - }, - { - "Id": { - "id": 239870016727699 - }, - "Name": "SC-Node(OperatorMul)", - "Components": { - "Component_[3092852928531574536]": { - "$type": "OperatorMul", - "Id": 3092852928531574536, - "Slots": [ - { - "id": { - "m_id": "{FEFF67A1-C89B-447E-80D4-CD94CB0C8AD7}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{7E5D8673-F03A-4134-87DE-88AD13A74C29}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{8A243C9C-0D69-4753-B28B-A8D2FAC5D508}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "OperatorType": "Multiply", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 7 - }, - { - "m_type": 14 - }, - { - "m_type": 15 - } - ] - } - ], - "slotName": "Number", - "toolTip": "An operand to use in performing the specified Operation", - "DisplayDataType": { - "m_type": 3 - }, - "DisplayGroup": { - "Value": 1114760223 - }, - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 - }, - { - "id": { - "m_id": "{3F3F3DD6-124E-48A8-8373-6666900D8177}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "OperatorType": "Multiply", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 7 - }, - { - "m_type": 14 - }, - { - "m_type": 15 - } - ] - } - ], - "slotName": "Number", - "toolTip": "An operand to use in performing the specified Operation", - "DisplayDataType": { - "m_type": 3 - }, - "DisplayGroup": { - "Value": 1114760223 - }, - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 - }, - { - "id": { - "m_id": "{DFD1DE7E-B470-43F6-A6CF-E9E572D0C075}" - }, - "DynamicTypeOverride": 3, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "MathOperatorContract", - "OperatorType": "Multiply", - "NativeTypes": [ - { - "m_type": 3 - }, - { - "m_type": 6 - }, - { - "m_type": 7 - }, - { - "m_type": 14 - }, - { - "m_type": 15 - } - ] + "id": { + "m_id": "{6BB59597-64B4-458F-9C96-B3E0DA73279A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" } ], - "slotName": "Result", - "toolTip": "The result of the specified operation", - "DisplayDataType": { - "m_type": 3 - }, - "DisplayGroup": { - "Value": 1114760223 + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{44A7845D-724A-4BB6-99F1-12B2E7979D93}" }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", "Descriptor": { "ConnectionType": 2, - "SlotType": 2 - }, - "DynamicGroup": { - "Value": 1114760223 - }, - "DataType": 1 + "SlotType": 1 + } } ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { - "m_type": 3 + "m_type": 1 }, "isNullPointer": false, - "$type": "double", - "value": 1.0, - "label": "Number" + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Transform" }, { - "isOverloadedStorage": false, "scriptCanvasType": { - "m_type": 3 + "m_type": 7 }, "isNullPointer": false, - "$type": "double", - "value": 10.0, - "label": "Number" + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform: 1" } - ] + ], + "methodType": 0, + "methodName": "SetWorldTM", + "className": "TransformBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{785CBBEE-E704-4049-A180-8E99E3E1E1F2}" + }, + { + "m_id": "{A7826FF9-C3B2-4E28-815D-9B07A6EE0949}" + } + ], + "prettyClassName": "TransformBus" } } }, @@ -2227,33 +1670,243 @@ "$type": "SlotTypeContract" } ], - "slotName": "Result: Transform", + "slotName": "Result: Transform", + "DisplayDataType": { + "m_type": 7 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Vector3: Translation" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 34623617265138 + }, + "Name": "SC-Node(OperatorMul)", + "Components": { + "Component_[6682944070117268251]": { + "$type": "OperatorMul", + "Id": 6682944070117268251, + "Slots": [ + { + "id": { + "m_id": "{E55CADF9-9769-43D3-B6BD-8EFA828C5B7B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{00F5960A-A85F-4B88-A562-BB6E7BFCE05E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FB35B335-EA81-45FF-A0BA-CED33329EB93}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{85824692-0B8B-4400-87BC-9D8CA6127A88}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{84852FBC-F135-48B2-B5C8-AFF3B1F35E42}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", "DisplayDataType": { - "m_type": 7 + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 }, "Descriptor": { "ConnectionType": 2, "SlotType": 2 }, + "DynamicGroup": { + "Value": 1114760223 + }, "DataType": 1 } ], "Datums": [ { + "isOverloadedStorage": false, "scriptCanvasType": { - "m_type": 8 + "m_type": 3 }, "isNullPointer": false, - "$type": "Vector3", - "value": [ - 0.0, - 0.0, - 0.0 - ], - "label": "Vector3: Translation" + "$type": "double", + "value": 1.0, + "label": "Number" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 12.5, + "label": "Number" } - ], - "Initialized": true + ] } } }, @@ -2361,77 +2014,6 @@ } } }, - { - "Id": { - "id": 58594481016484 - }, - "Name": "SC Node(GetVariable)", - "Components": { - "Component_[8136131668650391163]": { - "$type": "GetVariableNode", - "Id": 8136131668650391163, - "Slots": [ - { - "id": { - "m_id": "{09256706-E7A2-47C3-ACE0-3BE7D80E34FD}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{1ACC7F53-E81A-4721-9AC8-5C1A33C8BE96}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{4972DD3B-D554-47B7-816B-CBCF67697ABA}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Number", - "DisplayDataType": { - "m_type": 3 - }, - "Descriptor": { - "ConnectionType": 2, - "SlotType": 2 - }, - "DataType": 1 - } - ], - "m_variableId": { - "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" - }, - "m_variableDataOutSlotId": { - "m_id": "{4972DD3B-D554-47B7-816B-CBCF67697ABA}" - } - } - } - }, { "Id": { "id": 58658905525924 @@ -2668,62 +2250,6 @@ } ], "m_connections": [ - { - "Id": { - "id": 58706150166180 - }, - "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(RotationZDegrees: In)", - "Components": { - "Component_[553961487450147653]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 553961487450147653, - "sourceEndpoint": { - "nodeId": { - "id": 58594481016484 - }, - "slotId": { - "m_id": "{1ACC7F53-E81A-4721-9AC8-5C1A33C8BE96}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 58590186049188 - }, - "slotId": { - "m_id": "{4B28D8A2-7F6C-4EB1-A7D5-EA68FB783B52}" - } - } - } - } - }, - { - "Id": { - "id": 58710445133476 - }, - "Name": "srcEndpoint=(Get Variable: Number), destEndpoint=(RotationZDegrees: Number: Degrees)", - "Components": { - "Component_[8946072267986857913]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 8946072267986857913, - "sourceEndpoint": { - "nodeId": { - "id": 58594481016484 - }, - "slotId": { - "m_id": "{4972DD3B-D554-47B7-816B-CBCF67697ABA}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 58590186049188 - }, - "slotId": { - "m_id": "{694A218A-8047-4981-BF62-726AF9BCB3C6}" - } - } - } - } - }, { "Id": { "id": 58714740100772 @@ -2883,122 +2409,10 @@ }, "targetEndpoint": { "nodeId": { - "id": 58581596114596 - }, - "slotId": { - "m_id": "{374AA17F-7CC0-4808-8269-6CC4F64579C3}" - } - } - } - } - }, - { - "Id": { - "id": 58740509904548 - }, - "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Multiply (*): Transform)", - "Components": { - "Component_[7007808555566524915]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 7007808555566524915, - "sourceEndpoint": { - "nodeId": { - "id": 58624545787556 - }, - "slotId": { - "m_id": "{96271AD4-A2BB-4597-B78F-8053F0200C3D}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 58581596114596 - }, - "slotId": { - "m_id": "{E7D6A002-7522-4915-BCCB-89A29E3D5582}" - } - } - } - } - }, - { - "Id": { - "id": 58753394806436 - }, - "Name": "srcEndpoint=(TickBus Handler: Number), destEndpoint=(Multiply (*): Value)", - "Components": { - "Component_[1087668963814879388]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 1087668963814879388, - "sourceEndpoint": { - "nodeId": { - "id": 58667495460516 - }, - "slotId": { - "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 58577301147300 - }, - "slotId": { - "m_id": "{67B729E8-73F9-4B97-A67C-C986E874BD01}" - } - } - } - } - }, - { - "Id": { - "id": 58783459577508 - }, - "Name": "srcEndpoint=(Set Variable: Out), destEndpoint=(Get Variable: In)", - "Components": { - "Component_[5808096905671825435]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 5808096905671825435, - "sourceEndpoint": { - "nodeId": { - "id": 58654610558628 - }, - "slotId": { - "m_id": "{47175A2C-5EE4-4C48-8CC1-8F2C84D36FE5}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 58594481016484 - }, - "slotId": { - "m_id": "{09256706-E7A2-47C3-ACE0-3BE7D80E34FD}" - } - } - } - } - }, - { - "Id": { - "id": 58787754544804 - }, - "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Multiply (*): Value)", - "Components": { - "Component_[11775794502882233004]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 11775794502882233004, - "sourceEndpoint": { - "nodeId": { - "id": 58577301147300 - }, - "slotId": { - "m_id": "{785A9BC8-8F65-4DFE-8809-7C8E937A8D8B}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 58633135722148 + "id": 58581596114596 }, "slotId": { - "m_id": "{F9E6233F-EAFB-43F5-A10D-96A3A41763A7}" + "m_id": "{374AA17F-7CC0-4808-8269-6CC4F64579C3}" } } } @@ -3006,27 +2420,27 @@ }, { "Id": { - "id": 58792049512100 + "id": 58740509904548 }, - "Name": "srcEndpoint=(Multiply (*): Out), destEndpoint=(Multiply (*): In)", + "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Multiply (*): Transform)", "Components": { - "Component_[80299809090156725]": { + "Component_[7007808555566524915]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 80299809090156725, + "Id": 7007808555566524915, "sourceEndpoint": { "nodeId": { - "id": 58577301147300 + "id": 58624545787556 }, "slotId": { - "m_id": "{4CD5D25E-73DA-4936-89E9-8F0A7946DED1}" + "m_id": "{96271AD4-A2BB-4597-B78F-8053F0200C3D}" } }, "targetEndpoint": { "nodeId": { - "id": 58633135722148 + "id": 58581596114596 }, "slotId": { - "m_id": "{B6D38C30-7BB4-4549-AFFA-C5A52AE9796E}" + "m_id": "{E7D6A002-7522-4915-BCCB-89A29E3D5582}" } } } @@ -3284,34 +2698,6 @@ } } }, - { - "Id": { - "id": 164626484669075 - }, - "Name": "srcEndpoint=(: ), destEndpoint=(: )", - "Components": { - "Component_[14524450253664706586]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 14524450253664706586, - "sourceEndpoint": { - "nodeId": { - "id": 58667495460516 - }, - "slotId": { - "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 58577301147300 - }, - "slotId": { - "m_id": "{F5BE2CBC-3CA3-44BD-B7D4-71D9CAC023B3}" - } - } - } - } - }, { "Id": { "id": 214778817784467 @@ -3426,27 +2812,27 @@ }, { "Id": { - "id": 240698945415827 + "id": 71140482223643 }, - "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(Multiply (*): In)", + "Name": "srcEndpoint=(Set Variable: Out), destEndpoint=(RotationZDegrees: In)", "Components": { - "Component_[12012899230680400379]": { + "Component_[11167812872648006272]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 12012899230680400379, + "Id": 11167812872648006272, "sourceEndpoint": { "nodeId": { - "id": 214400860662419 + "id": 58654610558628 }, "slotId": { - "m_id": "{8C8D3DD7-F821-42F4-AF51-5D976133DAE4}" + "m_id": "{47175A2C-5EE4-4C48-8CC1-8F2C84D36FE5}" } }, "targetEndpoint": { "nodeId": { - "id": 239870016727699 + "id": 58590186049188 }, "slotId": { - "m_id": "{FEFF67A1-C89B-447E-80D4-CD94CB0C8AD7}" + "m_id": "{4B28D8A2-7F6C-4EB1-A7D5-EA68FB783B52}" } } } @@ -3454,27 +2840,55 @@ }, { "Id": { - "id": 241158506916499 + "id": 71557094051355 }, - "Name": "srcEndpoint=(TickBus Handler: Number), destEndpoint=(Multiply (*): Value)", + "Name": "srcEndpoint=(Set Variable: Number), destEndpoint=(RotationZDegrees: Number: Degrees)", "Components": { - "Component_[6729356013537587652]": { + "Component_[13278183946958091954]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6729356013537587652, + "Id": 13278183946958091954, "sourceEndpoint": { "nodeId": { - "id": 58667495460516 + "id": 58654610558628 }, "slotId": { - "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + "m_id": "{1B58C71B-3AB9-4D90-A8D5-164A20B083DA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58590186049188 + }, + "slotId": { + "m_id": "{694A218A-8047-4981-BF62-726AF9BCB3C6}" + } + } + } + } + }, + { + "Id": { + "id": 35443956018674 + }, + "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(Multiply (*): In)", + "Components": { + "Component_[1036318540886899366]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1036318540886899366, + "sourceEndpoint": { + "nodeId": { + "id": 214400860662419 + }, + "slotId": { + "m_id": "{8C8D3DD7-F821-42F4-AF51-5D976133DAE4}" } }, "targetEndpoint": { "nodeId": { - "id": 239870016727699 + "id": 34623617265138 }, "slotId": { - "m_id": "{8A243C9C-0D69-4753-B28B-A8D2FAC5D508}" + "m_id": "{E55CADF9-9769-43D3-B6BD-8EFA828C5B7B}" } } } @@ -3482,19 +2896,19 @@ }, { "Id": { - "id": 241845701683859 + "id": 36113970916850 }, "Name": "srcEndpoint=(Multiply (*): Out), destEndpoint=(Add (+): In)", "Components": { - "Component_[1977054835666987502]": { + "Component_[14283307370513044941]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 1977054835666987502, + "Id": 14283307370513044941, "sourceEndpoint": { "nodeId": { - "id": 239870016727699 + "id": 34623617265138 }, "slotId": { - "m_id": "{7E5D8673-F03A-4134-87DE-88AD13A74C29}" + "m_id": "{00F5960A-A85F-4B88-A562-BB6E7BFCE05E}" } }, "targetEndpoint": { @@ -3510,19 +2924,19 @@ }, { "Id": { - "id": 242150644361875 + "id": 36401733725682 }, "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Add (+): Number)", "Components": { - "Component_[4687422202712804034]": { + "Component_[5424678033357045019]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 4687422202712804034, + "Id": 5424678033357045019, "sourceEndpoint": { "nodeId": { - "id": 239870016727699 + "id": 34623617265138 }, "slotId": { - "m_id": "{DFD1DE7E-B470-43F6-A6CF-E9E572D0C075}" + "m_id": "{84852FBC-F135-48B2-B5C8-AFF3B1F35E42}" } }, "targetEndpoint": { @@ -3535,6 +2949,34 @@ } } } + }, + { + "Id": { + "id": 37033093918194 + }, + "Name": "srcEndpoint=(TickBus Handler: Number), destEndpoint=(Multiply (*): Number)", + "Components": { + "Component_[7944449722082928320]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7944449722082928320, + "sourceEndpoint": { + "nodeId": { + "id": 58667495460516 + }, + "slotId": { + "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 34623617265138 + }, + "slotId": { + "m_id": "{FB35B335-EA81-45FF-A0BA-CED33329EB93}" + } + } + } + } } ] }, @@ -3548,7 +2990,7 @@ "GraphCanvasData": [ { "Key": { - "id": 58577301147300 + "id": 34623617265138 }, "Value": { "ComponentData": { @@ -3562,8 +3004,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -40.0, - 180.0 + 440.0, + 300.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -3571,7 +3013,7 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{EB1D5C50-BE43-4D5B-95CA-72BB2444355C}" + "PersistentId": "{D071B475-12EA-47E9-9D36-3FF719DFDF55}" } } } @@ -3636,37 +3078,6 @@ } } }, - { - "Key": { - "id": 58594481016484 - }, - "Value": { - "ComponentData": { - "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { - "$type": "NodeSaveData" - }, - "{328FF15C-C302-458F-A43D-E1794DE0904E}": { - "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "GetVariableNodeTitlePalette" - }, - "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { - "$type": "GeometrySaveData", - "Position": [ - 1820.0, - 160.0 - ] - }, - "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".getVariable" - }, - "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { - "$type": "PersistentIdComponentSaveData", - "PersistentId": "{4F7B87C1-4C5D-4B00-87F1-E742C7F9B0BB}" - } - } - } - }, { "Key": { "id": 58607365918372 @@ -3758,36 +3169,6 @@ } } }, - { - "Key": { - "id": 58633135722148 - }, - "Value": { - "ComponentData": { - "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { - "$type": "NodeSaveData" - }, - "{328FF15C-C302-458F-A43D-E1794DE0904E}": { - "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MathNodeTitlePalette" - }, - "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { - "$type": "GeometrySaveData", - "Position": [ - 300.0, - 180.0 - ] - }, - "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" - }, - "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { - "$type": "PersistentIdComponentSaveData", - "PersistentId": "{3B2FC30A-C96E-4D45-8FB8-D93213E40656}" - } - } - } - }, { "Key": { "id": 58654610558628 @@ -3804,8 +3185,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1300.0, - 480.0 + 1120.0, + 160.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -3892,8 +3273,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -480.0, - 500.0 + -420.0, + 180.0 ] }, "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { @@ -3990,8 +3371,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 940.0, - 520.0 + 800.0, + 160.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -4020,8 +3401,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 100.0, - 540.0 + 60.0, + 160.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -4037,46 +3418,15 @@ }, { "Key": { - "id": 239870016727699 - }, - "Value": { - "ComponentData": { - "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { - "$type": "NodeSaveData" - }, - "{328FF15C-C302-458F-A43D-E1794DE0904E}": { - "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MathNodeTitlePalette" - }, - "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { - "$type": "GeometrySaveData", - "Position": [ - 480.0, - 700.0 - ] - }, - "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" - }, - "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { - "$type": "PersistentIdComponentSaveData", - "PersistentId": "{591ECD3E-51E5-4452-B8F0-91EEC22334EC}" - } - } - } - }, - { - "Key": { - "id": 1874297699023155003 + "id": 8461866310375259320 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.6141249999999999, - "AnchorX": -615.5098876953125, - "AnchorY": -29.309993743896484 + "AnchorX": -166.0, + "AnchorY": 51.0 } } } @@ -4095,11 +3445,11 @@ }, { "Key": 11545666372999204726, - "Value": 2 + "Value": 1 }, { "Key": 12702286953450386850, - "Value": 6 + "Value": 4 }, { "Key": 12777283451032324504, @@ -4151,103 +3501,9 @@ }, "VariableName": "RotateCamZ" } - }, - { - "Key": { - "m_id": "{6A2D4F20-5402-4283-8799-EB8DEABD6369}" - }, - "Value": { - "Datum": { - "scriptCanvasType": { - "m_type": 3 - }, - "isNullPointer": false, - "$type": "double", - "value": 0.1 - }, - "VariableId": { - "m_id": "{6A2D4F20-5402-4283-8799-EB8DEABD6369}" - }, - "VariableName": "JoystickDeadzone" - } - }, - { - "Key": { - "m_id": "{7062B1EE-2A8A-4E1D-8275-9DA1C5927FF0}" - }, - "Value": { - "Datum": { - "scriptCanvasType": { - "m_type": 3 - }, - "isNullPointer": false, - "$type": "double", - "value": 0.0 - }, - "VariableId": { - "m_id": "{7062B1EE-2A8A-4E1D-8275-9DA1C5927FF0}" - }, - "VariableName": "JoystickRight_X" - } - }, - { - "Key": { - "m_id": "{8E040B94-3374-4228-8020-577BB7C70EE7}" - }, - "Value": { - "Datum": { - "scriptCanvasType": { - "m_type": 3 - }, - "isNullPointer": false, - "$type": "double", - "value": 0.0 - }, - "VariableId": { - "m_id": "{8E040B94-3374-4228-8020-577BB7C70EE7}" - }, - "VariableName": "MoveX" - } - }, - { - "Key": { - "m_id": "{BF2919BD-19B4-4738-AC3A-81857D5204E4}" - }, - "Value": { - "Datum": { - "scriptCanvasType": { - "m_type": 3 - }, - "isNullPointer": false, - "$type": "double", - "value": 0.0 - }, - "VariableId": { - "m_id": "{BF2919BD-19B4-4738-AC3A-81857D5204E4}" - }, - "VariableName": "MoveY" - } } ] - }, - "CopiedVariableRemapping": [ - { - "Key": { - "m_id": "{5EB17E58-0B4E-451D-A1CE-0E7C272CBDEC}" - }, - "Value": { - "m_id": "{BF2919BD-19B4-4738-AC3A-81857D5204E4}" - } - }, - { - "Key": { - "m_id": "{B48E5726-A7FF-42A8-84D2-CF43ABBD1EDC}" - }, - "Value": { - "m_id": "{8E040B94-3374-4228-8020-577BB7C70EE7}" - } - } - ] + } } } } diff --git a/Gems/MotionMatching/Assets/MotionMatching.animgraph b/Gems/MotionMatching/Assets/MotionMatching.animgraph deleted file mode 100644 index e5656a3d05..0000000000 --- a/Gems/MotionMatching/Assets/MotionMatching.animgraph +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f974fa29f3542311ee6a4b6fbb92047186c3124b3bd6f88b728646bf9d686c45 -size 39099 diff --git a/Gems/MotionMatching/Code/CMakeLists.txt b/Gems/MotionMatching/Code/CMakeLists.txt index 275f8f2530..ae613f5d7f 100644 --- a/Gems/MotionMatching/Code/CMakeLists.txt +++ b/Gems/MotionMatching/Code/CMakeLists.txt @@ -99,57 +99,49 @@ endif() ################################################################################ # See if globally, tests are supported if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - # We globally support tests, see if we support tests on this platform for MotionMatching.Static - if(PAL_TRAIT_MOTIONMATCHING_TEST_SUPPORTED) - # We support MotionMatching.Tests on this platform, add MotionMatching.Tests target which depends on MotionMatching.Static - ly_add_target( - NAME MotionMatching.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - motionmatching_files.cmake - motionmatching_tests_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Tests - Source - BUILD_DEPENDENCIES - PRIVATE - AZ::AzTest - AZ::AzFramework - Gem::EMotionFX.Tests.Static - Gem::MotionMatching.Static - ) + ly_add_target( + NAME MotionMatching.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + motionmatching_files.cmake + motionmatching_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Tests + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzFramework + Gem::EMotionFX.Tests.Static + Gem::MotionMatching.Static + ) - # Add MotionMatching.Tests to googletest - ly_add_googletest( - NAME Gem::MotionMatching.Tests - ) - endif() + # Add MotionMatching.Tests to googletest + ly_add_googletest( + NAME Gem::MotionMatching.Tests + ) +endif() - # If we are a host platform we want to add tools test like editor tests here - if(PAL_TRAIT_BUILD_HOST_TOOLS) - # We are a host platform, see if Editor tests are supported on this platform - if(PAL_TRAIT_MOTIONMATCHING_EDITOR_TEST_SUPPORTED) - # We support MotionMatching.Editor.Tests on this platform, add MotionMatching.Editor.Tests target which depends on MotionMatching.Editor - ly_add_target( - NAME MotionMatching.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - motionmatching_editor_tests_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Tests - Source - BUILD_DEPENDENCIES - PRIVATE - AZ::AzTest - Gem::MotionMatching.Editor - ) +# If we are a host platform we want to add tools test like editor tests here +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME MotionMatching.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + motionmatching_editor_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Tests + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + Gem::MotionMatching.Editor + ) - # Add MotionMatching.Editor.Tests to googletest - ly_add_googletest( - NAME Gem::MotionMatching.Editor.Tests - ) - endif() - endif() + # Add MotionMatching.Editor.Tests to googletest + ly_add_googletest( + NAME Gem::MotionMatching.Editor.Tests + ) endif() diff --git a/Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h b/Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h index 5b2bc1847a..dbf38e802b 100644 --- a/Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h +++ b/Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h @@ -11,8 +11,20 @@ #include #include +#include + namespace EMotionFX::MotionMatching { + class DebugDrawRequests + : public AZ::EBusTraits + { + public: + AZ_RTTI(DebugDrawRequests, "{7BBA4249-EC00-445C-8A0C-4472841049C3}"); + + virtual void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay) = 0; + }; + using DebugDrawRequestBus = AZ::EBus; + class MotionMatchingRequests { public: diff --git a/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp b/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp index 6661233b66..1546be4669 100644 --- a/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp +++ b/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp @@ -297,8 +297,6 @@ namespace EMotionFX::MotionMatching ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushPerformanceHistogramValue, "Output", m_outputTimeInMs); #endif } - - instance->DebugDraw(); } AZ::Crc32 BlendTreeMotionMatchNode::GetTrajectoryPathSettingsVisibility() const diff --git a/Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp b/Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp index 97b666c693..158a4b0d23 100644 --- a/Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp +++ b/Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp @@ -16,10 +16,11 @@ namespace EMotionFX::MotionMatching ImGuiMonitor::ImGuiMonitor() { - m_performanceStats.m_name = "Performance Statistics"; + m_performanceStats.SetName("Performance Statistics"); + m_performanceStats.SetHistogramBinCount(500); - m_featureCosts.m_name = "Feature Costs"; - m_featureCosts.m_histogramContainerCount = 100; + m_featureCosts.SetName("Feature Costs"); + m_featureCosts.SetHistogramBinCount(100); ImGui::ImGuiUpdateListenerBus::Handler::BusConnect(); ImGuiMonitorRequestBus::Handler::BusConnect(); @@ -40,18 +41,40 @@ namespace EMotionFX::MotionMatching if (ImGui::Begin("Motion Matching")) { + if (ImGui::CollapsingHeader("Motion Database", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + if (ImGui::BeginTable("MDB", 2)) + { + ImGui::TableNextColumn(); ImGui::Text("Memory Usage: %.2f MB", m_frameDatabaseInfo.m_memoryUsedInBytes / 1024.0f / 1024.0f); + ImGui::TableNextColumn(); ImGui::Text("Motion Data: %.0f minutes", m_frameDatabaseInfo.m_motionDataInSeconds / 60.0f); + ImGui::TableNextColumn(); ImGui::Text("Num Frames: %zu", m_frameDatabaseInfo.m_numFrames); + ImGui::TableNextColumn(); ImGui::Text("Num Motions: %zu", m_frameDatabaseInfo.m_numMotions); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Feature Matrix", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) { - ImGui::Text("Memory Usage: %.2f MB", m_featureMatrixMemoryUsageInBytes / 1024.0f / 1024.0f); - ImGui::Text("Num Frames: %zu", m_featureMatrixNumFrames); - ImGui::Text("Num Feature Components: %zu", m_featureMatrixNumComponents); + if (ImGui::BeginTable("FM", 2)) + { + ImGui::TableNextColumn(); ImGui::Text("Memory Usage: %.2f MB", m_featurMatrixInfo.m_memoryUsedInBytes / 1024.0f / 1024.0f); + ImGui::TableNextColumn(); + ImGui::TableNextColumn(); ImGui::Text("Num Frames: %zu", m_featurMatrixInfo.m_numFrames); + ImGui::TableNextColumn(); ImGui::Text("Num Feature Components: %zu", m_featurMatrixInfo.m_numDimensions); + ImGui::EndTable(); + } } if (ImGui::CollapsingHeader("Kd-Tree", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) { - ImGui::Text("Memory Usage: %.2f MB", m_kdTreeMemoryUsageInBytes / 1024.0f / 1024.0f); - ImGui::Text("Num Nodes: %zu", m_kdTreeNumNodes); - ImGui::Text("Num Dimensions: %zu", m_kdTreeNumDimensions); + if (ImGui::BeginTable("KDT", 2)) + { + ImGui::TableNextColumn(); ImGui::Text("Memory Usage: %.2f MB", m_kdTreeInfo.m_memoryUsedInBytes / 1024.0f / 1024.0f); + ImGui::TableNextColumn(); + ImGui::TableNextColumn(); ImGui::Text("Num Nodes: %zu", m_kdTreeInfo.m_numNodes); + ImGui::TableNextColumn(); ImGui::Text("Num Dimensions: %zu", m_kdTreeInfo.m_numDimensions); + ImGui::EndTable(); + } } m_performanceStats.OnImGuiUpdate(); @@ -63,8 +86,8 @@ namespace EMotionFX::MotionMatching { if (ImGui::BeginMenu("Motion Matching")) { - ImGui::MenuItem(m_performanceStats.m_name.c_str(), "", &m_performanceStats.m_show); - ImGui::MenuItem(m_featureCosts.m_name.c_str(), "", &m_featureCosts.m_show); + ImGui::MenuItem(m_performanceStats.GetName(), "", &m_performanceStats.m_show); + ImGui::MenuItem(m_featureCosts.GetName(), "", &m_featureCosts.m_show); ImGui::EndMenu(); } } @@ -78,67 +101,6 @@ namespace EMotionFX::MotionMatching { m_featureCosts.PushHistogramValue(costName, value, color); } - - void ImGuiMonitor::HistogramGroup::PushHistogramValue(const char* valueName, float value, const AZ::Color& color) - { - auto iterator = m_histogramIndexByName.find(valueName); - if (iterator != m_histogramIndexByName.end()) - { - ImGui::LYImGuiUtils::HistogramContainer& histogramContiner = m_histograms[iterator->second]; - histogramContiner.PushValue(value); - histogramContiner.SetBarLineColor(ImColor(color.GetR(), color.GetG(), color.GetB(), color.GetA())); - } - else - { - ImGui::LYImGuiUtils::HistogramContainer newHistogram; - newHistogram.Init(/*histogramName=*/valueName, - /*containerCount=*/m_histogramContainerCount, - /*viewType=*/ImGui::LYImGuiUtils::HistogramContainer::ViewType::Histogram, - /*displayOverlays=*/true, - /*min=*/0.0f, - /*max=*/0.0f); - - newHistogram.SetMoveDirection(ImGui::LYImGuiUtils::HistogramContainer::PushRightMoveLeft); - newHistogram.PushValue(value); - - m_histogramIndexByName[valueName] = m_histograms.size(); - m_histograms.push_back(newHistogram); - } - } - - void ImGuiMonitor::HistogramGroup::OnImGuiUpdate() - { - if (!m_show) - { - return; - } - - if (ImGui::CollapsingHeader(m_name.c_str(), ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) - { - for (auto& histogram : m_histograms) - { - ImGui::BeginGroup(); - { - histogram.Draw(ImGui::GetColumnWidth() - 70, s_histogramHeight); - - ImGui::SameLine(); - - ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0,0,0,255)); - { - const ImColor color = histogram.GetBarLineColor(); - ImGui::PushStyleColor(ImGuiCol_Button, color.Value); - { - const AZStd::string valueString = AZStd::string::format("%.2f", histogram.GetLastValue()); - ImGui::Button(valueString.c_str()); - } - ImGui::PopStyleColor(); - } - ImGui::PopStyleColor(); - } - ImGui::EndGroup(); - } - } - } } // namespace EMotionFX::MotionMatching #endif // IMGUI_ENABLED diff --git a/Gems/MotionMatching/Code/Source/ImGuiMonitor.h b/Gems/MotionMatching/Code/Source/ImGuiMonitor.h index 0583d0ba41..a2af477987 100644 --- a/Gems/MotionMatching/Code/Source/ImGuiMonitor.h +++ b/Gems/MotionMatching/Code/Source/ImGuiMonitor.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace EMotionFX::MotionMatching { @@ -43,41 +43,17 @@ namespace EMotionFX::MotionMatching void PushPerformanceHistogramValue(const char* performanceMetricName, float value) override; void PushCostHistogramValue(const char* costName, float value, const AZ::Color& color) override; - void SetFeatureMatrixMemoryUsage(size_t sizeInBytes) override { m_featureMatrixMemoryUsageInBytes = sizeInBytes; } - void SetFeatureMatrixNumFrames(size_t numFrames) override { m_featureMatrixNumFrames = numFrames; } - void SetFeatureMatrixNumComponents(size_t numFeatureComponents) override { m_featureMatrixNumComponents = numFeatureComponents; } - - void SetKdTreeMemoryUsage(size_t sizeInBytes) override { m_kdTreeMemoryUsageInBytes = sizeInBytes; } - void SetKdTreeNumNodes(size_t numNodes) override { m_kdTreeNumNodes = numNodes; } - void SetKdTreeNumDimensions(size_t numDimensions) override { m_kdTreeNumDimensions = numDimensions; } + void SetFrameDatabaseInfo(const ImGuiMonitorRequests::FrameDatabaseInfo& info) override { m_frameDatabaseInfo = info; } + void SetFeatureMatrixInfo(const ImGuiMonitorRequests::FeatureMatrixInfo& info) override { m_featurMatrixInfo = info; } + void SetKdTreeInfo(const ImGuiMonitorRequests::KdTreeInfo& info) override { m_kdTreeInfo = info; } private: - //! Named and sub-divided group containing several histograms. - struct HistogramGroup - { - void OnImGuiUpdate(); - void PushHistogramValue(const char* valueName, float value, const AZ::Color& color); - - bool m_show = true; - AZStd::string m_name; - using HistogramIndexByNames = AZStd::unordered_map; - HistogramIndexByNames m_histogramIndexByName; - AZStd::vector m_histograms; - int m_histogramContainerCount = 500; - - static constexpr float s_histogramHeight = 95.0f; - }; - - HistogramGroup m_performanceStats; - HistogramGroup m_featureCosts; - - size_t m_featureMatrixMemoryUsageInBytes = 0; - size_t m_featureMatrixNumFrames = 0; - size_t m_featureMatrixNumComponents = 0; + ImGui::LYImGuiUtils::HistogramGroup m_performanceStats; + ImGui::LYImGuiUtils::HistogramGroup m_featureCosts; - size_t m_kdTreeMemoryUsageInBytes = 0; - size_t m_kdTreeNumNodes = 0; - size_t m_kdTreeNumDimensions = 0; + ImGuiMonitorRequests::FrameDatabaseInfo m_frameDatabaseInfo; + ImGuiMonitorRequests::FeatureMatrixInfo m_featurMatrixInfo; + ImGuiMonitorRequests::KdTreeInfo m_kdTreeInfo; }; } // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h b/Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h index 7c50b317c5..faadd79681 100644 --- a/Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h +++ b/Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h @@ -25,13 +25,30 @@ namespace EMotionFX::MotionMatching virtual void PushPerformanceHistogramValue(const char* performanceMetricName, float value) = 0; virtual void PushCostHistogramValue(const char* costName, float value, const AZ::Color& color) = 0; - virtual void SetFeatureMatrixMemoryUsage(size_t sizeInBytes) = 0; - virtual void SetFeatureMatrixNumFrames(size_t numFrames) = 0; - virtual void SetFeatureMatrixNumComponents(size_t numFeatureComponents) = 0; + struct FrameDatabaseInfo + { + size_t m_memoryUsedInBytes = 0; + size_t m_numFrames; + size_t m_numMotions; + float m_motionDataInSeconds; + }; + virtual void SetFrameDatabaseInfo(const FrameDatabaseInfo& info) = 0; - virtual void SetKdTreeMemoryUsage(size_t sizeInBytes) = 0; - virtual void SetKdTreeNumNodes(size_t numNodes) = 0; - virtual void SetKdTreeNumDimensions(size_t numDimensions) = 0; + struct FeatureMatrixInfo + { + size_t m_memoryUsedInBytes = 0; + size_t m_numFrames = 0; + size_t m_numDimensions = 0; + }; + virtual void SetFeatureMatrixInfo(const FeatureMatrixInfo& info) = 0; + + struct KdTreeInfo + { + size_t m_memoryUsedInBytes = 0; + size_t m_numNodes = 0; + size_t m_numDimensions = 0; + }; + virtual void SetKdTreeInfo(const KdTreeInfo& info) = 0; }; using ImGuiMonitorRequestBus = AZ::EBus; } // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp index 54fc2918e6..36a51f2677 100644 --- a/Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp +++ b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp @@ -28,14 +28,14 @@ #include #include -#include - namespace EMotionFX::MotionMatching { AZ_CLASS_ALLOCATOR_IMPL(MotionMatchingInstance, MotionMatchAllocator, 0) MotionMatchingInstance::~MotionMatchingInstance() { + DebugDrawRequestBus::Handler::BusDisconnect(); + if (m_motionInstance) { GetMotionInstancePool().Free(m_motionInstance); @@ -58,6 +58,8 @@ namespace EMotionFX::MotionMatching AZ_Assert(settings.m_actorInstance, "The actor instance cannot be a nullptr."); AZ_Assert(settings.m_data, "The motion match data cannot be nullptr."); + DebugDrawRequestBus::Handler::BusConnect(); + // Update the cached pointer to the trajectory feature. const FeatureSchema& featureSchema = settings.m_data->GetFeatureSchema(); for (Feature* feature : featureSchema.GetFeatures()) @@ -69,29 +71,6 @@ namespace EMotionFX::MotionMatching } } - // Debug display initialization. - const auto AddDebugDisplay = [=](AZ::s32 debugDisplayId) - { - if (debugDisplayId == -1) - { - return; - } - - AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus; - AzFramework::DebugDisplayRequestBus::Bind(debugDisplayBus, debugDisplayId); - - AzFramework::DebugDisplayRequests* debugDisplay = AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); - if (debugDisplay) - { - m_debugDisplays.emplace_back(debugDisplay); - } - }; - // Draw the debug visualizations to the Animation Editor as well as the LY Editor viewport. - AZ::s32 animationEditorViewportId = -1; - EMStudio::ViewportPluginRequestBus::BroadcastResult(animationEditorViewportId, &EMStudio::ViewportPluginRequestBus::Events::GetViewportId); - AddDebugDisplay(animationEditorViewportId); - AddDebugDisplay(AzFramework::g_defaultSceneEntityDebugDisplayId); - m_actorInstance = settings.m_actorInstance; m_data = settings.m_data; if (settings.m_data->GetFrameDatabase().GetNumFrames() == 0) @@ -123,30 +102,17 @@ namespace EMotionFX::MotionMatching m_queryFeatureValues.resize(numValuesInKdTree); // Initialize the trajectory history. - size_t rootJointIndex = m_actorInstance->GetActor()->GetMotionExtractionNodeIndex(); - if (rootJointIndex == InvalidIndex32) + if (m_cachedTrajectoryFeature) { - rootJointIndex = 0; - } - m_trajectoryHistory.Init(*m_actorInstance->GetTransformData()->GetCurrentPose(), - rootJointIndex, - m_cachedTrajectoryFeature->GetFacingAxisDir(), - m_trajectorySecsToTrack); - } - - void MotionMatchingInstance::DebugDraw() - { - if (m_data && !m_debugDisplays.empty()) - { - for (AzFramework::DebugDisplayRequests* debugDisplay : m_debugDisplays) + size_t rootJointIndex = m_actorInstance->GetActor()->GetMotionExtractionNodeIndex(); + if (rootJointIndex == InvalidIndex32) { - if (debugDisplay) - { - const AZ::u32 prevState = debugDisplay->GetState(); - DebugDraw(*debugDisplay); - debugDisplay->SetState(prevState); - } + rootJointIndex = 0; } + m_trajectoryHistory.Init(*m_actorInstance->GetTransformData()->GetCurrentPose(), + rootJointIndex, + m_cachedTrajectoryFeature->GetFacingAxisDir(), + m_trajectorySecsToTrack); } } @@ -306,7 +272,7 @@ namespace EMotionFX::MotionMatching { AZ_PROFILE_SCOPE(Animation, "MotionMatchingInstance::Update"); - if (!m_data) + if (!m_data || !m_motionInstance) { return; } @@ -322,7 +288,7 @@ namespace EMotionFX::MotionMatching // Update the time. After this there is no sample for the updated time in the history as we're about to prepare this with the current update. m_trajectoryHistory.Update(timePassedInSeconds); - // Register the current actor instance position to the history data of the spline. + // Update the trajectory query control points. m_trajectoryQuery.Update(m_actorInstance, m_cachedTrajectoryFeature, m_trajectoryHistory, @@ -371,8 +337,7 @@ namespace EMotionFX::MotionMatching SamplePose(m_motionInstance->GetMotion(), m_queryPose, newMotionTime); // Copy over the motion extraction joint transform from the current pose to the newly sampled pose. - // When sampling a motion, the motion extraction joint is in animation space, while we need the query pose to be in - // world space. + // When sampling a motion, the motion extraction joint is in animation space, while we need the query pose to be in world space. // Note: This does not yet take the extraction delta from the current tick into account. if (m_actorInstance->GetActor()->GetMotionExtractionNode()) { @@ -433,16 +398,17 @@ namespace EMotionFX::MotionMatching // ImGui monitor { #ifdef IMGUI_ENABLED - const KdTree& kdTree = m_data->GetKdTree(); - ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetKdTreeMemoryUsage, kdTree.CalcMemoryUsageInBytes()); - ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetKdTreeNumNodes, kdTree.GetNumNodes()); - ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetKdTreeNumDimensions, kdTree.GetNumDimensions()); - // TODO: add memory usage for frame database + const FrameDatabase& frameDatabase = m_data->GetFrameDatabase(); + ImGuiMonitorRequests::FrameDatabaseInfo frameDatabaseInfo{frameDatabase.CalcMemoryUsageInBytes(), frameDatabase.GetNumFrames(), frameDatabase.GetNumUsedMotions(), frameDatabase.GetNumFrames() / (float)frameDatabase.GetSampleRate()}; + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFrameDatabaseInfo, frameDatabaseInfo); + const KdTree& kdTree = m_data->GetKdTree(); + ImGuiMonitorRequests::KdTreeInfo kdTreeInfo{kdTree.CalcMemoryUsageInBytes(), kdTree.GetNumNodes(), kdTree.GetNumDimensions()}; + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetKdTreeInfo, kdTreeInfo); + const FeatureMatrix& featureMatrix = m_data->GetFeatureMatrix(); - ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFeatureMatrixMemoryUsage, featureMatrix.CalcMemoryUsageInBytes()); - ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFeatureMatrixNumFrames, featureMatrix.rows()); - ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFeatureMatrixNumComponents, featureMatrix.cols()); + ImGuiMonitorRequests::FeatureMatrixInfo featureMatrixInfo{featureMatrix.CalcMemoryUsageInBytes(), static_cast(featureMatrix.rows()), static_cast(featureMatrix.cols())}; + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFeatureMatrixInfo, featureMatrixInfo); #endif } } diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingInstance.h b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.h index 49c781162d..0969763809 100644 --- a/Gems/MotionMatching/Code/Source/MotionMatchingInstance.h +++ b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.h @@ -19,6 +19,8 @@ #include #include +#include + namespace AZ { class ReflectContext; @@ -34,12 +36,17 @@ namespace EMotionFX::MotionMatching { class MotionMatchingData; + //! The instance is where everything comes together. It stores the trajectory history, the trajectory query along with the query vector, knows about the + //! last lowest cost frame frame index and stores the time of the animation that the instance is currently playing. It is responsible for motion extraction, + //! blending towards a new frame in the motion capture database in case the algorithm found a better matching frame and executes the actual search. class EMFX_API MotionMatchingInstance + : public DebugDrawRequestBus::Handler { public: AZ_RTTI(MotionMatchingInstance, "{1ED03AD8-0FB2-431B-AF01-02F7E930EB73}") AZ_CLASS_ALLOCATOR_DECL + MotionMatchingInstance() = default; virtual ~MotionMatchingInstance(); struct EMFX_API InitSettings @@ -49,8 +56,8 @@ namespace EMotionFX::MotionMatching }; void Init(const InitSettings& settings); - void DebugDraw(); - void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay); + // DebugDrawRequestBus::Handler overrides + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay) override; void Update(float timePassedInSeconds, const AZ::Vector3& targetPos, const AZ::Vector3& targetFacingDir, TrajectoryQuery::EMode mode, float pathRadius, float pathSpeed); void PostUpdate(float timeDelta); @@ -64,10 +71,8 @@ namespace EMotionFX::MotionMatching void SetLowestCostSearchFrequency(float frequency) { m_lowestCostSearchFrequency = frequency; } float GetNewMotionTime() const { return m_newMotionTime; } - /** - * Get the cached trajectory feature. - * The trajectory feature is searched in the feature schema used in the current instance at init time. - */ + //! Get the cached trajectory feature. + //! The trajectory feature is searched in the feature schema used in the current instance at init time. FeatureTrajectory* GetTrajectoryFeature() const { return m_cachedTrajectoryFeature; } const TrajectoryQuery& GetTrajectoryQuery() const { return m_trajectoryQuery; } const TrajectoryHistory& GetTrajectoryHistory() const { return m_trajectoryHistory; } @@ -90,10 +95,10 @@ namespace EMotionFX::MotionMatching Transform m_motionExtractionDelta = Transform::CreateIdentity(); /// Buffers used for the broad-phase KD-tree search. - AZStd::vector m_queryFeatureValues; /** The input query features to be compared to every entry/row in the feature matrix with the motion matching search. */ - AZStd::vector m_nearestFrames; /** Stores the nearest matching frames / search result from the KD-tree. */ + AZStd::vector m_queryFeatureValues; //< The input query features to be compared to every entry/row in the feature matrix with the motion matching search. + AZStd::vector m_nearestFrames; //< Stores the nearest matching frames / search result from the KD-tree. - FeatureTrajectory* m_cachedTrajectoryFeature = nullptr; /** Cached pointer to the trajectory feature in the feature schema. */ + FeatureTrajectory* m_cachedTrajectoryFeature = nullptr; //< Cached pointer to the trajectory feature in the feature schema. TrajectoryQuery m_trajectoryQuery; TrajectoryHistory m_trajectoryHistory; static constexpr float m_trajectorySecsToTrack = 5.0f; @@ -105,7 +110,7 @@ namespace EMotionFX::MotionMatching bool m_blending = false; float m_blendWeight = 1.0f; - float m_blendProgressTime = 0.0f; // How long are we already blending? In seconds. + float m_blendProgressTime = 0.0f; //< How long are we already blending? In seconds. /// Buffers used for FindLowestCostFrameIndex(). AZStd::vector m_tempCosts; diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp index 073362d741..9091c60c0a 100644 --- a/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp +++ b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp @@ -16,6 +16,8 @@ #include +#include + #include #include #include @@ -39,7 +41,7 @@ namespace EMotionFX::MotionMatching { ec->Class("MotionMatching", "[Description of functionality provided by this System Component]") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System")) + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System")) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ; } @@ -69,9 +71,9 @@ namespace EMotionFX::MotionMatching incompatible.push_back(AZ_CRC_CE("MotionMatchingService")); } - void MotionMatchingSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required) + void MotionMatchingSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) { - required.push_back(AZ_CRC("EMotionFXAnimationService", 0x3f8a6369)); + required.push_back(AZ_CRC_CE("EMotionFXAnimationService")); } void MotionMatchingSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent) @@ -122,7 +124,33 @@ namespace EMotionFX::MotionMatching MotionMatchingRequestBus::Handler::BusDisconnect(); } + void MotionMatchingSystemComponent::DebugDraw(AZ::s32 debugDisplayId) + { + AZ_PROFILE_SCOPE(Animation, "MotionMatchingSystemComponent::DebugDraw"); + + if (debugDisplayId == -1) + { + return; + } + + AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus; + AzFramework::DebugDisplayRequestBus::Bind(debugDisplayBus, debugDisplayId); + + AzFramework::DebugDisplayRequests* debugDisplay = AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); + if (debugDisplay) + { + const AZ::u32 prevState = debugDisplay->GetState(); + EMotionFX::MotionMatching::DebugDrawRequestBus::Broadcast(&EMotionFX::MotionMatching::DebugDrawRequests::DebugDraw, *debugDisplay); + debugDisplay->SetState(prevState); + } + } + void MotionMatchingSystemComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { + // Draw the debug visualizations to the Animation Editor as well as the LY Editor viewport. + AZ::s32 animationEditorViewportId = -1; + EMStudio::ViewportPluginRequestBus::BroadcastResult(animationEditorViewportId, &EMStudio::ViewportPluginRequestBus::Events::GetViewportId); + DebugDraw(animationEditorViewportId); + DebugDraw(AzFramework::g_defaultSceneEntityDebugDisplayId); } } // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h index 6a5b5a7b73..09d47b9dc3 100644 --- a/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h +++ b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h @@ -33,8 +33,7 @@ namespace EMotionFX::MotionMatching ~MotionMatchingSystemComponent(); protected: - //////////////////////////////////////////////////////////////////////// - // MotionMatchingRequestBus interface implementation + void DebugDraw(AZ::s32 debugDisplayId); //////////////////////////////////////////////////////////////////////// // AZ::Component interface implementation @@ -45,6 +44,10 @@ namespace EMotionFX::MotionMatching //////////////////////////////////////////////////////////////////////// // AZTickBus interface implementation + int GetTickOrder() override + { + return AZ::TICK_PRE_RENDER; + } void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; //////////////////////////////////////////////////////////////////////// };