NaN in .h export for UVs

NaN in .h export for UVs

Martin --

I'm seeing "nan" (not a number) for some values of UVs in the .h export for 4.6.1

e.g.

{nan, nan, 0.00000, 0.00000, 0.00000, 0.49787, 0.02135, 0.21014},
{nan, nan, 0.00000, 0.00000, 0.00000, 0.49787, 0.02135, -0.21033},
{nan, nan, 0.00000, 0.00000, 0.00000, 0.49787, 0.02135, -0.19221},
{nan, nan, 0.00000, 0.00000, 0.00000, 0.49787, 0.02135, 0.21014},
{nan, nan, 0.00000, 0.00000, 0.00000

(attached is the full exported file)

Clearly something is messed up with the object's UVs but shouldn't this always at least export a 0 instead of NaN?
 

Attachments

  • DummyObject.txt
    15.6 KB · Views: 288
  • TempCushions.jas.zip
    7.9 KB · Views: 266
Last edited:
Also, I've a set of textures I've painted on UV set 1 and have baking UV coords on UV set 2. If I select UV set 2 and then export to .h, are the exported UVs from UV set 1 or 2?
 
Hi,
the .h exporter always exports the first UV set. Did you check your UV coords in the UV editor. If there are NaNs in the .h output I guess there are no reasonable UV coords assigned to the model.

Bye,
Martin
 
Oh OK - I suppose I'll have to write my own exporter then to export UV2 which is what I'm using for baked UVs.

The object definitely has UVs but there seem to be a few "bogus" normals and UVs. I'm really not sure how that is possible to do in C3D but leave it to me to find a way!
 
Hi,
I've looked into your file and you have some zero area polygons in it which cause zero normals. That can again cause NaN UVs in some UV mapping tools.

Which tools did you use to create that mesh?

Bye,
Martin
 
Oh geez -- SketchUp <sarcasm> shocking as that may be </sarcasm>

I already expected that:wink: SketchUp is quite famous for its bad mesh topology.

Out of curiosity, how'd you find those 0-area polys in C3D?

I haven't tried it but try to select all polygons with paint selection. The paint selection shouldn't select the zero are polygons. If you now invert the selection only zero area polygons should be selected which you then can delete.

If that doesn't work the other solution would be to write a Javascript to detect and delete these degenerate polygons.

Bye,
Martin
 
What's "paint selection"? I assume it's some form of selection in which I select the material and C3D selects the faces that use that material but, I don't see how to do that in C3D...
 
Back
Top