Jump to content

Unpredictable mesh import


AcidJuice
 Share

You are about to reply to a thread that has been inactive for 4176 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Wow... you know what ?

 

I did change my language to english (it was in french before)... and after more than 20 imports all seem to be ok !!

 

Surely, I'll retry a bit later (this evening or tomorrow) because i had before such a good luck that all seemed to be ok and at last was not...

 

And of course, I will tell you the result !!

 

I cross my fingers !! (i dont know if this expression has any meaning in english ?? ^^

 

Gaia, you talked about "42".. .what did you mean ?

 

I'll post later to tell you if this is stable or not.. but many many thanks to all anyway !

Link to comment
Share on other sites

  • Replies 90
  • Created
  • Last Reply

Top Posters In This Topic

Hello all,

 

Well, since yesterday with my settings in english, i did three series of tests (more thant 30 imports on different meshes each time... so about a hundred in total).

 

It still works !!

 

I will test again during the day...

 

Of course this is very strange. I can understand that some library somewhere on my computer gives a bad number conversation due to the localization... But why so randomly ?

 

Anyway, I am very happy :) : my meshes import well and i now know what is 42 ^^

 

Again many many thanks to all here :)

 

Lemon

 

Link to comment
Share on other sites

Hello

 

I searched a lot about '.' and ','

 

In fact, the viewers (at least firestorm) use a collada library. That can be see here http://hg.phoenixviewer.com/phoenix-firestorm-lgpl/file/2a2665ec6d99/indra/newview/llfloatermodelpreview.cpp

 

And when you search for the collada library, you found it on sourceforge here http://sourceforge.net/projects/collada-dom/?source=dlp

 

Having that, i found the way this collada library reads the data in the file. This is in daeAtomicType.cpp around the line 537.

This function daeBool daeDoubleType::stringToMemory(daeChar *src, daeChar* dstMemory) uses a 'scanf' function to read doubles.

And... going to Microsoft documentation you can read "The versions of these functions with the _l suffix are identical except that they use the locale parameter passed in instead of the current thread locale."

 

So... scanf (and so all the dae reader) may use local settings to interpret the values...

This is really coherent, at least, with http://forums.jeuxonline.info/showthread.php?p=25871588#post25871588 when you read Aniki Seetan post on the begining of the page.

 

So... if i am correct, that could be interesting to report this information to developpements teams... but i dont know how ?

 

Cheers,

Lemon

 

[Edit : all that could be some clue for the real solution, but that's not a complete explication for all... I mean, certainly some vertices are good anyway...]

[Edit : by the way, I tested again (still with english settings) and had again no problem at all]

 

 

 

Link to comment
Share on other sites


AcidJuice wrote:

 

So... if i am correct, that could be interesting to report this information to developpements teams... but i dont know how ?

 
 

I added a comment about your findings to the original issue at VWR-29033 and also poked Nicky Dasmijn, who is one of the Firestorm developers.

Link to comment
Share on other sites

My collada files are generated by Blender with english settings. The files contains dots '.' as decimal separators.

 

I really dont know if a french version of blender (i dont have one) may generate commas instead of dots. And anyway, i am not sure that this kind of files (collada files) format is really supposed to be localization dependent...

 

If the hypothesis of the scanf function is good, that does not explain why all this randomly occurs, and when it occurs why all vertices are not impacted (looking at a collada file, you will see that almost all vertices correspond to decimal values) ! ^^

Link to comment
Share on other sites

Hello Whirly,

 

I have read the answer given by Sabanco here https://jira.secondlife.com/browse/VWR-29033

 

I am not sure i understood him well. But few more indications about what i have found :

 

- Scanf result is not checked in the collada libray (daeAtomicType.cpp i mentioned before). So if it fails, the resulting value may certainly be 0, or at least not the expected value

 

- I have found a microsoft scanf implementation ! Not sure that the good one for me (many things on the web about that).

But if i am correct, this is in the file 'input.c'. Here you can find the reading sequence of a floating point number (around line 1136 in my file... but it seems that i cannot upload this file here).

To say short :

      - It reads the sign (if exists)

      - It read the integer part

      - It checks for a decimal separator

      - and read the decimal part and exponant if they exist

But... if i am correct, if the decimal separator is not recognized (and this seperator is dependent on the local settings and on the file encoding format), the result will be truncated to the integer part and no error will be returned.

After that i dont know if this 'shifts' the sequence of values in the dae arrays (as the decimal part is not read if the separator is not recognized).

 

Well... i dont know where to search more...

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4176 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...