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

More helpful error message for Condition "!v.is_finite()" is true #97708

Open
Tracked by #42719
suhankins opened this issue Oct 1, 2024 · 2 comments
Open
Tracked by #42719

More helpful error message for Condition "!v.is_finite()" is true #97708

suhankins opened this issue Oct 1, 2024 · 2 comments

Comments

@suhankins
Copy link

Tested versions

  • Reproducible in: v4.3.stable (77dcf97)

System information

Godot v4.3.stable (77dcf97) - Windows 10.0.22631 - GLES3 (Compatibility) - Intel(R) Iris(R) Xe Graphics (Intel Corporation; 32.0.101.5972) - 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 Threads)

Issue description

Moving MeshInstance to an infinite or NaN coordinate causes this error

E 0:00:02:0077   instance_set_transform: Condition "!v.is_finite()" is true.
  <C++ Source>   servers/rendering/renderer_scene_cull.cpp:935 @ instance_set_transform()

That's great, but it's difficult to understand what does it mean. It would be better if error message read "Infinite coordinate provided to a mesh" or something like that so developers could more easily understand what happened and what do they need to look for in their code (i.e. divisions by zero)

Steps to reproduce

  1. Create a MeshInstance3D
  2. Set mesh to Cube
  3. Assign a new script to it
extends Node3D


func _ready() -> void:
	self.position.x = NAN

Minimal reproduction project (MRP)

N/A

@huwpascoe
Copy link
Contributor

Also consider that this can happen if scale/rotation are set to crazy values so it needs to cover those cases too. "Invalid Transform" or something.

@suhankins
Copy link
Author

suhankins commented Oct 2, 2024

I think "Invalid transform" is still too vague. It doesn't tell developer what did they do wrong and what they should do to fix it.
Maybe "NaN or Infinity used in transform"?

Ideally it would tell you whether it's Infinity, -Infinity, or NaN, and in which property it is, e.g. "NaN in scale X", though I imagine it would be harder to implement.

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

No branches or pull requests

3 participants