Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
131 stars 2 forks source link

Make AnimJ support matrix types #2478

Open mpmxyz opened 2 months ago

mpmxyz commented 2 months ago

Is your feature request related to a problem? Please describe.

float2x2, double 4x4 etc. are already part of the list of supported animation data types but I can't find a way to format them so they are read from AnimJ. Whatever I do, it results in no error and an animation with 0-matrices. (similar but different to #2452)

Further checking revealed that they have not been annotated to integrate with JSON serializers/deserializers at all. (got funny infinite .Inversed recursion when testing serialization)

I noticed this because I was recording transform matrices of objects and tried to import the data as animations.

Describe the solution you'd like

Matrix types should be JSON-serializable so they can be animated as well.

Describe alternatives you've considered

The alternative is to disallow matrix types from animations and let attempting to load them fail.

Additional Context

No response

Requesters

No response

stiefeljackal commented 2 months ago

Thank you for submitting this, @mpmxyz; I have been meaning to submit this for the longest time.

In addition to what was said above, there are some possible ways of deserializing this matrix information:

All of this is currently defined for the respective matrix's constructors.