Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended Vector2 converter to support the old Vector2D format #1396

Merged

Conversation

ergoxiv
Copy link
Collaborator

@ergoxiv ergoxiv commented Oct 28, 2024

This pull request resolves the "Fail to open file: The JSON value could not be converted to System.Numerics.Vector2" error that was reported during the first round of testing. The context of the reported error is scene files, though old exported camera files were also affected.

In #1385 I replaced the custom Anamnesis vector objects with System.Numerics variants. It turns out that the way the old 2D and 3D vector structs were serialized differed, and my implementation did not account for that difference (refer to the format difference below). As part of that pull request, I opted for a single format that is used for both 2D and 3D vectors, without realizing that although their "ToString" methods followed the format, Json serialization did not. This is what caused the issue this pull request aims to fix.

Old format:

"Pan": 
{
      "X": 0.17714392,
      "Y": -0.2959028
},

New format:

"0.17714392, -0.2959028"

@StoiaCode StoiaCode merged commit d224fbd into imchillin:master Oct 29, 2024
@ergoxiv ergoxiv deleted the hotfix/vector2-old-format-converter branch December 20, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants