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

Rotation with snap sets values to NaN #39507

Closed
rcorre opened this issue Jun 13, 2020 · 8 comments · Fixed by #84049
Closed

Rotation with snap sets values to NaN #39507

rcorre opened this issue Jun 13, 2020 · 8 comments · Fixed by #84049

Comments

@rcorre
Copy link
Contributor

rcorre commented Jun 13, 2020

Godot version:

3.2.1.stable.custom_build.f0a489cf4

That's 3.2.1 with two patches:

OS/device including version:

GNU/Linux 5.6.15-arch1-1
GTX 970
GLES3

Issue description:

When I rotate an object with snapping (either by pressing y or holding ctrl while dragging the gizmo),
Godot sets all the rotations to NaN. If I save the scene after doing this, Godot will refuse to load the scene
again, saying it encountered an error while parsing.

Rotation without snap works normally.

Steps to reproduce:

Unfortunately this isn't happening in a new project, I'm unsure what I did to get my current project into this state.

Minimal reproduction project:

https://gitlab.com/rcorre/quest

@nobuyukinyuu
Copy link
Contributor

nobuyukinyuu commented Jun 15, 2020

big guess here but the rotational value of a node an old project might've had a number in it that evaluated out to something that maybe resulted in a 0/0 operation (maybe through roundoff error) -- applying rotation has always done some funky things with snap and maybe a change in how it's processed between editor versions let the door open for a NaN to sneak in when mixing old and new data values.

If there's a specific node in your project that this occurs on, you might be able to replicate it in a new project by manually assigning the same rotational value to the node from a text editor (not godot itself). This would require a rotational value that isn't NaN, since once a NaN sneaks in it will spread to other values. If you keep your code in a repo you may have a specific commit to track down where when adjusting the rotation from the editor the NaN first sneaks in.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 15, 2020

Good idea, but unfortunately there's no NaN in any scene files, and it happens on any object.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 15, 2020

In the logs I see

 servers/visual/visual_server_scene.cpp:601 - Condition "Math::is_nan(v.x)" is true.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 15, 2020

It happens even if I create a new scene. I'll try to build debug bits and dig in tonight.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 17, 2020

Debugging that line was no help, as it is just noticing the NaN, not creating it. @nobuyukinyuu might be on to something with a bad config though. I just removed the entry for this project from ~/.config/godot/projects/ and the issue disappeared.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 17, 2020

cfg.zip

Here's the offending config. I can't find anything suspicous.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 17, 2020

There's a fair chance I accidentally opened this project with a master build and screwed up my config this way. It probably isn't worth pursuing unless you're really curious.

@rcorre
Copy link
Contributor Author

rcorre commented Jul 19, 2020

Just happened to me again. I'm reasonably sure I didn't open this particular project with a master build. I noticed that in the configure snap menu my snap values are set to

  • Translate: 0
  • Rotate: 0
  • Scale: 0.000002%

Restoring those values to the defaults fixes the issue (but I never intentionally changed them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants