Something in Blender can generate invalid (Nan) values in UVMaps #79775

Closed
opened 2020-08-14 13:06:50 +02:00 by Kitten · 142 comments

See e.g. nan-nan_with-bevel.blend (run mesh_data.validate(verbose=True) in py console to see the issues).

It might be caused by Bevel code? Needs investigation.


Original Report:

System Information
Operating system: Windows 10
Graphics card: 1080 Ti

Blender Version
Broken: 2.83.4, 2.82a, e4932d1167
Worked: No Idea

Short description of error

Exact steps for others to reproduce the error
Export the fbx. (Only default settings were tested.)

Voiture.blend

here is log

FBX export starting... '/Users/me/Downloads/Voiture.fbx'
FBX export prepare: Wrapping Objects...
	Done (0.000301 sec)

FBX export prepare: Wrapping Data (lamps, cameras, empties)...
	Done (0.000074 sec)

FBX export prepare: Wrapping Meshes...
	Done (0.000263 sec)

FBX export prepare: Wrapping ShapeKeys...
	Done (0.000039 sec)

FBX export prepare: Wrapping Armatures...
	Done (0.000043 sec)

FBX export prepare: Wrapping World...
	Done (0.000102 sec)

FBX export prepare: Wrapping Materials...
	Done (0.000359 sec)

FBX export prepare: Wrapping Textures...
	Done (0.001477 sec)

FBX export prepare: Wrapping Animations...
	Done (0.000160 sec)

FBX export prepare: Generating templates...
	Done (0.000093 sec)

FBX export prepare: Generating Connections...
	Done (0.000639 sec)

FBX export fetch empties (0)...
	Done (0.000038 sec)

FBX export fetch lamps (0)...
	Done (0.000030 sec)

FBX export fetch cameras (0)...
	Done (0.000034 sec)

FBX export fetch meshes (5)...
Python: Traceback (most recent call last):
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/__init__.py", line 636, in execute
    return export_fbx_bin.save(self, context, **keywords)
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3198, in save
    ret = save_single(operator, context.scene, depsgraph, filepath, **kwargs_mod)
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3094, in save_single
    fbx_objects_elements(root, scene_data)
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 2894, in fbx_objects_elements
    fbx_data_mesh_elements(objects, me_obj, scene_data, done_meshes)
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 1174, in fbx_data_mesh_elements
    elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx)))
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/fbx_utils.py", line 504, in elem_data_single_int32_array
    return _elem_data_single(elem, name, value, "add_int32_array")
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/fbx_utils.py", line 451, in _elem_data_single
    getattr(sub_elem, func_name)(value)
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/encode_bin.py", line 161, in add_int32_array
    data = array.array(data_types.ARRAY_INT32, data)
  File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 1174, in <genexpr>
    elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx)))
KeyError: ((nan, nan), 819)

location: <unknown location>:-1
See e.g. [nan-nan_with-bevel.blend](https://archive.blender.org/developer/F8791479/nan-nan_with-bevel.blend) (run `mesh_data.validate(verbose=True)` in py console to see the issues). It *might* be caused by Bevel code? Needs investigation. ----------- # Original Report: **System Information** Operating system: Windows 10 Graphics card: 1080 Ti **Blender Version** Broken: 2.83.4, 2.82a, e4932d1167 Worked: No Idea **Short description of error** **Exact steps for others to reproduce the error** Export the fbx. (Only default settings were tested.) [Voiture.blend](https://archive.blender.org/developer/F8808175/Voiture.blend) here is log ```lines=20 FBX export starting... '/Users/me/Downloads/Voiture.fbx' FBX export prepare: Wrapping Objects... Done (0.000301 sec) FBX export prepare: Wrapping Data (lamps, cameras, empties)... Done (0.000074 sec) FBX export prepare: Wrapping Meshes... Done (0.000263 sec) FBX export prepare: Wrapping ShapeKeys... Done (0.000039 sec) FBX export prepare: Wrapping Armatures... Done (0.000043 sec) FBX export prepare: Wrapping World... Done (0.000102 sec) FBX export prepare: Wrapping Materials... Done (0.000359 sec) FBX export prepare: Wrapping Textures... Done (0.001477 sec) FBX export prepare: Wrapping Animations... Done (0.000160 sec) FBX export prepare: Generating templates... Done (0.000093 sec) FBX export prepare: Generating Connections... Done (0.000639 sec) FBX export fetch empties (0)... Done (0.000038 sec) FBX export fetch lamps (0)... Done (0.000030 sec) FBX export fetch cameras (0)... Done (0.000034 sec) FBX export fetch meshes (5)... Python: Traceback (most recent call last): File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/__init__.py", line 636, in execute return export_fbx_bin.save(self, context, **keywords) File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3198, in save ret = save_single(operator, context.scene, depsgraph, filepath, **kwargs_mod) File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3094, in save_single fbx_objects_elements(root, scene_data) File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 2894, in fbx_objects_elements fbx_data_mesh_elements(objects, me_obj, scene_data, done_meshes) File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 1174, in fbx_data_mesh_elements elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx))) File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/fbx_utils.py", line 504, in elem_data_single_int32_array return _elem_data_single(elem, name, value, "add_int32_array") File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/fbx_utils.py", line 451, in _elem_data_single getattr(sub_elem, func_name)(value) File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/encode_bin.py", line 161, in add_int32_array data = array.array(data_types.ARRAY_INT32, data) File "Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 1174, in <genexpr> elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx))) KeyError: ((nan, nan), 819) location: <unknown location>:-1 ```
Author

Added subscriber: @takaralolita

Added subscriber: @takaralolita

blender/blender-addons#97197 was marked as duplicate of this issue

blender/blender-addons#97197 was marked as duplicate of this issue

#96951 was marked as duplicate of this issue

#96951 was marked as duplicate of this issue

#92329 was marked as duplicate of this issue

#92329 was marked as duplicate of this issue

#91707 was marked as duplicate of this issue

#91707 was marked as duplicate of this issue

blender/blender-addons#90581 was marked as duplicate of this issue

blender/blender-addons#90581 was marked as duplicate of this issue

blender/blender-addons#90003 was marked as duplicate of this issue

blender/blender-addons#90003 was marked as duplicate of this issue

#89012 was marked as duplicate of this issue

#89012 was marked as duplicate of this issue

blender/blender-addons#88736 was marked as duplicate of this issue

blender/blender-addons#88736 was marked as duplicate of this issue

#88704 was marked as duplicate of this issue

#88704 was marked as duplicate of this issue

#88615 was marked as duplicate of this issue

#88615 was marked as duplicate of this issue

blender/blender-addons#88573 was marked as duplicate of this issue

blender/blender-addons#88573 was marked as duplicate of this issue

blender/blender-addons#88495 was marked as duplicate of this issue

blender/blender-addons#88495 was marked as duplicate of this issue

#88024 was marked as duplicate of this issue

#88024 was marked as duplicate of this issue

#88003 was marked as duplicate of this issue

#88003 was marked as duplicate of this issue

#87807 was marked as duplicate of this issue

#87807 was marked as duplicate of this issue

blender/blender-addons#87103 was marked as duplicate of this issue

blender/blender-addons#87103 was marked as duplicate of this issue

#86831 was marked as duplicate of this issue

#86831 was marked as duplicate of this issue

#86734 was marked as duplicate of this issue

#86734 was marked as duplicate of this issue

#86703 was marked as duplicate of this issue

#86703 was marked as duplicate of this issue

blender/blender-addons#86593 was marked as duplicate of this issue

blender/blender-addons#86593 was marked as duplicate of this issue

#85590 was marked as duplicate of this issue

#85590 was marked as duplicate of this issue

#85283 was marked as duplicate of this issue

#85283 was marked as duplicate of this issue

#84809 was marked as duplicate of this issue

#84809 was marked as duplicate of this issue

#84635 was marked as duplicate of this issue

#84635 was marked as duplicate of this issue

#84617 was marked as duplicate of this issue

#84617 was marked as duplicate of this issue

#84085 was marked as duplicate of this issue

#84085 was marked as duplicate of this issue

#84066 was marked as duplicate of this issue

#84066 was marked as duplicate of this issue

#84056 was marked as duplicate of this issue

#84056 was marked as duplicate of this issue

#82391 was marked as duplicate of this issue

#82391 was marked as duplicate of this issue

#82146 was marked as duplicate of this issue

#82146 was marked as duplicate of this issue

#82125 was marked as duplicate of this issue

#82125 was marked as duplicate of this issue

#81822 was marked as duplicate of this issue

#81822 was marked as duplicate of this issue

#81713 was marked as duplicate of this issue

#81713 was marked as duplicate of this issue

#80835 was marked as duplicate of this issue

#80835 was marked as duplicate of this issue

blender/blender-addons#80816 was marked as duplicate of this issue

blender/blender-addons#80816 was marked as duplicate of this issue

#80584 was marked as duplicate of this issue

#80584 was marked as duplicate of this issue

#80540 was marked as duplicate of this issue

#80540 was marked as duplicate of this issue

blender/blender-addons#79660 was marked as duplicate of this issue

blender/blender-addons#79660 was marked as duplicate of this issue

#79994 was marked as duplicate of this issue

#79994 was marked as duplicate of this issue

blender/blender-addons#80075 was marked as duplicate of this issue

blender/blender-addons#80075 was marked as duplicate of this issue
Author

Just Rebuild everything and The exact same problem when exporting, what is going on???

Just Rebuild everything and The exact same problem when exporting, what is going on???
Author

Created a New file, No textures, just the shapes

Traceback (most recent call last):

File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\__init__.py", line 634, in execute
  return export_fbx_bin.save(self, context, **keywords)
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3198, in save
  ret = save_single(operator, context.scene, depsgraph, filepath, **kwargs_mod)
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3094, in save_single
  fbx_objects_elements(root, scene_data)
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2894, in fbx_objects_elements
  fbx_data_mesh_elements(objects, me_obj, scene_data, done_meshes)
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1174, in fbx_data_mesh_elements
  elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx)))
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\fbx_utils.py", line 504, in elem_data_single_int32_array
  return _elem_data_single(elem, name, value, "add_int32_array")
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\fbx_utils.py", line 451, in _elem_data_single
  getattr(sub_elem, func_name)(value)
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\encode_bin.py", line 161, in add_int32_array
  data = array.array(data_types.ARRAY_INT32, data)
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1174, in <genexpr>
  elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx)))

KeyError: ((nan, nan), 11)

location: :-1

Created a New file, No textures, just the shapes Traceback (most recent call last): ``` File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\__init__.py", line 634, in execute return export_fbx_bin.save(self, context, **keywords) File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3198, in save ret = save_single(operator, context.scene, depsgraph, filepath, **kwargs_mod) File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3094, in save_single fbx_objects_elements(root, scene_data) File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2894, in fbx_objects_elements fbx_data_mesh_elements(objects, me_obj, scene_data, done_meshes) File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1174, in fbx_data_mesh_elements elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx))) File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\fbx_utils.py", line 504, in elem_data_single_int32_array return _elem_data_single(elem, name, value, "add_int32_array") File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\fbx_utils.py", line 451, in _elem_data_single getattr(sub_elem, func_name)(value) File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\encode_bin.py", line 161, in add_int32_array data = array.array(data_types.ARRAY_INT32, data) File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1174, in <genexpr> elem_data_single_int32_array(lay_uv, b"UVIndex", (uv2idx[uv_id] for uv_id in _uvtuples_gen(t_luv, t_lvidx))) ``` KeyError: ((nan, nan), 11) location: <unknown location>:-1

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

This comment was removed by @rjg

*This comment was removed by @rjg*

Added subscriber: @StephenSwaney

Added subscriber: @StephenSwaney

(x86)\Steam\steamapps\common\Blender\2.83\

Along with providing a .blend, you might want to test this with the current 2.84 release, preferably from blender.org.

Blender does not need to be installed. You can simply download it, unpack the archive and run it directly.

I can't be spending my time fixing bugs on something as simple as exporting a FBX

It may seem simple when you are clicking Export, but FBX is a very complicated format. Worse, it is proprietary which means you need a license from Autodesk to read the specification or use their libraries to read and write the format. Worse still, Autodesk is rumored to change the format regularly to prevent reverse-engineering.

> (x86)\Steam\steamapps\common\Blender\2.83\ Along with providing a .blend, you might want to test this with the current 2.84 release, preferably from blender.org. Blender does not need to be installed. You can simply download it, unpack the archive and run it directly. > I can't be spending my time fixing bugs on something as simple as exporting a FBX It may seem simple when you are clicking Export, but FBX is a *very* complicated format. Worse, it is proprietary which means you need a license from Autodesk to read the specification or use their libraries to read and write the format. Worse still, Autodesk is rumored to change the format regularly to prevent reverse-engineering.

Added subscriber: @andresalim

Added subscriber: @andresalim
Member

Added subscriber: @Ying-Wang

Added subscriber: @Ying-Wang
Member

Added subscribers: @TyrManda, @Jijones, @carlhughes, @ankitm

Added subscribers: @TyrManda, @Jijones, @carlhughes, @ankitm
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

Added subscriber: @Baguette

Added subscriber: @Baguette
Member

Added subscribers: @3di, @mano-wii, @lichtwerk

Added subscribers: @3di, @mano-wii, @lichtwerk
Member

Since this is reported often and we keep this report open for it [not sure if we should, usually the "corrupted" meshes are not tracked in the bugtracker, we only do if we can find the source for the corruption within blender tools], I'll drop the following comment here. I guess this is relevant for all of the reported files:

In #80089#1004791, @3di wrote:
Hi @mano-wii , I was able to fix the problem using python. It appears the bug is caused by temp/cached custom data layers. This resolves it:

import bpy

m = bpy.context.object.data
m.validate() #this function has a parameter called clean_customdata which defaults to true and removes any temp/cached custom-data layers like normals and presumably the conflicting cached uv's

Maybe the exporter could loop through the objects being exported and clear their cached data before attempting to export?

import bpy

for ob in bpy.data.objects:
    
    m = ob.data
    if m.validate(verbose=True):
        print("something was fixed with the mesh")
    else:
        print("mesh was fine")
        
    print(" and the cached custom data has been cleared to avoid export issues")

Maybe the fact that this is specifically about the custom-data layers will help us track the issue down further.

Since this is reported often and we keep this report open for it [not sure if we should, usually the "corrupted" meshes are not tracked in the bugtracker, we only do if we can find the source for the corruption within blender tools], I'll drop the following comment here. I guess this is relevant for all of the reported files: > In #80089#1004791, @3di wrote: > Hi @mano-wii , I was able to fix the problem using python. It appears the bug is caused by temp/cached custom data layers. This resolves it: > > > ``` > import bpy > > m = bpy.context.object.data > m.validate() #this function has a parameter called clean_customdata which defaults to true and removes any temp/cached custom-data layers like normals and presumably the conflicting cached uv's > ``` > > Maybe the exporter could loop through the objects being exported and clear their cached data before attempting to export? > > ``` > import bpy > > for ob in bpy.data.objects: > > m = ob.data > if m.validate(verbose=True): > print("something was fixed with the mesh") > else: > print("mesh was fine") > > print(" and the cached custom data has been cleared to avoid export issues") > ``` Maybe the fact that this is specifically about the custom-data layers will help us track the issue down further.
Member

Added subscriber: @20Martin

Added subscriber: @20Martin
Member

Added subscriber: @AdamPreisler

Added subscriber: @AdamPreisler
Member

Dropping this comment here [might help track down the issue as well]:

In blender/blender-addons#68292#998200, @AdamPreisler wrote:
So by hiding halfs of the model I narrowed it down to this object after a while:

nan-nan.blend

Tried deleting UVs, clearing custom split data and still not sure what could it be.
Edit1: Found out that if I delete both UV maps it works. But the question is - what is wrong with the UV maps? They look fine.
Edit2: OK so I redid both UV maps again and now it can be exported. The original object had a bevel modifier on it. Wondering if that could cause this.

Here is blend with bevel: nan-nan_with-bevel.blend

Dropping this comment here [might help track down the issue as well]: > In blender/blender-addons#68292#998200, @AdamPreisler wrote: > So by hiding halfs of the model I narrowed it down to this object after a while: > > [nan-nan.blend](https://archive.blender.org/developer/F8791421/nan-nan.blend) > > Tried deleting UVs, clearing custom split data and still not sure what could it be. > Edit1: Found out that if I delete both UV maps it works. But the question is - what is wrong with the UV maps? They look fine. > Edit2: OK so I redid both UV maps again and now it can be exported. The original object had a bevel modifier on it. Wondering if that could cause this. > > Here is blend with bevel: [nan-nan_with-bevel.blend](https://archive.blender.org/developer/F8791479/nan-nan_with-bevel.blend)
Member

Added subscribers: @meysamFk97, @iss, @gobb_blend

Added subscribers: @meysamFk97, @iss, @gobb_blend
Member

More information:

In #80584#1012474, @gobb_blend wrote:
@rjg This issue happened to a coworker of mine, but I'll try to rephrase what they said.
The only noteworthy thing about the creation of this mesh is that they copy-pasted (Ctrl-C, Ctrl-V) the object from one Blender instance to another (both 2.83) and then continued working on the copy. They extruded part of the mesh, and a few of those resulting vertices ended up being broken. The extrusion created new vertices in the mesh, but not in the UV layer -- at least some connections are missing from what I can tell.
Here's a more complete version of the original model with the extruded part clearly emphasized.
cant_export_fbx.blend

What makes this bug even worse is the fact that this broken state is propagated to all vertices created from the broken ones, for example by extruding or loop-cutting them. None of the new vertices will show up in the UV editor.

In #80584#1015884, @gobb_blend wrote:
building1.blend
@iss Here's the original file. Allegedly, pasting this into a new file and then extruding parts of the door frame was enough to cause the issue at hand. Though, even after a handful of tries I haven't been able to reproduce it, so it might be something else entirely.

More information: > In #80584#1012474, @gobb_blend wrote: > @rjg This issue happened to a coworker of mine, but I'll try to rephrase what they said. > The only noteworthy thing about the creation of this mesh is that they copy-pasted (Ctrl-C, Ctrl-V) the object from one Blender instance to another (both 2.83) and then continued working on the copy. They extruded part of the mesh, and a few of those resulting vertices ended up being broken. The extrusion created new vertices in the mesh, but not in the UV layer -- at least some connections are missing from what I can tell. > Here's a more complete version of the original model with the extruded part clearly emphasized. > [cant_export_fbx.blend](https://archive.blender.org/developer/F8857820/cant_export_fbx.blend) > > What makes this bug even worse is the fact that this broken state is propagated to all vertices created from the broken ones, for example by extruding or loop-cutting them. None of the new vertices will show up in the UV editor. > In #80584#1015884, @gobb_blend wrote: > [building1.blend](https://archive.blender.org/developer/F8882022/building1.blend) > @iss Here's the original file. Allegedly, pasting this into a new file and then extruding parts of the door frame was enough to cause the issue at hand. Though, even after a handful of tries I haven't been able to reproduce it, so it might be something else entirely.

@gobb_blend thank you for example file, can you add steps to what exactly should I extrude to cause the bug? also do I have to use specific Blender version?

I copied the object, extruded faces of frame to make "tunnel", exported FBX and I had no issue.

This issue could be caused by some addon as well, so it would be good to check that as well if you can reproduce the issue.

@gobb_blend thank you for example file, can you add steps to what exactly should I extrude to cause the bug? also do I have to use specific Blender version? I copied the object, extruded faces of frame to make "tunnel", exported FBX and I had no issue. This issue could be caused by some addon as well, so it would be good to check that as well if you can reproduce the issue.
Philipp Oeser changed title from Error when exporting FBX to Error when exporting FBX (presumably caused by conflicting cached uv customdatalayer) 2020-09-15 10:56:39 +02:00

@iss In our case Blender 2.83.3 was used when the bug occurred. No add-ons besides the ones that are active by default. The artist extruded (E key) the arch above the door into the wall of the building like so: image.png
That's all I can tell you. I personally never encountered this bug, and following these steps as described doesn't cause it for me either.

@iss In our case Blender 2.83.3 was used when the bug occurred. No add-ons besides the ones that are active by default. The artist extruded (E key) the arch above the door into the wall of the building like so: ![image.png](https://archive.blender.org/developer/F8882334/image.png) That's all I can tell you. I personally never encountered this bug, and following these steps as described doesn't cause it for me either.

Added subscriber: @Cybernetfreek

Added subscriber: @Cybernetfreek
Member

Setting to hig prio since it is reported so often.

Setting to hig prio since it is reported so often.

Slight amendment to the code I posted above (forgot to check if it's a mesh). If this is run from the text editor prior to export, then the fbx error disappears.

Workaround until the devs find out the root cause.

import bpy

for ob in bpy.data.objects:
    if not ob.type =='MESH':
        print(ob.name,'is not a mesh, skipping\n')
        continue
    print(ob.name,'\n')
    m = ob.data
    if m.validate(verbose=True):
        print("something was fixed with the mesh")
    else:
        print("mesh was fine")
        
    print(" and the cached custom data has been cleared to avoid export issues")
Slight amendment to the code I posted above (forgot to check if it's a mesh). If this is run from the text editor prior to export, then the fbx error disappears. Workaround until the devs find out the root cause. ``` import bpy for ob in bpy.data.objects: if not ob.type =='MESH': print(ob.name,'is not a mesh, skipping\n') continue print(ob.name,'\n') m = ob.data if m.validate(verbose=True): print("something was fixed with the mesh") else: print("mesh was fine") print(" and the cached custom data has been cleared to avoid export issues") ```
Bastien Montagne changed title from Error when exporting FBX (presumably caused by conflicting cached uv customdatalayer) to Something in Blender can generate invalid (Nan) values in UVMaps 2020-09-21 16:38:01 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'

Note: nan-nan_with-bevel.blend does exhibit the issue in 2.83, but not in current master, so I would assume the issue from Bevel modifier has already been fixed.

It remains unclear whether other tools can still generate such invalid data in current master?

Note: [nan-nan_with-bevel.blend](https://archive.blender.org/developer/F8791479/nan-nan_with-bevel.blend) does exhibit the issue in 2.83, but not in current master, so I would assume the issue from Bevel modifier has already been fixed. It remains unclear whether other tools can still generate such invalid data in current master?

Added subscribers: @sharlybg, @brecht

Added subscribers: @sharlybg, @brecht

Added subscriber: @Ashtray

Added subscriber: @Ashtray

My problem was merged into this one. You mentioned that the UV Mapping was corrupted.

I went into the UV Maps in the currupted object properties. Removed the UV Map and added one. It's solved the problem on my end.

So I guess the workaround is reapply the UV Maps on all your objects.

My problem was merged into this one. You mentioned that the UV Mapping was corrupted. I went into the UV Maps in the currupted object properties. Removed the UV Map and added one. It's solved the problem on my end. So I guess the workaround is reapply the UV Maps on all your objects.

@Ashtray This is a better workaround:

stick this in the text editor and hit run script before you try and export. It'll fix the entire scene.

import bpy

for ob in bpy.data.objects:

  if not ob.type =='MESH':
      print(ob.name,'is not a mesh, skipping\n')
      continue
  print(ob.name,'\n')
  m = ob.data
  if m.validate(verbose=True):
      print("something was fixed with the mesh")
  else:
      print("mesh was fine")
      
  print(" and the cached custom data has been cleared to avoid export issues")
@Ashtray This is a better workaround: stick this in the text editor and hit run script before you try and export. It'll fix the entire scene. import bpy for ob in bpy.data.objects: ``` if not ob.type =='MESH': print(ob.name,'is not a mesh, skipping\n') continue print(ob.name,'\n') m = ob.data if m.validate(verbose=True): print("something was fixed with the mesh") else: print("mesh was fine") print(" and the cached custom data has been cleared to avoid export issues")
Member

Added subscriber: @jordanirwin

Added subscriber: @jordanirwin

Added subscriber: @Udjanii

Added subscriber: @Udjanii

I am having this issue for the last 4 versions of blender 2.90 and 2.91. The only reliable way to fix it is to export the mesh as OBJ and import again to export as FBX

Michael Campbell script only works on scene where i appended the corrupt objects to a new file to test, on the original scene were i have hundreds of the script does not fix the bug.

I am having this issue for the last 4 versions of blender 2.90 and 2.91. The only reliable way to fix it is to export the mesh as OBJ and import again to export as FBX Michael Campbell script only works on scene where i appended the corrupt objects to a new file to test, on the original scene were i have hundreds of the script does not fix the bug.
Member

Added subscriber: @mhmmtuzn61

Added subscriber: @mhmmtuzn61
Member

Added subscriber: @ptNutty

Added subscriber: @ptNutty
Member

Added subscriber: @Step202

Added subscriber: @Step202

Added subscriber: @esgnn

Added subscriber: @esgnn

The way I have this problem is when I extrude the newly created area has no uv area at all, it is like an edge (screenshot attached). After mapping uv properly I can export it as fbx file. However it is not a practical solution at all. Hope it helps.
(I am a blender newbie, please excuse the lack of lingo)

Screen Shot 2020-11-17 at 01.24.20.png

The way I have this problem is when I extrude the newly created area has no uv area at all, it is like an edge (screenshot attached). After mapping uv properly I can export it as fbx file. However it is not a practical solution at all. Hope it helps. (I am a blender newbie, please excuse the lack of lingo) ![Screen Shot 2020-11-17 at 01.24.20.png](https://archive.blender.org/developer/F9305482/Screen_Shot_2020-11-17_at_01.24.20.png)

@esgnn I couldn't reproduce this with a simple mesh. Extruding a mesh and not unwrapping it afterwards still exports fine.

@esgnn I couldn't reproduce this with a simple mesh. Extruding a mesh and not unwrapping it afterwards still exports fine.
Member

Added subscriber: @eko_lx

Added subscriber: @eko_lx

Added subscriber: @ShinkiPham

Added subscriber: @ShinkiPham

Removed subscriber: @Ashtray

Removed subscriber: @Ashtray
Member

Added subscriber: @Mr_Badoor

Added subscriber: @Mr_Badoor

Added subscribers: @rockittt, @filedescriptor, @erik85

Added subscribers: @rockittt, @filedescriptor, @erik85

Added subscriber: @Adrian1

Added subscriber: @Adrian1
Member

Added subscriber: @aldzz

Added subscriber: @aldzz

Added subscriber: @miralyondev

Added subscriber: @miralyondev
Member

Added subscriber: @Foggy

Added subscriber: @Foggy
Member

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'
Member

In order to not let this report die, I will set its status to "Needs developer To Reproduce".

In order to not let this report die, I will set its status to "Needs developer To Reproduce".

Removed subscriber: @eko_lx

Removed subscriber: @eko_lx
Member

Added subscriber: @ee.hristolubov

Added subscriber: @ee.hristolubov
Member

Added subscriber: @LKelda

Added subscriber: @LKelda
Member

Added subscriber: @jcmind

Added subscriber: @jcmind

Added subscriber: @Jaxtronaut

Added subscriber: @Jaxtronaut

Added subscriber: @apprenti90

Added subscriber: @apprenti90

Added subscriber: @screwballll

Added subscriber: @screwballll

Added subscriber: @PCotton

Added subscriber: @PCotton
Member

Added subscriber: @Marlo

Added subscriber: @Marlo

Removed subscriber: @AdamPreisler

Removed subscriber: @AdamPreisler
Member

Added subscriber: @Vyach

Added subscriber: @Vyach
Member

Not sure if it helps, but will set to High prio (just due to the fact it has been reported so often lately)

Not sure if it helps, but will set to High prio (just due to the fact it has been reported so often lately)

@lichtwerk sadly it wasnt my file (subsriber sent this issue) So info is poor: this mesh was produced by blender (without any import), and such thing happens very rare, as he said (it was few times, last time a month ago). I still dont have the way to reproduce.

@lichtwerk sadly it wasn`t my file (subsriber sent this issue) So info is poor: this mesh was produced by blender (without any import), and such thing happens very rare, as he said (it was few times, last time a month ago). I still don`t have the way to reproduce.

Removed subscriber: @erik85

Removed subscriber: @erik85
Member

Added subscriber: @DORI

Added subscriber: @DORI

Added subscriber: @Ksard

Added subscriber: @Ksard

Removed subscriber: @Ksard

Removed subscriber: @Ksard
Member

Added subscriber: @shaprinskiy

Added subscriber: @shaprinskiy
Member

Added subscriber: @Benyaminpr2000

Added subscriber: @Benyaminpr2000

Added subscriber: @stnslvkey

Added subscriber: @stnslvkey

Removed subscriber: @Jaxtronaut

Removed subscriber: @Jaxtronaut

Added subscribers: @tomankubik, @chemicalcrux

Added subscribers: @tomankubik, @chemicalcrux

I wrote a "fuzzer" that randomly performs mesh operations and attempts to export to FBX after each step. I managed to produce NaN UV coordinates via an Inset operation.

The resulting geometry was a mess...

image.png

I narrowed it down to five vertices, four of which are perfectly stacked on top of each other. If you inset (no mouse movement) with them all selected, you should get NaN UVs and be unable to export to FBX. Before the inset, you should be able to export.

minimal.blend

I don't think you can remove any of the vertices, but I am having some trouble selecting them :p

I did this in 2.93

edit -- I've got another example here. It generates bogus UVs when inset with a thickness of zero, when beveled with a non-zero width, and when using Poke Faces.

poke.blend

It involves more degenerate geometry. The original geometry is on the left; I pulled it apart on the right to visualize the actual topology.

image.png

The bug is extremely sensitive to the specifics of the vertex coordinates. Rotating the mesh data or moving individual vertices even slightly will make the bug go away.

Also, this is not invalid mesh data; it's simply degenerate. The validate function has no effect on these two examples.

I wrote a "fuzzer" that randomly performs mesh operations and attempts to export to FBX after each step. I managed to produce NaN UV coordinates via an Inset operation. The resulting geometry was a mess... ![image.png](https://archive.blender.org/developer/F10170148/image.png) I narrowed it down to five vertices, four of which are perfectly stacked on top of each other. If you inset (no mouse movement) with them all selected, you should get NaN UVs and be unable to export to FBX. Before the inset, you should be able to export. [minimal.blend](https://archive.blender.org/developer/F10170166/minimal.blend) I don't think you can remove any of the vertices, but I am having some trouble selecting them :p I did this in 2.93 edit -- I've got another example here. It generates bogus UVs when inset with a thickness of zero, when beveled with a non-zero width, and when using *Poke Faces*. [poke.blend](https://archive.blender.org/developer/F10170209/poke.blend) It involves more degenerate geometry. The original geometry is on the left; I pulled it apart on the right to visualize the actual topology. ![image.png](https://archive.blender.org/developer/F10170208/image.png) The bug is extremely sensitive to the specifics of the vertex coordinates. Rotating the mesh data or moving individual vertices even slightly will make the bug go away. Also, this is not *invalid* mesh data; it's simply degenerate. The validate function has no effect on these two examples.

This issue was referenced by b21db5e698

This issue was referenced by b21db5e6988566dc3344b3293eb7e33234ec2597

Thanks a lot @chemicalcrux with that kind of file reproducing and fixing the issue becomes trivial! :D

Note that I'll keep the report open for now, there might be other cases still floating around...

Thanks a lot @chemicalcrux with that kind of file reproducing and fixing the issue becomes trivial! :D Note that I'll keep the report open for now, there might be other cases still floating around...

I was about to complain that I couldn't get these to work on the latest alpha for some reason...then I looked at the related commit :'D

I'm fuzzing around for more NaN UVs right now. None yet -- although I have been getting crashes and NaN coordinates for vertices, so that's exciting! I'll try to make some more simple reproductions for those, but that may be a better fit for a different task.

I was about to complain that I couldn't get these to work on the latest alpha for some reason...then I looked at the related commit :'D I'm fuzzing around for more NaN UVs right now. None yet -- although I have been getting crashes and NaN coordinates for vertices, so that's exciting! I'll try to make some more simple reproductions for those, but that may be a better fit for a different task.
Member

Added subscribers: @srinivasdhuddu, @PratikPB2123

Added subscribers: @srinivasdhuddu, @PratikPB2123

Added subscriber: @CyberStien

Added subscriber: @CyberStien

I'm sorry if this is wrong place for this, but is there a workaround/process for fixing these NaN UV coordinates once they've been created? I currently have a ton of geometry with this issue and I'd like to not have to recreate it all if possible.

I'm sorry if this is wrong place for this, but is there a workaround/process for fixing these NaN UV coordinates once they've been created? I currently have a ton of geometry with this issue and I'd like to not have to recreate it all if possible.
Member

@CyberStien See the code in #79775#1016390
mesh.validate

@CyberStien See the code in #79775#1016390 `mesh.validate`
Member

Added subscriber: @iMakeMehModels

Added subscriber: @iMakeMehModels
Member

I had another repro case in #90609 (Can't export as FBX) (involving bevel with zero-scaled faces), but that was also fixed with b21db5e698 -- hooray!

@mont29: can we get this into 2.93 LTS? (huh, just noticed you were asking the same in b21db5e698, will put that on the list of #88449 (Blender LTS: Maintenance Task 2.93))

I had another repro case in #90609 (Can't export as FBX) (involving bevel with zero-scaled faces), but that was also fixed with b21db5e698 -- hooray! @mont29: can we get this into 2.93 LTS? (huh, just noticed you were asking the same in b21db5e698, will put that on the list of #88449 (Blender LTS: Maintenance Task 2.93))
Member

Added subscriber: @DankJerry

Added subscriber: @DankJerry

Any news? Hope it will be fixed for 3.0

Any news? Hope it will be fixed for 3.0
Member

Well in 3.0, it should actually not happen anymore (see b21db5e698).
This does not repair old files though (for that, you need to mesh.validate() still see #79775#1016390)

Well in 3.0, it should actually not happen anymore (see b21db5e698). This does not repair old files though (for that, you need to `mesh.validate()` still see #79775#1016390)

In #79775#1226700, @lichtwerk wrote:
Well in 3.0, it should actually not happen anymore (see b21db5e698).
This does not repair old files though (for that, you need to mesh.validate() still see #79775#1016390)

If it will not, and it is possible to fix it is okay for me! Good news at least for 3.0!

> In #79775#1226700, @lichtwerk wrote: > Well in 3.0, it should actually not happen anymore (see b21db5e698). > This does not repair old files though (for that, you need to `mesh.validate()` still see #79775#1016390) If it will not, and it is possible to fix it is okay for me! Good news at least for 3.0!
Member

Added subscriber: @CJaiswal

Added subscriber: @CJaiswal

Added subscriber: @HakunaMytata

Added subscriber: @HakunaMytata

Added subscriber: @Tigre8002

Added subscriber: @Tigre8002

Added subscriber: @ideasman42

Added subscriber: @ideasman42

This is marked as a high priority bug report but as far as I can see the issue reported has been resolved.

Is there any need to keep this open?

This is marked as a high priority bug report but as far as I can see the issue reported has been resolved. Is there any need to keep this open?
Member

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'
Philipp Oeser self-assigned this 2022-05-06 08:39:56 +02:00
Member

The issues reported are all from files authored before b21db5e698 afaict, so it might be time to finally close this as resolved.
Should issues ever creep up again, we can always reopen.

The issues reported are all from files authored before b21db5e698 afaict, so it might be time to finally close this as resolved. Should issues ever creep up again, we can always reopen.

Removed subscriber: @gobb_blend

Removed subscriber: @gobb_blend

the issue still there in 3.6.2

the issue still there in 3.6.2

@Sergey many values in this UVMap are NaN... as usual, need to know how such invalid data is generated.

@Sergey many values in this UVMap are NaN... as usual, need to know _how_ such invalid data is generated.

@mont29 Think the wrong Sergey was poked via the AT-thingie?

@mont29 Think the wrong Sergey was poked via the AT-thingie?

@Sergey Woops indeed, sorry 😅

@Sergey Woops indeed, sorry 😅

so funny thing right
i have this ar15 model ive worked for a while and the second i try and merge everything and export it so i can texture it or even i tried to texture it in blender but my uv wont work and it wont let me export at all
my version of blender is 3.6 i know this is old but i hope i can find help anyway i dont want o just throw it in the bin yet
image

so funny thing right i have this ar15 model ive worked for a while and the second i try and merge everything and export it so i can texture it or even i tried to texture it in blender but my uv wont work and it wont let me export at all my version of blender is 3.6 i know this is old but i hope i can find help anyway i dont want o just throw it in the bin yet ![image](/attachments/eaa8e360-5ffe-4f1a-8436-a6322d0fb361)

i dont know if this is normal but there are weird links between my meshes
image

i dont know if this is normal but there are weird links between my meshes ![image](/attachments/20a03121-2d6b-4dfe-b460-c72616b967a8)
3.5 KiB
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
30 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#79775
No description provided.