manually doing .BCF generation.

Use this forum for general user support and related questions.
Post Reply
MineElectricity
Posts: 2
Joined: Sat Aug 01, 2020 8:57 am

manually doing .BCF generation.

Post by MineElectricity » Sat Aug 01, 2020 9:05 am

Hi,

I have a project too big for blender, so I presently generate .ply, .scn and .cfg files using a script.
The problem being that I have way too many files and I loose considerable amounts of time in IO operations.

Thus, I would like to know how to directly make .bcf files, but I couldn't find any documentation.
My supposition was that it simply is .cfg followed by .scn and then by all the .ply written in binary and then compressed. But as pointed out on the discord server I may be wrong.

So if I could have a little help on how to write such files it would be greatly appreciated, otherwise I would do it by testing byte by byte an already generated .bcf file.

Thank you !

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

Re: manually doing .BCF generation.

Post by Dade » Sat Aug 01, 2020 11:39 am

MineElectricity wrote:
Sat Aug 01, 2020 9:05 am
I have a project too big for blender, so I presently generate .ply, .scn and .cfg files using a script.
The problem being that I have way too many files and I loose considerable amounts of time in IO operations.

Thus, I would like to know how to directly make .bcf files, but I couldn't find any documentation.
My supposition was that it simply is .cfg followed by .scn and then by all the .ply written in binary and then compressed. But as pointed out on the discord server I may be wrong.

So if I could have a little help on how to write such files it would be greatly appreciated, otherwise I would do it by testing byte by byte an already generated .bcf file.
LuxCore has specific render engine to save scenes as text or binary format: it is called FILESAVER and the render just produces the files.

You can convert from any supported format (.cfg, .lxs, ect.) in binary format with the following command:

Code: Select all

pyluxcoretools.exe console -D renderengine.type FILESAVER -D filesaver.format BIN -D filesaver.filename exported-scene.bcf scenes/cornell/cornell.cfg
Or, if you are using a script to create the scene, you can directly save the scene in binary format. LuxCore API as explicit methods for this process (aside FILESAVER render engine).

LuxCore .bcf format in a serialization of memory scene using Boost serialization process, the output is pipelined with gzip to compress the output in roder to save space.
.bcf format is intended as a temporary format so it supported only across LuxCore tools of the very same version.

Boost serialization (and gzipping) may be a not particularly fast process so I'm not sure if it is really going to accelerate your process however copy around a single self-contained binary file is a lot easier and faster than many text files.
Support LuxCoreRender project with salts and bounties

MineElectricity
Posts: 2
Joined: Sat Aug 01, 2020 8:57 am

Re: manually doing .BCF generation.

Post by MineElectricity » Sun Aug 02, 2020 8:39 am

Hi and thank you for your quick response.

Code: Select all

Or, if you are using a script to create the scene, you can directly save the scene in binary format. LuxCore API as explicit methods for this process (aside FILESAVER render engine).
That is exactly what I am doing, though, I don't fully understand how to use LuxCore API's explicit methods, so I'll try to figure it out and come back to you if I'm really stuck, thank you.

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

Re: manually doing .BCF generation.

Post by Dade » Sun Aug 02, 2020 8:46 am

MineElectricity wrote:
Sun Aug 02, 2020 8:39 am
That is exactly what I am doing, though, I don't fully understand how to use LuxCore API's explicit methods, so I'll try to figure it out and come back to you if I'm really stuck, thank you.
You have just to use RenderConfiog::Save() method: https://github.com/LuxCoreRender/LuxCor ... re.h#L1209
Support LuxCoreRender project with salts and bounties

Post Reply