Blender exporter: exporting custom property (float is NaN)

Hi all. In my project i use BlenderLoader (“jme3-blender” package) for loading blender scene. My objects have some custom properties which used in my code as userData.
But i observed weird behavior when get value of property in code.

Float mass = node.getUserData("mass");

This line of code return NaN, but value in blender equal 0.860. If i change to other value (example 0.87) returning value is ok. I noticed, that value return NaN: 0.6, 0.62, 0.64, 0.66, x.86 where x is any number and etc…

Blender ver: 2.78a
JME3 ver: 3.1.0-stable

Do an instanceof Check, sometimes the value is an integer.
This might also be related to the Type of comma you use (, vs .)

This might be not directly related to this topic, but this was kind of surprise to me how much this can matter. Recently we met this kind of trouble opening .csv file in libreoffice under DE-DE locale, where triples like 1,000,123 were treated as single value 1000123 while something like 12,34 was treated as two values 12 and 34 as expected. I never met such things before, working mostly under EN-US/RU-RU locales.

Edit: I gave not the best example, cause seeing triple ‘000’ one can assume it’s part of something bigger, but real values were random, it was only character quantity what’s matter. If it was 3, it was considered part of bigger number, if it was 2 or 4 or 5 it was considered separate values.

1 Like

No, i change value by arrow so it can’t be a typo. + blender don’t allow me type “,” sign in number :slight_smile:

I can handle value more generic (Integer, Float and etc is subtype of Number) by

Number mass = node.getUserData("mass");
System.out.println(mass.intValue());     // 0
System.out.println(mass.floatValue());  // NaN

But same problem. With some floats number (example 6.860) float is NaN, but with 6.870 value in code is 6.8700004.