question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: cannot convert float NaN to integer

See original GitHub issue

Describe the bug I attached the file that I cannot export and it took me 3 hours to find the problem because the script does not indicate the object that creates problems. 
but it generates a generic report, this is something that is not a big problem with a few objects but with my file with over 1700 objects it was difficult to locate the object.

Python: Traceback (most recent call last):
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/__init__.py", line 626, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 66, in __export
    json = __fix_json(exporter.glTF.to_dict())
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 109, in __fix_json
    fixed[key] = __fix_json(value)
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 113, in __fix_json
    fixed.append(__fix_json(value))
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 109, in __fix_json
    fixed[key] = __fix_json(value)
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 113, in __fix_json
    fixed.append(__fix_json(value))
  File "/home/root/Software/blender-2.93.3/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 116, in __fix_json
    if int(obj) == obj:
ValueError: cannot convert float NaN to integer

location: <unknown location>:-1

.blend file/ .gltf Nan-float.blend.tar.gz

Version

  • OS: Linux
  • Blender Version LTS 2.93.2 and the latest under development v3.00 daily build

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
juliendurourecommented, Aug 25, 2021

@pafurijaz Thanks a lot. It seems to solve the issue

0reactions
pafurijazcommented, Aug 24, 2021

I got an answer, from the developers, and with this command executed in the python console in object mode C.active_object.data.validate(verbose=True) I was able to solve the problem by identifying the problem and eliminating the vertices which are actually very few (14) Maybe this could be useful to create a solution in these cases. image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pandas: ValueError: cannot convert float NaN to integer
The "x" is a column in the csv file, I cannot spot any float NaN in the file, and I don't understand the...
Read more >
ValueError: cannot convert float NaN ... - Net-Informations.Com
NaN is short for Not a Number . It is a numeric data type used to represent any value that is undefined or...
Read more >
How to Fix: ValueError: cannot convert float NaN to integer
This error occurs when you attempt to convert a column in a pandas DataFrame from a float to an integer, yet the column...
Read more >
How to Fix: ValueError: cannot convert float NaN to integer
In Python, NaN stands for Not a Number. This error will occur when we are converting the dataframe column of the float type...
Read more >
valueerror: cannot convert float nan to integer ( Solved )
There are many times when a programmer raises an exception that is the ValueError. You can get this error when you give a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found