BlendLuxCore Development

Discussion related to the Engine functionality, implementations and API.
Post Reply
User avatar
B.Y.O.B.
Developer
Posts: 1464
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: BlendLuxCore Development

Post by B.Y.O.B. » Mon Jan 08, 2018 12:00 pm

A fix for https://github.com/LuxCoreRender/BlendLuxCore/issues/12 is now in Blender master, starting tomorrow you can download a patched Blender from https://builder.blender.org/download/
Then I'll remove the workaround.
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1231
Joined: Mon Dec 04, 2017 8:36 pm

Re: BlendLuxCore Development

Post by Dade » Mon Jan 08, 2018 12:20 pm

Does BlendLuxCore supports Blender command line options ? I'm particularly interested to the options for "rendering" (i.e. FILESAVER) a single frame in an animation.
This would allow me to achieve 2 particularly interesting results:
  • have native support for .blend files in tools like pyluxcoreconsole, pyluxcoremerge, pyluxcorenet, etc.
  • use .blend as a compact animation file format (for instance to transfer a complete animation over the network, instead of the scenes of all frames).
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1464
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: BlendLuxCore Development

Post by B.Y.O.B. » Mon Jan 08, 2018 12:45 pm

Dade wrote:
Mon Jan 08, 2018 12:20 pm
Does BlendLuxCore supports Blender command line options ?
You mean these? https://docs.blender.org/manual/en/dev/ ... _line.html
Yes, they are supported.

For example, render the 3rd frame in the file "linktest.blend":

Code: Select all

./programs/blender-2.79-linux-glibc219-x86_64/blender -b Projekte/BlendLuxCore_tests/linktest.blend -f 3

Read prefs: /home/simon/.config/blender/2.79/config/userpref.blend
found bundled python: /home/simon/programs/blender-2.79-linux-glibc219-x86_64/2.79/python
pyluxcore version: 2.0alpha0
Applying workaround for Blender bug...
Reassigned node tree of material Material.001 to point to <bpy_struct, luxcore_material_nodes("ground_Mat_Nodes")>
Reassigned node tree of material Material to point to <bpy_struct, luxcore_material_nodes("Material")>
Reassigned node tree of material Material to point to <bpy_struct, luxcore_material_nodes("Material")>
Read blend: /home/simon/Projekte/BlendLuxCore_tests/linktest.blend
Info: Read library:  '/home/simon/Projekte/BlendLuxCore_tests/luxball/luxball_luxcore_dispersion.blend', '//luxball/luxball_luxcore_dispersion.blend', parent '<direct>'
Applying workaround for Blender bug...
Reassigned node tree of material Material.001 to point to <bpy_struct, luxcore_material_nodes("ground_Mat_Nodes")>
Reassigned node tree of material Material to point to <bpy_struct, luxcore_material_nodes("Material")>
Reassigned node tree of material Material to point to <bpy_struct, luxcore_material_nodes("Material")>
Reassigned node tree of material luxball to point to <bpy_struct, luxcore_material_nodes("luxball_Mat_Nodes")>
init
exporter init
Fra:3 Mem:55.73M (0.00M, Peak 55.73M) | Time:00:00.00 | exporting...
create_session
[SDL][0.029] Camera type: perspective
[SDL][0.029] Camera position: Point[-0.0160096, -0.228889, 0.14597]
[SDL][0.029] Camera target: Point[-0.0117613, 0.702159, -0.218901]
[SDL][0.029] Camera clipping plane disabled
Fra:3 Mem:55.73M (0.00M, Peak 55.73M) | Time:00:00.00 | Object: Plane (2/5)
converting object: Plane
converting mesh: Plane
Fra:3 Mem:55.73M (0.00M, Peak 55.74M) | Time:00:00.00 | Object: Sphere (3/5)
converting object: Sphere
converting mesh: Sphere
Fra:3 Mem:55.73M (0.00M, Peak 57.13M) | Time:00:00.00 | Object: Sphere.001 (4/5)
converting object: Sphere.001
converting mesh: Sphere.001
Fra:3 Mem:55.73M (0.00M, Peak 57.13M) | Time:00:00.01 | Object: Luxball (5/5)
converting object: Luxball
converting mesh: Luxball
Fra:3 Mem:55.73M (0.00M, Peak 67.03M) | Time:00:00.03 | World
[SDL][0.062] Volume definition: Volume__Node__TreeSHADER
[SDL][0.064] Material definition: Material__001SURFACE
[SDL][0.064] Material definition: MaterialSURFACE
[SDL][0.064] Material definition: luxballSURFACELib
[SDL][0.066] Scene objects count: 4
[SDL][0.066] Light definition: __WORLD_BACKGROUND_LIGHT__
[LuxCore][0.066] Configuration: 
[LuxCore][0.066]   film.outputs.1.filename = "RGB_IMAGEPIPELINE.png"
[LuxCore][0.066]   film.width = 1920
[LuxCore][0.066]   film.outputs.1.type = "RGB_IMAGEPIPELINE"
[LuxCore][0.066]   film.imagepipeline.1.scale = 0.44444444444444442
[LuxCore][0.066]   film.imagepipeline.1.type = "TONEMAP_LINEAR"
[LuxCore][0.066]   sampler.type = "METROPOLIS"
[LuxCore][0.067]   light.maxdepth = 12
[LuxCore][0.067]   path.maxdepth = 12
[LuxCore][0.067]   film.height = 1080
[LuxCore][0.067]   film.imagepipeline.0.type = "TONEMAP_AUTOLINEAR"
[LuxCore][0.067]   renderengine.type = "BIDIRCPU"
[LuxCore][0.067]   film.filter.type = "BLACKMANHARRIS"
[LuxCore][0.067]   film.filter.width = 1.5
Fra:3 Mem:55.73M (0.00M, Peak 67.03M) | Time:00:00.04 | Creating session
[LuxCore][0.067] Film resolution: 1920x1080
[SDL][0.068] Film output definition: RGB_IMAGEPIPELINE [image.png]
[SDL][0.068] Image pipeline: film.imagepipeline
[SDL][0.068] Image pipeline step 0: TONEMAP_AUTOLINEAR
[SDL][0.068] Image pipeline step 1: TONEMAP_LINEAR
[SDL][0.068] Film output definition: RGB_IMAGEPIPELINE [RGB_IMAGEPIPELINE.png]
[LuxRays][0.068] Device 0 name: NativeThread
[LuxRays][0.068] Device 0 type: NATIVE_THREAD
[LuxRays][0.068] Device 0 compute units: 1
[LuxRays][0.068] Device 0 preferred float vector width: 4
[LuxRays][0.068] Device 0 max allocable memory: 0MBytes
[LuxRays][0.068] Device 0 max allocable memory block size: 0MBytes
[LuxRays][0.068] Preprocessing DataSet
[LuxRays][0.068] Total vertex count: 47549
[LuxRays][0.068] Total triangle count: 93762
[LuxRays][0.069] Preprocessing DataSet done
[LuxRays][0.081] Creating 8 intersection device(s)
[LuxRays][0.081] Allocating intersection device 0: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Allocating intersection device 1: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Allocating intersection device 2: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Allocating intersection device 3: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Allocating intersection device 4: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Allocating intersection device 5: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Allocating intersection device 6: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Allocating intersection device 7: NativeThread (Type = NATIVE_THREAD)
[LuxRays][0.081] Adding DataSet accelerator: EMBREE
[LuxRays][0.081] Total vertex count: 47549
[LuxRays][0.081] Total triangle count: 93762
[LuxRays][0.099] EmbreeAccel build time: 16ms
[LuxCore][0.099] Configuring 8 CPU render threads
Session created in 0.1s
Fra:3 Mem:55.73M (0.00M, Peak 67.03M) | Time:00:00.10 | Session created in 0.1s
Fra:3 Mem:55.73M (0.00M, Peak 67.03M) | Time:00:00.10 | Starting session...
Fra:3 Mem:55.73M (0.00M, Peak 67.03M) | Time:00:02.02 | Film refresh in 8s
Fra:3 Mem:55.73M (0.00M, Peak 67.03M) | Time:00:03.05 | Film refresh in 7s
Reached halt time: 2 seconds
Fra:3 Mem:55.73M (0.00M, Peak 67.03M) | Time:00:03.07 | Stopping session...
LuxCoreRenderEngine del
Fra:3 Mem:55.72M (0.00M, Peak 95.29M) | Time:00:04.78 | Sce: Scene Ve:0 Fa:0 La:0
Saved: '/home/simon/Projekte/BlendLuxCore_tests/0003.png'
 Time: 00:05.57 (Saving: 00:00.78)

LuxCoreRenderEngine del

Blender quit
Dade wrote:
Mon Jan 08, 2018 12:20 pm
use .blend as a compact animation file format (for instance to transfer a complete animation over the network, instead of the scenes of all frames).
I'm not sure that is a good idea. On geometry-heavy scenes with many modifiers, the overhead of exporting the meshes each frame can get very big I fear.
If you make a custom animation format, you can save non-animated meshes only once and save the export overhead.
Maybe you could even re-use your active scene for all frames and only update the animated meshes and imagemaps, which would also save a lot of preprocessing time on the start of each frame.
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1231
Joined: Mon Dec 04, 2017 8:36 pm

Re: BlendLuxCore Development

Post by Dade » Mon Jan 08, 2018 2:09 pm

B.Y.O.B. wrote:
Mon Jan 08, 2018 12:45 pm
You mean these? https://docs.blender.org/manual/en/dev/ ... _line.html
Yes, they are supported.

For example, render the 3rd frame in the file "linktest.blend":

Code: Select all

./programs/blender-2.79-linux-glibc219-x86_64/blender -b Projekte/BlendLuxCore_tests/linktest.blend -f 3
But is there a way to pass some option (i.e. custom properties) from command line to BlendLuxCore, for instance to switch from BIDIRCPU to FILESAVER render engine ?
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1464
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: BlendLuxCore Development

Post by B.Y.O.B. » Mon Jan 08, 2018 2:21 pm

You can pass a python script or python expressions to be evaluated on loading of the blend file.
For example, you could have the file "script.py":

Code: Select all

import bpy
bpy.context.scene.luxcore.use_filesaver = True
bpy.context.scene.luxcore.engine = "PATH"
(Note that the "use_filesaver" property is not implemented yet, I still have to add FILESAVER support to BlendLuxCore, it's just an example)
Have a look at the properties directory to see which properties can be set:
https://github.com/LuxCoreRender/BlendL ... properties

And then you would call Blender like this:

Code: Select all

./blender -b test.blend --python script.py
You can also execute expressions (no need to save a script file). From ./blender --help:

Code: Select all

-P or --python <filename>
	Run the given Python script file

--python-text <name>
	Run the given Python script text block

--python-expr <expression>
	Run the given expression as a Python script
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1464
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: BlendLuxCore Development

Post by B.Y.O.B. » Mon Jan 08, 2018 3:03 pm

Support for arbitrary clipping plane:
Attachments
scrn_2018-01-08_15-51-41.png
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1231
Joined: Mon Dec 04, 2017 8:36 pm

Re: BlendLuxCore Development

Post by Dade » Mon Jan 08, 2018 3:45 pm

B.Y.O.B. wrote:
Mon Jan 08, 2018 2:21 pm
You can pass a python script or python expressions to be evaluated on loading of the blend file.
For example, you could have the file "script.py":
Sounds good, it is going to be very handy.
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1464
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: BlendLuxCore Development

Post by B.Y.O.B. » Mon Jan 08, 2018 11:23 pm

I'm currently considering to write a C++ function in pyluxcoreforblender that exports a particle system.
Not sure if it's worth the time since particles (hopefully) get reworked in 2.8, but on the other hand it might take a year so until 2.8 comes out.
Guess I'll code a test to see if it is doable.
These seem to be the relevant Blender structs: https://github.com/dfelinto/blender/blo ... pes.h#L155

To my knowledge, these 3 areas are the most expensive to export:
  • Meshes (already accelerated in C++)
  • Particle/Hair systems
  • Smoke/Fire systems
Did I forget something?
In the future it might also be a good idea to accelerate Smoke/Fire export with C++, if enough people use that.
But before that we might need to improve the heterogeneous volume rendering code in LuxCore ;)
Support LuxCoreRender project with salts and bounties

neo2068
Developer
Posts: 85
Joined: Tue Dec 05, 2017 6:06 pm

Re: BlendLuxCore Development

Post by neo2068 » Tue Jan 09, 2018 7:53 pm

B.Y.O.B. wrote:
Mon Jan 08, 2018 12:00 pm
A fix for https://github.com/LuxCoreRender/BlendLuxCore/issues/12 is now in Blender master, starting tomorrow you can download a patched Blender from https://builder.blender.org/download/
Then I'll remove the workaround.
The new blender build uses python 3.6 and it is not compatible with the current pyluxcore build on windows.

Code: Select all

found bundled python: C:\Program Files\Blender Foundation\Blender\2.79\python
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\modules\addon_utils.py", line 331, in enable
    mod = __import__(module_name)
  File "F:\Users\Michael\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\__init__.py", line 2, in <module>
    from .bin import pyluxcore
ImportError: Module use of python35.dll conflicts with this version of Python.
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 1080 + GTX 780, Windows 10 64bit, Blender 2.79b
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1231
Joined: Mon Dec 04, 2017 8:36 pm

Re: BlendLuxCore Development

Post by Dade » Tue Jan 09, 2018 7:58 pm

Neo, it was discussed here: viewtopic.php?f=4&t=26

Apparently, they are building the daily builds in 2.8 environment so they use Python 3.6 however we assume the final release 2.79a will be done in 2.79 environment (so with Python 3.5).
Support LuxCoreRender project with salts and bounties

Post Reply