NVlabs / FPSci

Aim Training Experiments
Other
67 stars 23 forks source link

Add FPSciAnyTableReader #340

Closed bboudaoud-nv closed 2 years ago

bboudaoud-nv commented 2 years ago

This branch adds an FPSciAnyTableReader to replace the G3D AnyTableReader. This Any table reader is largely unchanged, but it supports special methods for reading arrays (of correct length) as G3D-specific types such as Vector2/Point2, Vector3/Point3, and Color3/Color4 using JSON-style formatting.

Specifically this fix is targeted at improving the ability to serialize in JSON-style arrays for these fields, making the jsonAnyOutput flag more useful (and less likely to introduce bugs).

Notably this branch does not support all G3D Any-serializable objects, and currently more elaborate types (such as CFrame and Sampler may still not serialize correctly from JSON-formatted Any). However the FPSciAnyTableReader class provides us an easy way to add support for such special cases in the future.

bboudaoud-nv commented 2 years ago

We still need to find a way to support Array<Color4> cleanly from FPSciAnyTableReader before closing this issue. In the future we should try to use Array<Type> fields over more specific, unsupported types that could duplicate this functionality.