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

Parsing for color and floatQ in AnimJ importing failure #3822

Open
stiefeljackal opened this issue Jan 4, 2023 · 4 comments
Open

Parsing for color and floatQ in AnimJ importing failure #3822

stiefeljackal opened this issue Jan 4, 2023 · 4 comments
Labels
Bug Something isn't working

Comments

@stiefeljackal
Copy link

Describe the bug?

Importing a track with the valueTrack value of color or floatQ will not parse the value in the keyframes items described in the JSON. Instead, the value properties are set to the default values of color and floatQ. You can specify r, g, b, and a in the object, but these will never be parsed as specified in the previous statement.

You can import the following AnimJ into Neos to reproduce:

{
  "name": "Example with floatQ and color",
  "tracks": [
    {
      "trackType": "Curve",
      "valueType": "color",
      "data": {
        "node": "C",
        "property": "FrooxEngine.PBS_Metallic.AlbedoColor",
        "keyframes": [
          {
            "time": 0,
            "value": {
              "r": -111,
              "g": 0,
              "b": -13.5,
              "a": 15
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.2,
            "value": {
              "r": -111,
              "g": 0.036,
              "b": -13.5,
              "a": 30
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.4,
            "value": {
              "r": -111,
              "g": 0.14,
              "b": -13.5,
              "a": 45
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.6,
            "value": {
              "r": -111,
              "g": 0.304,
              "b": -13.5,
              "a": 60
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.8,
            "value": {
              "r": -111,
              "g": 0.52,
              "b": -13.5,
              "a": 75
            },
            "interpolation": "Linear"
          },
          {
            "time": 1,
            "value": {
              "r": -111,
              "g": 0.781,
              "b": -13.5,
              "a": 90
            },
            "interpolation": "Linear"
          }
        ]
      }
    },
    {
      "trackType": "Curve",
      "valueType": "floatQ",
      "data": {
        "node": "D",
        "property": "Rotation",
        "keyframes": [
          {
            "time": 0,
            "value": {
              "x": -111,
              "y": 0,
              "z": -13.5,
              "w": 15
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.2,
            "value": {
              "x": -111,
              "y": 0.036,
              "z": -13.5,
              "w": 30
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.4,
            "value": {
              "x": -111,
              "y": 0.14,
              "z": -13.5,
              "w": 45
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.6,
            "value": {
              "x": -111,
              "y": 0.304,
              "z": -13.5,
              "w": 60
            },
            "interpolation": "Linear"
          },
          {
            "time": 0.8,
            "value": {
              "x": -111,
              "y": 0.52,
              "z": -13.5,
              "w": 75
            },
            "interpolation": "Linear"
          },
          {
            "time": 1,
            "value": {
              "x": -111,
              "y": 0.781,
              "z": -13.5,
              "w": 90
            },
            "interpolation": "Linear"
          }
        ]
      }
    }
  ]
}

Relevant issues

#3726 is another AnimJ bug, but does not directly affect this issue.

To Reproduce

  1. Import the .animj file by dragging the file into Neos. An Inspector panel should open.
  2. Add the Animator component (Rendering > Animator).
  3. Drag StaticAnimationProvider into the Animator's Clip field
  4. Under the Animator component, click the Add button two times to have two empty (null) entries.
  5. Add ValueField<floatQ> and ValueField<color> (Data > ValueField)
  6. Drag ValueField<floatQ>'s value into the first empty entry in the Animator component.
  7. Drag ValueField<color>'s value into the second empty entry in the Animator component.
  8. Under the Animator component, press the play button. The Value properties will not update; they will only have the default values for float4 and color.

Expected behavior

The Value properties in the ValueField<T> component should be driven with the values specified in the keyframes.

Log Files

No response

Screenshots

AnimJBugEvidence_2.mp4

How often does it happen?

Always

Does the bug persist after restarting Neos?

Yes

Neos Version Number

2022.1.28.1310

What Platforms does this occur on?

Windows

Link to Reproduction Item/World

No response

Did this work before?

I Don't Know

If it worked before, on which build?

No response

Additional context

No response

Reporters

  • U-StiefelJackal / Stiefel Jackal#1864
  • U-Rucio / Rucio#0134
  • U-Rixx / Rixx#9063
  • U-Crusher / Crusher#6143
  • U-Storm_0 / Storm_DPD#6988
@stiefeljackal stiefeljackal added the Bug Something isn't working label Jan 4, 2023
@Lexevolution
Copy link

This is also the case for all matrix types.

@stiefeljackal
Copy link
Author

Thank you. Basically, all of these types cannot be parsed due to missing Attributes in the value types or JsonConverters for those value types:

  • floatQ
  • float2x2
  • float3x3
  • float4x4
  • doubleQ
  • double2x2
  • double3x3
  • double4x4
  • color

@Lexevolution
Copy link

Also there's a few types which should be allowed to be "animated", but aren't included in the BaseX.AnimX.elementTypes list:

  • char
  • DateTime
  • TimeSpan
  • decimal
  • enums

But I believe this specifically could be made as a new issue, as it's not relevant to the parsing bug.

@stiefeljackal
Copy link
Author

The JworkzAnimJImportFix mod addresses the parsing issues for color and floatQ. Now you can map your fields to these value types in AnimJ!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants