[LYN-4574] [LYN-4603] [LYN-4669] Saving motions and actors to json-based .assetinfo files in the Animation Editor fails (#1509)

* Fixes saving motions from within the Animation Editor
* Fixes saving actors from within the Animation Editor
* The motion event chunk of the .motion file format now also stores the event data as json (rather than XML) reducing motion file sizes (Example: 60KB motion went down to 49KB, containing only 4 motion events from 2 tracks).
* Fully backward compatible
* New motion meta data rule stores the event data directly rather than command strings or objects. This is the way that aligns with the Json paradigm and as side-effect bypasses the optionals that we use for the commands which fixes the issue.

* [LYN-4574] Adding new motion event meta data rule that stores the event data directly rather than via commands to align with the Json paradigm
* [LYN-4574] Preparing motion, event table and event track for Json serialization
* [LYN-4574] New chunk to store motion event data in Json format (fully backward compatible to XML)
* [LYN-4669] Json: Empty AZStd::vector<AZStd::shared_ptr<T>> serializes into 1x element with nullptr as data
* [LYN-4603] EMotion FX: Cannot save actors with physics or simulated object setup in Json format
This commit is contained in:
Benjamin Jillich
2021-06-25 02:47:09 -07:00
committed by GitHub
parent 0ad6346e8b
commit bf0816fb69
24 changed files with 372 additions and 213 deletions
@@ -483,6 +483,9 @@ namespace AZ
// tell the caller of this function to write the type id and provide a default object, if requested, for
// the specific polymorphic instance the pointer is pointing to.
const AZ::Uuid& actualClassId = rtti.GetActualUuid(object);
// Note: If it is crashing here, it might be that you're serializing a pointer and forgot to initialize it with nullptr.
// Check the elementClassData to identify the causing element.
const AZ::Uuid& actualDefaultClassId = rtti.GetActualUuid(defaultObject);
if (actualClassId != rtti.GetTypeId())