bad lexical cast on export from blender

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
nocivo
Posts: 17
Joined: Sun Jan 28, 2018 5:33 am
Location: Japan
Contact:

bad lexical cast on export from blender

Post by nocivo »

Hi,
I cannot export any scene from Blender to standalone luxcore. Always I have an error (bad lexical cast on volume reading). if I remove all volume, I have another error on light with ies file applied. With Blenderluxcore the render start normally and work.

I attach the Blender scene, the export scene and following luxcore standalone output.

please let me know if I do something wrong on export. I use linux blender 2.79b on fedora 27.

thanks a lot

Code: Select all

#./../../../luxcoreui render.cfg 
LuxCoreUI v2.0 (LuxCore demo: http://www.luxcorerender.org)
[LuxCore][0.000] Configuration: 
[LuxCore][0.001]   film.filter.width = "1.5"
[LuxCore][0.001]   light.maxdepth = "48"
[LuxCore][0.001]   lightstrategy.type = "LOG_POWER"
[LuxCore][0.001]   path.forceblackbackground.enable = "0"
[LuxCore][0.001]   path.maxdepth = "48"
[LuxCore][0.001]   filesaver.format = "TXT"
[LuxCore][0.001]   scene.epsilon.min = "9.9999997473787516e-06"
[LuxCore][0.001]   renderengine.seed = "1"
[LuxCore][0.001]   film.filter.type = "BLACKMANHARRIS"
[LuxCore][0.001]   film.width = "900"
[LuxCore][0.001]   film.height = "500"
[LuxCore][0.001]   sampler.type = "METROPOLIS"
[LuxCore][0.001]   renderengine.type = "BIDIRCPU"
[LuxCore][0.001]   scene.epsilon.max = "0.10000000149011612"
[LuxCore][0.001]   sampler.metropolis.imagemutationrate = "0.10000000000000001"
[LuxCore][0.001]   filesaver.renderengine.type = "BIDIRCPU"
[LuxCore][0.001]   sampler.metropolis.largesteprate = "0.40000000000000002"
[LuxCore][0.001]   sampler.metropolis.maxconsecutivereject = "512"
[LuxCore][0.001]   batch.halttime = "0"
[LuxCore][0.001]   batch.haltspp = "0"
[LuxCore][0.001]   batch.haltthreshold.stoprendering.enable = "0"
[LuxCore][0.001]   batch.haltthreshold = "0.0001"
[LuxCore][0.001]   film.imagepipelines.1.0.exposure = "0.48000001907348633"
[LuxCore][0.001]   film.imagepipelines.1.0.fstop = "12"
[LuxCore][0.001]   film.imagepipelines.1.0.sensitivity = "100"
[LuxCore][0.001]   film.imagepipelines.1.1.type = "GAMMA_CORRECTION"
[LuxCore][0.001]   film.imagepipelines.1.1.value = "2.2000000000000002"
[LuxCore][0.001]   film.imagepipelines.1.0.type = "TONEMAP_LUXLINEAR"
[LuxCore][0.001]   film.imagepipelines.0.1.type = "TONEMAP_LUXLINEAR"
[LuxCore][0.001]   film.imagepipelines.0.2.type = "GAMMA_CORRECTION"
[LuxCore][0.001]   film.imagepipelines.0.1.fstop = "12"
[LuxCore][0.001]   film.imagepipelines.0.1.sensitivity = "100"
[LuxCore][0.001]   film.imagepipelines.0.1.exposure = "0.48000001907348633"
[LuxCore][0.001]   film.imagepipelines.0.0.type = "NOP"
[LuxCore][0.001]   film.imagepipelines.0.2.value = "2.2000000000000002"
[LuxCore][0.001]   film.imagepipelines.1.radiancescales.0.enabled = "1"
[LuxCore][0.001]   film.imagepipelines.0.radiancescales.0.globalscale = "1"
[LuxCore][0.001]   film.imagepipelines.0.radiancescales.0.rgbscale = "1" "1" "1"
[LuxCore][0.001]   film.imagepipelines.0.radiancescales.0.enabled = "1"
[LuxCore][0.001]   film.outputs.1.type = "RADIANCE_GROUP"
[LuxCore][0.001]   film.outputs.1.filename = "RADIANCE_GROUP.exr"
[LuxCore][0.001]   film.outputs.0.filename = "RGB_IMAGEPIPELINE_0.png"
[LuxCore][0.001]   film.outputs.1.id = "0"
[LuxCore][0.001]   film.outputs.2.type = "RGB_IMAGEPIPELINE"
[LuxCore][0.001]   film.outputs.2.index = "1"
[LuxCore][0.001]   film.outputs.0.type = "RGB_IMAGEPIPELINE"
[LuxCore][0.001]   film.outputs.2.filename = "RGB_IMAGEPIPELINE_1.png"
[LuxCore][0.001]   film.outputs.0.index = "0"
[LuxCore][0.001]   scene.file = "scene.scn"
[SDL][0.001] Reading scene: scene.scn
[SDL][0.002] Texture definition: 140013299799560
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture-1e619634-60aa-4cbe-9125-dbe19c77f9f4
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-e0ff0524-f539-41a3-b2c5-223dc6ec773c
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-409ad6cc-ec69-41e7-b379-af02758e9075
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-535cfacf-7a44-417b-8007-7854ffb009e7
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-d127adac-6b8b-4937-93ae-1ed76a15374a
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-19e55f2c-7134-4248-bc24-16c5fe7af077
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-6dc732e1-e60c-40c3-9317-81095ca8b16b
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture-020e348a-b150-448f-9b7b-752826f3c3c3
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture-9acd6fc9-ec17-4d6c-9331-95248ee5abc0
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-a3cab7e4-8736-48ea-bb95-80e96a03453b
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-9d37d093-03c4-4af2-a342-854fa1453ba5
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-f052ade9-3c94-4709-8d2d-e91a78c0cc2a
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-32bbbd87-a32b-41ff-9fd4-b7252d3a66bf
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture-b3ce76d5-732f-4e69-bf6f-249e119d143c
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture3-f92b27b5-e93d-4111-a482-be281ef982f2
[SDL][0.002] Texture definition: Implicit-ConstFloatTexture-ea13c15e-0b99-4623-ad2e-f352765fb3ce
[SDL][0.002] Volume definition: 140013324774856
ERROR: bad lexical cast: source type value could not be interpreted as target
Attachments
spot-lens_1.zip
blender scene
(362.44 KiB) Downloaded 324 times
00001.zip
exported scene
(240.9 KiB) Downloaded 333 times
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: bad lexical cast on export from blender

Post by Dade »

nocivo wrote: Thu May 10, 2018 9:32 am I cannot export any scene from Blender to standalone luxcore. Always I have an error (bad lexical cast on volume reading). if I remove all volume, I have another error on light with ies file applied. With Blenderluxcore the render start normally and work.

I attach the Blender scene, the export scene and following luxcore standalone output.

please let me know if I do something wrong on export. I use linux blender 2.79b on fedora 27.
It smells like a locale related problem. Does Japan uses "," instead of "." as decimal separator ?

A "bad lexical cast" usually happen when you try to convert a string like "0.1" to a number but the system looks for "," instead of "." as decimal separator.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: bad lexical cast on export from blender

Post by Dade »

Uh, I'm getting the error here too, checking what it is :?:
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: bad lexical cast on export from blender

Post by Dade »

Dade wrote: Thu May 10, 2018 9:42 am Uh, I'm getting the error here too, checking what it is :?:
Ah, yes it is this:

Code: Select all

scene.volumes.140013324774856.type = "clear"
scene.volumes.140013324774856.absorption = "Implicit-ConstFloatTexture3-409ad6cc-ec69-41e7-b379-af02758e9075"
scene.volumes.140013324774856.priority = 0
scene.volumes.140013324774856.ior = "Implicit-ConstFloatTexture-1e619634-60aa-4cbe-9125-dbe19c77f9f4"
scene.volumes.140013324774856.id = 3,364,224
See the ".id" field ? The problem is present in all ".id" fields.

Can you try to set a US locale ?
Support LuxCoreRender project with salts and bounties
nocivo
Posts: 17
Joined: Sun Jan 28, 2018 5:33 am
Location: Japan
Contact:

Re: bad lexical cast on export from blender

Post by nocivo »

Can you try to set a US locale ?
on OS or Blender?
jensverwiebe
Supporting Users
Posts: 141
Joined: Tue Jan 09, 2018 6:48 pm

Re: bad lexical cast on export from blender

Post by jensverwiebe »

Since a long time i suspect something fishy in glfw ( x11_init.c):

Code: Select all

//////////////////////////////////////////////////////////////////////////
//////                       GLFW platform API                      //////
//////////////////////////////////////////////////////////////////////////

int _glfwPlatformInit(void)
{
    // HACK: If the current locale is C, apply the environment's locale
    //       This is done because the C locale breaks character input
    if (strcmp(setlocale(LC_CTYPE, NULL), "C") == 0)
        setlocale(LC_CTYPE, "");
Perhaps worth to investigate. I changed it for other linux ports to get out of lexical cast issues.

Jens
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: bad lexical cast on export from blender

Post by Dade »

nocivo wrote: Thu May 10, 2018 9:54 am
Can you try to set a US locale ?
on OS or Blender?
In Blender because the problem is during the export stage: there should no ",".
Support LuxCoreRender project with salts and bounties
nocivo
Posts: 17
Joined: Sun Jan 28, 2018 5:33 am
Location: Japan
Contact:

Re: bad lexical cast on export from blender

Post by nocivo »

Dade wrote: Thu May 10, 2018 10:31 am
nocivo wrote: Thu May 10, 2018 9:54 am
Can you try to set a US locale ?
on OS or Blender?
In Blender because the problem is during the export stage: there should no ",".
with imperial, metric and none, always have error. on OS the locale are settings to en_us.utf8

thanks
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: bad lexical cast on export from blender

Post by Dade »

nocivo wrote: Thu May 10, 2018 11:31 am with imperial, metric and none, always have error. on OS the locale are settings to en_us.utf8
You have to do some test to understand where the problem is. Try to run the following command inside the directory of LuxCoreRender standalone:

Code: Select all

mkdir test
luxcoreui -D renderengine.type FILESAVER -D filesaver.directory test  scenes/cornell/cornell.cfg
cat test/scene.scn | grep \.id
The result should be:

Code: Select all

scene.materials.Khaki.id = 3364224
scene.materials.Khaki.emission.id = 0
scene.materials.HalveRed.id = 6728256
scene.materials.HalveRed.emission.id = 0
scene.materials.DarkGreen.id = 10034367
scene.materials.DarkGreen.emission.id = 0
scene.materials.Light.id = 13398304
scene.materials.Light.emission.id = 0
Does any ".id" property shows a "," ?
Support LuxCoreRender project with salts and bounties
nocivo
Posts: 17
Joined: Sun Jan 28, 2018 5:33 am
Location: Japan
Contact:

Re: bad lexical cast on export from blender

Post by nocivo »

no ",". The output is the same of your. But the cornell scene is the only scene that start without error.

thanks
Post Reply