-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LuxCore property number to string conversion is affected by locale #390
Comments
As Dade said here: LuxCoreRender/BlendLuxCore#477 (comment)
|
@Dade916 Can we maybe use a custom number to string function that is not affected by the locale or C library? |
But it is a bit strange, first of all, ID are unsigned int so -1 isn't a valid number, wasn't it used in BlendLuxCore to mark the default (random) assigned values ? I assume -1 should be exported as 2^32 = 4294967296. Anyway @kintuX, are you sure the problem doesn't happen if if you use a value like 1000 ? I have the feeling it will be printed as "1,000". |
Yes, it does that. Prints with commas ---> 1000 = 1,000 |
But it should work anyway, I mean: I write and read the number with the same library, it should be able to read what it writes. This may be some kind of side effect of some Blender setting. LuxCore standalone expect the number in "C" locale format (without "," or ".", as it should be) while LuxCore inside Blender starts to print numbers with ",". Blender must use a different locale. I will try to figure out a solution. But it is problematic, all the "locale" idea is considered totally broken and useless. It is a global application setting and, as you see, it does a mess most of the times. |
I think we can show a warning in the addon before rendering if the language is set to something other than "Automatic".
It really looks like this is a Blender problem, but it could be a problem when LuxCore is embedded in other applications, too. In my opinion it would be best to use a string conversion that doesn't depend on the locale. |
I pushed a tentative fix to the problem. It is, for the moment, limited to properties but it should fix the problem described in this issue. @kintuX, can you try if it works now with the "automatic" setting ? |
Related to #103 |
With "Automatic" it was already working. The issue was with "English" or other Languages set. and Sorry for the late reply I was "off-grid" Edit 1 Found out the scene I was testing on got corrupt. So I made a new one. Result: |
I'm starting to have the feeling the problem may be in BlendLuxCore: @Theverat can you check if the material.id property is set as number and not as string ? I mean, if Blender gives the string "1,000" to BlendLuxCore and BlendLuxCore sets the property value as string, and not as a number, LuxCore will print the string "1,000". @kintuX, are you just setting language to "English" to replicate the problem ? Do you have default language/nation related system settings ? |
@Dade916 Yes, I only switch in Blender from Automatic to English. I have Windows sytem using default language English US but with International Standard (metric units, date, CET time, EU number punctuation, € currency...) I also suspect it's BlendLuxCore issue. BTW, I think @Theverat is away for a week. |
I'm starting to think to a BlendLuxCore problem because it is quite strange to see this problem only with material.id while all other numbers seem to be printed fine. |
It is set as integer, as far as I can see. |
I'm trying to replicate the problem, my Blender "Preference Editor > Interface > Translation > Language" was already set to "English" and it works fine. I assume there is something in @kintuX OS setting causing the problem. |
Here are another strange cases, files showing same issues, but aren't any commas present (already replaced w/ periods)... |
As far as I know, this problem as been fixed (the relative discussion was on our forum). |
See issue LuxCoreRender/BlendLuxCore#477
.blend file: https://github.com/LuxCoreRender/BlendLuxCore/files/4728948/PointLightBanding-BUG.zip
Steps to reproduce:
Set Object or Material ID to -1.
Export/Write scene using LuxCore Filesaver as Text.
Load the scene file w/ LuxCoreUI
Error message from LuxCoreUI console:
RenderConfig loading error: bad lexical cast: source type value could not be interpreted as target
OS: W10
Blender version: 2.83
LuxCore version: 2.4 beta2 (e15e45c)
BlendLuxCore version: 2.4beta2 (8e6ca69)
The text was updated successfully, but these errors were encountered: