luxcorerender / blendluxcore Goto Github PK
View Code? Open in Web Editor NEWBlender Integration for LuxCore
License: GNU General Public License v3.0
Blender Integration for LuxCore
License: GNU General Public License v3.0
We could create temporary files in bpy.app.tempdir instead of the python default directory.
E.g. in the image exporter (export/image.py).
Not very important, I think it could be useful for users who want tempfiles to be created on some special disk/partition.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Support Blender's local view: https://blender-manual-i18n.readthedocs.io/ja/latest/getting_started/basics/navigating/global_or_local_view.html
It seems to already work when done once, but when you switch local view off/on a couple of times it stops to work.
Currently UV-mapped images are upside down.
2D mapping is implemented.
See screenshot and scene:
border_2.blend.zip
Only happens with some resultions/border settings.
Only re-export a mesh if it has changed.
edit: this is implemented.
The call to Exporter._update_config(self, session, config_props)
crashes Blender with a SIGSEV.
Sometimes it hangs first.
Not sure if I'm using Blender or LuxCore wrong or if there's a deeper bug hidden here.
def _update_config(self, session, config_props):
# TODO: hangs/crashes blender...
renderconfig = session.GetRenderConfig()
session.Stop()
renderconfig.Parse(config_props)
if renderconfig is None:
print("ERROR: not a valid luxcore config")
return
session = pyluxcore.RenderSession(renderconfig)
session.Start()
band
blender_blend
blender_clouds
blender_distortednoise
blender_magic
blender_marble
blender_musgrave
blender_stucci
blender_wood
blender_voronoi
brick
checkerboard3d
constfloat1
constfloat3
dots
fbm
hitpointalpha We won't expose this, Blender vertex colors have no alpha anyway. We only use it implicitly in the pointiness node.
hitpointcolor
hitpointgrey
hsv
imagemap
marble
windy
wrinkled
blackbody
irregulardata
lampspectrum
Fresnel Textures
Colormix (color in/outputs):
Math (float in/outputs):
W10 / HD7970 /i7 6700k
*Nothing special the viewport preview just get an useless update
Just resize your sun or lamp (area lamp not considered) in while render preview is working
windows 10, NVIDIA GTX 1080 + GTX 780
Blender version: 2.79
LuxCore version: 2.0 alpha, 09e8e78
ERROR: Reference to an undefined NamedObject name: Glass__Material_nodeMat_Mat_Nodes__002_mat
Traceback (most recent call last):
File "F:\Users\Michael\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\engine\__init__.py", line 142, in view_update_lux
self._session = self._exporter.create_session(self, context.scene, context)
File "F:\Users\Michael\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\export\__init__.py", line 203, in create_session
luxcore_scene.Parse(scene_props)
RuntimeError: Reference to an undefined NamedObject name: Glass__Material_nodeMat_Mat_Nodes__002_mat
If a mix material is used in combination with volumes the mix material definition happens before the input materials. That results in an error.
use mix material with volumes, e.g. the following material node tree
converting object: Cube.022
converting mesh: Cube.025
nodeMatSURFACE
scene.volumes.Volume__Node__Tree__004SHADER.emission = 0 0 0
scene.volumes.Volume__Node__Tree__004SHADER.ior = 1.4950000047683716
scene.volumes.Volume__Node__Tree__004SHADER.type = "clear"
scene.volumes.Volume__Node__Tree__004SHADER.absorption = 3.7987448098447238 0.87892013825335269 3.4369541083131394
scene.materials.nodeMatSURFACE.volume.interior = "Volume__Node__Tree__004SHADER"
scene.materials.Glass__Material_nodeMat_Mat_Nodes__002_mat.kt = 1 1 1
scene.materials.Glass__Material_nodeMat_Mat_Nodes__002_mat.type = "glass"
scene.materials.Glass__Material_nodeMat_Mat_Nodes__002_mat.kr = 1 1 1
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.kd = 0.69999998807907104 0.69999998807907104 0.69999998807907104
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.vroughness = 0.05000000074505806
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.ks = 0.05000000074505806 0.05000000074505806 0.05000000074505806
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.type = "glossy2"
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.d = 0
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.ka = 0 0 0
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.uroughness = 0.05000000074505806
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.multibounce = 0
scene.materials.nodeMatSURFACE.amount = 0.5
scene.materials.nodeMatSURFACE.material1 = "Glass__Material_nodeMat_Mat_Nodes__002_mat"
scene.materials.nodeMatSURFACE.type = "mix"
scene.materials.nodeMatSURFACE.material2 = "Glossy__Material_nodeMat_Mat_Nodes__002_mat"
E.g. the rendered samples, samples/sec, amount of tris etc.
The basic structure is there, but we need more tests.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Todo:
Implement hair export
Test and verify
Prevent "singular matrix in matrixinvert" error (can happen with kempt hair, probably when a hair strand is compressed into a single point) - maybe add a small epsilon to all hair coordinates?
Accelerate with LuxCore C++ function?
Seems like accelerating this with C++ is a lot of work, because we need the co_hair() method of the particle system class.
We would either have to link against blender (haha) or re-implement this function in our code.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Also overhaul noise halt conditions UI (tiles) and add support for batch.haltthreshold etc.
https://wiki.luxcorerender.org/LuxCore_SDL_Reference_Manual_v2.0#Rendering_halt_conditions
Todo:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
A wrong min epsilon value can often lead to artifacts (e.g. z-fighting).
Make sure the default value works well in almost all situations.
If this is not possible, provide several easy-to-use presets with descriptions, or auto-scale it with scene size.
Also investigate if we can make the "material" viewport mode work correctly.
Todo:
I managed to implement Color Management support for the viewport, so viewport and final render now both have Blender Col. Management applied to them.
However, the final render was still too bright, so I currently make it darker in LuxCore imagepipeline.
I'm also not sure if Blender expects a tonemapped LDR image, a tonemapped HDR or a untonemapped HDR from the render engine, I could not find anyhting about this in the Blender docs.
Open viewport render preview change your material name (eg "Or" to "gold") then play with node settings it wann't update in the viewport preview
We are using the material.name property as a key.
Maybe we can use something else that does not change when the material is renamed.
Maybe the memory address? It changes only on undo/redo, but in this case the whole viewport render is deleted and re-started anyway.
Related: LuxCoreRender/LuxCore#44
This would make IES file usage more portable (e.g. you could pack them in the .blend if you want to distribute it later - good for example scenes).
Maybe we would need to add support for inlined text to the IES socket of LuxCore lights for this to work. Or we always save the text to a temp file on export.
Add a button to the user preferences that downloads the latest BlendLuxCore release and replaces the addon.
Maybe add a check if the current addon directory is a symbolic link so I don't accidentally my dev environment anymore...
Described here: https://wiki.luxcorerender.org/BlendLuxCore_Installation
Sometimes viewport render continues to run after it was cancelled in Blender (by setting viewport shading to something else than "RENDERED").
The same old problem... even though I followed the Cycles implementation this time.
See my question and answer here: https://blender.stackexchange.com/questions/100791/how-to-use-the-new-render-pass-api-for-an-external-renderer
Importing DEPTH took 0.368s
Importing UV took 0.647s
Importing ALPHA took 0.391s
BY_MATERIAL_ID etc. are not part of this issue, for those see #230
The issue is described here:
https://forums.luxcorerender.org/viewtopic.php?f=5&t=9&start=80#p493
It makes more difficult e.g. to associate a texture to a modifier (can be done by switching to a different render engine).
It seems to be possible.
See:
blender/release/scripts/addons/modules/snap_context/mesh_drawing.py
Problem: Can't create a NULL offset needed for glVertexAttribPointer and glDrawElements... https://lists.blender.org/pipermail/bf-committers/2016-March/046880.html
Possible workaround: use PyOpenGL: https://blenderartists.org/forum/showthread.php?401171-Vertex-Buffer-Object-with-bgl
What I want to replicate: Device::draw_pixels
function in cycles/device/device.cpp
maybe it works without NULL pointers? too tired right now.
This is probably a bug in Blender, see https://developer.blender.org/T53509
If this is not fixed when we want to do a first release we will have to find a workaround.
I mean, you can delete objects. But currently they are not deleted in the LuxCore session.
Here's how I did it in LuxBlend: https://bitbucket.org/luxrender/luxblend25/src/10dd12c045d79530acf763642af28e1180903e11/src/luxrender/core/__init__.py?at=default&fileviewer=file-view-default#__init__.py-2455
if update_changes.cause_objectsRemoved:
for ob in update_changes.removed_objects:
key = get_elem_key(ob)
if ob.type == 'LAMP':
if key in self.luxcore_exporter.light_cache:
# In case of sunsky there might be multiple light sources, loop through them
for exported_light in self.luxcore_exporter.light_cache[key].exported_lights:
luxcore_name = exported_light.luxcore_name
if exported_light.type == 'AREA':
# Area lights are meshlights and treated like objects with glowing materials
luxcore_scene.DeleteObject(luxcore_name)
else:
luxcore_scene.DeleteLight(luxcore_name)
else:
if key in self.luxcore_exporter.object_cache:
# loop through object components (split by materials)
for exported_object in self.luxcore_exporter.object_cache[key].exported_objects:
luxcore_name = exported_object.luxcore_object_name
luxcore_scene.DeleteObject(luxcore_name)
Steps to reproduce:
https://docs.blender.org/api/2.79/bpy.types.RenderEngine.html?highlight=renderengine#bpy.types.RenderEngine.end_result
end_result now has a highlight argument - test if it's suitable or if we should continue to use the old pixel color method.
Edit: does not look like this is usable for us, we'll probably use the same method as in LuxBlend (directly draw into the result pixels).
only use instancing for
See my previous attempt at fixing this issue:
3e030af (reverted)
Unfortunately this crashes Blender, probably because we're manipulating bpy.data in the wrong context or something.
Have to find another way to save a packed image without applying the exposure etc. from the color management settings of the current scene.
Sometimes when quitting Blender, I get this message:
LuxCoreRenderEngine del
Exception ignored in: <bound method LuxCoreRenderEngine.__del__ of <bpy_struct, LuxCoreRenderEngine invalid>>
Traceback (most recent call last):
File "/home/simon/.config/blender/2.79/scripts/addons/BlendLuxCore/engine/__init__.py", line 25, in __del__
if hasattr(self, "_session") and self._session:
ReferenceError: StructRNA of type LuxCoreRenderEngine has been removed
edit: seems to be related to exception handling, it happens sometimes when exceptions were handled in the engine's render method.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Generic addon-wide image export with support for
See https://docs.blender.org/api/2.79/bpy.types.Image.html#bpy.types.Image
Todo:
See https://wiki.blender.org/index.php/Dev:2.8/Source/Python/UpdatingScripts (section "Naming").
Currently we get a bunch of warnings in our travis tests because of this:
========================================
full_export.test
========================================
found bundled python: /home/travis/build/LuxCoreRender/BlendLuxCore/tmp/blender/2.79/python
libdc1394 error: Failed to initialize libdc1394
Warning: 'LuxCoreLens' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDepthOfField' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreMotionBlur' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreConfig' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDeviceSettings' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDisplaySettings' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreErrorLog' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreHaltConditions' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampPerformance' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampVisibility' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreMaterialHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCorePostProcessing' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldSky2' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldInfinite' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldPerformance' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldVisibility' doesn't contain '_PT_' with prefix & suffix
pyluxcore version: 2.0alpha1
Read blend: /home/travis/build/LuxCoreRender/BlendLuxCore/tests/./full_export/full_export.test.blend
...
I think it only concerns UI classes.
Todo:
Warning: 'LuxCoreLens' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDepthOfField' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreMotionBlur' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreConfig' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDeviceSettings' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDisplaySettings' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreErrorLog' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreHaltConditions' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampPerformance' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampVisibility' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreMaterialHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCorePostProcessing' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldSky2' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldInfinite' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldPerformance' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldVisibility' doesn't contain '_PT_' with prefix & suffix
Every property that is not absolutely, mind-boggingly obvious should have a description.
And the description must not be equal to the name of the property!
Also, please try to put yourself into the mind of a new user a bit. Stuff like "Absorption Depth (nm)" or "Sigma" might be obvious to a long-term Lux user, but not to newcomers.
I'm also considering putting links to the wiki in the more complex places, e.g. the carpaint material is basically impossible to tune if you don't have the wiki article open on the side.
Example: 0b043e2
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
System Information
windows 10, NVIDIA GTX 1080 + GTX 780
Software Version
Blender version: 2.79, 850f736,
LuxCore version: 2.0 alpha1, 9b3ae91
Short description of error
The plane of an area light is not exported correctly in final render mode. In viewport rendering everything is fine.
Exact steps for others to reproduce the error
Add an area light visible in the camera view and hit F12.
Viewport render:
Ryzen 1800x, RX480 8GB
My polygon with hard edges are now smooth and round. Should have hard define edges.
Use Suzanne and messing with Auto Smooth and degree threshold. Doesn't seem to do anything.
BlendLuxCore wiki pages are collected in a category: http://wiki.luxcorerender.org/Category:BlendLuxCore
The pages should have this code at the end to be put in the category:
[[Category:BlendLuxCore]]
Todo:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.