naxela / the_lightmapper Goto Github PK
View Code? Open in Web Editor NEWFast and easy baked GI Lightmaps for Blender and Cycles
License: GNU General Public License v3.0
Fast and easy baked GI Lightmaps for Blender and Cycles
License: GNU General Public License v3.0
This setup results in this error:
Warning: 1 x Draw Window and Swap: 14.8811 ms, average: 14.88110000 ms
BAKING:!
Traceback (most recent call last):
File "C:\Users\SK\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\The_Lightmapper-master\Addon\Operators\build.py", line 55, in modal
bake_run.bake_ordered(self, context, None)
File "C:\Users\SK\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\The_Lightmapper-master\Addon\Utility\bake_run.py", line 62, in bake_ordered
utility.check_compatible_naming(self)
File "C:\Users\SK\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\The_Lightmapper-master\Addon\Utility\utility.py", line 63, in check_compatible_naming
if "_" in slot.material.name:
AttributeError: 'NoneType' object has no attribute 'name'
location: <unknown location>:-1
Atlas postpacking mode doesn't keep existing UV layers if they're present.
Your toolset looks awesome. Would it be possible running it headless mode?
Something like this:
blender --background --python run_The_Lightmapper.py
Essentially I would like the script to import a gltf/obj file then do all of the magic that your tools do (unwrapping, baking etc) and then export a new gltf/obj file. I'll probably consume the output in babylon.js
I have the some error on linux install:
`Traceback (most recent call last):
File "/home/anfeo/.config/blender/2.83/scripts/addons/The_Lightmapper_master/Addon/Utility/cfilter.py", line 13, in
import cv2
ModuleNotFoundError: No module named 'cv2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/anfeo/blender281/2.83/scripts/modules/addon_utils.py", line 351, in enable
mod = import(module_name)
File "/home/anfeo/.config/blender/2.83/scripts/addons/The_Lightmapper_master/init.py", line 31, in
from . Addon import Operators, Panels, Properties, Preferences, Utility, Keymap
File "/home/anfeo/.config/blender/2.83/scripts/addons/The_Lightmapper_master/Addon/Operators/init.py", line 3, in
from . import build, clean, explore, encode, installopencv, gui, xBake, selection, additional, lighttools
File "/home/anfeo/.config/blender/2.83/scripts/addons/The_Lightmapper_master/Addon/Operators/build.py", line 3, in
from .. Utility import bake_run
File "/home/anfeo/.config/blender/2.83/scripts/addons/The_Lightmapper_master/Addon/Utility/bake_run.py", line 2, in
from . import denoise, objectconfig, lightbake, cfilter, encoding, ambientbake, utility
File "/home/anfeo/.config/blender/2.83/scripts/addons/The_Lightmapper_master/Addon/Utility/cfilter.py", line 16, in
pip
NameError: name 'pip' is not defined`
Investigate ways to blend seams together, or make them less apparent
Blender 2.91 provides a few breaking API changes that needs to be sorted out. These currently provide stopping bugs
I dont know why but when I try to build a lightmap it gives me this error
location: <unknown location>:-1
Error: Traceback (most recent call last):
File "C:\Users\Funky\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\thelightmapper\addon\operators\tlm.py", line 23, in invoke
build.prepare_build(self, False)
File "C:\Users\Funky\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\thelightmapper\addon\utility\build.py", line 70, in prepare_build
prepare.init(self, previous_settings)
File "C:\Users\Funky\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\thelightmapper\addon\utility\cycles\prepare.py", line 24, in init
configure_meshes(self)
File "C:\Users\Funky\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\thelightmapper\addon\utility\cycles\prepare.py", line 89, in configure_meshes
bpy.ops.object.select_all(action='DESELECT')
File "D:\SteamLibrary\steamapps\common\Blender\2.83\scripts\modules\bpy\ops.py", line 201, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.select_all.poll() failed, context is incorrect
location: <unknown location>:-1
I'm using the latest version of blender (steam)
More material checks for unsupported material setups, such as materials prepared for Blender internal render (from 2.79)
Add option to ignore material, even if it's part of an object marked for lightmapping. - Useful in case of emissive surfaces and surfaces with interior parallax geometry, so they don't have to be separated.
If an object is to designated to be lightmapped, but hidden - Error will occur: No valid selected objects
when i was install the addon give me this problem.
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\modules\addon_utils.py", line 351, in enable
mod = __import__(module_name)
File "C:\Users\DIO\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\The_Lightmapper-master\__init__.py", line 31, in <module>
from . addon import operators, panels, properties, preferences, utility, keymap
File "C:\Users\DIO\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\The_Lightmapper-master\addon\preferences\__init__.py", line 3, in <module>
from . import addon_preferences
File "C:\Users\DIO\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\The_Lightmapper-master\addon\preferences\addon_preferences.py", line 1, in <module>
import bpy, thelightmapper
ModuleNotFoundError: No module named 'thelightmapper'
See feature req #2: https://blenderartists.org/t/the-lightmapper-v0-3/1247359/12?u=naxela
Hi, i just recently found this addon, and really help, but my main problem is i can't get the OIDN denoiser working, how to use the OIDN? Where do i put OIDN Path?
I'm using windows 10, blender 2.83
Thank you
Add filtering as stacked list, allowing multiple filters to be used in terms of postprocessing.
Additional filters to be implemented:
Hello,
first of all great add-on ! I think if this is will be pushed a bit it will drastically improve the hole process of baking !
I was experimenting with your newest version (added some code to link the baked lightmap node to a gltfSettings node to export it to glb and use it in three js) and figured that the denoising doesn't work anymore cause the denoised image can't be found. I tried to use the pipe from an older version but I don't really understand whats going on here.
Old version just gives a black image, new version gives this error
I couldn't find the file in the Lightmaps folder so I guess it wasn't saved.
Could you help me ?
Currently, most is just stashed inside the utility file - Refactoring the addon is necessary in order to allow better development.
It would be nice if the addon could export to Open EXR as well. Many texture processing pipelines (such as ones using AMD's Compressionator) don't support .hdr files.
Hello, thank you for the awesome light-mapping addon!
I was wondering if it would be possible to disable the addon from overriding materials and instead just add an object property with the file-path of the associated lightmap.
Using the gltf addon you can export custom properties like that file path, unfortunately the current way the tool applies lightmaps can mangle gltf materials so that material overwrite needs to be disabled (yes I know that would mean no more previews).
By adding this option you can preserve exported materials and make lightmap associations more clear to import from a hobby rasterizer or small engine without affecting basic gltf materials.
Hopefully this can also be saved as a user preference to avoid accidentally breaking the materials in other files in this workflow.
Thanks!
Baking seems to have issues when using GPU with Optix. Probably a Blender bug, but make a soft check/change in case.
Investigate the possibility of adding external UV mapping interfaces for Blender addons such as UVPackmaster and RizomUV VS
Taking a default cube and setting metallic up to one results in a black lightmap.
Refactor and reorganize the caching system with proper cleaning
Refactor addon for separate moduling:
From my understanding, this term should always be pointing at the Material Output node. It does so most of the time correctly. But for some materials it points to a seemingly arbitrary node of the node tree. I modified utility.py starting at line 536 a bit to see what is going on:
for slot in obj.material_slots:
nodetree = bpy.data.materials[slot.name].node_tree
nodes = nodetree.nodes
print(slot.name)
#mainNode = nodetree.nodes[0].inputs[0].links[0].from_node
ab = nodetree.nodes[0]
print(ab)
ac = ab.inputs[0]
ad = ac.links[0]
mainNode = ad.from_node
This is the output, the first couple are for materials where no issues occur and then there is an error:
slot56_slot1_temp
<bpy_struct, ShaderNodeOutputMaterial("Material Output")>
slot60_slot1_temp
<bpy_struct, ShaderNodeOutputMaterial("Material Output")>
slot104_slot1_temp
<bpy_struct, ShaderNodeBump("Bump")>
Traceback (most recent call last):
File "C:\Users\SK\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\The_Lightmapper-master\Addon\Operators\build.py", line 52, in modal
utility.bake_ordered(self, context, None)
File "C:\Users\SK\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\The_Lightmapper-master\Addon\Utility\utility.py", line 1409, in bake_ordered
configure_objects(scene)
File "C:\Users\SK\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\The_Lightmapper-master\Addon\Utility\utility.py", line 545, in configure_objects
ad = ac.links[0]
IndexError: tuple index out of range
location: <unknown location>:-1
Rebuilding the regarding Material -> deleting the nodes and placing them in the exact same way again, fixes the issue for this Material!
Here a .blend where this occurs, the error should simply occur when you press Build Lightmaps.
https://drive.google.com/open?id=1Ys3pMuyKMM3GweP6X-hXO5H5gAo5lOJF
b2.81 Win10
This seems to happen when a change is made to a material on a light mapped object. Not sure what change was made, but I think it was a name change. Once this error showed up, light baking broke for one of the materials in question. This error only seems to appear when Don't apply materials is checked.
Additionally, completely deleting all material data (orphan data included) and remaking them all from scratch seemed to not fix the issue. I suspect the only option here is to recreate the file.
Edit: For reference, I am using Blender 2.9
Cleaning materials sometimes reverts to an empty material slot. Possibly introduced with 0.3.2.0.
Add options for lightmapping in terms of texel density, resolution options, and various approaches to atlas mapping
Make some more context poll check and warn when the context is wrong
When baking, turn off all baked materials while baking on a selection based routine - Make a list of baked materials, re-apply after baking.
Baking while other objects has baked materials will provide faulty results in strong light conditions.
After installing the add-on on Blender 2.83 and clicking the "Build Light for selected" button, the process crashes with this message:
File "C:\Users\Thomas\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\HDR_Lightmapper_init_.py", line 449, in execute
HDRLM_Build(self, context)
File "C:\Users\Thomas\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\HDR_Lightmapper_init_.py", line 1585, in HDRLM_Build
mainNode = nodetree.nodes[0].inputs[0].links[0].from_node
IndexError: tuple index out of range
It works with 2.82.
Find a way to begin map atlasing, preferably with atlas grouping based on object size and resolution
In the options for the individual objects, there are UV option. You can choose Smart, Lightmap, or Copy. Smart and Lightmap unfortunately produce the same broken result, where some faces are squeezed into zero-width/height faces on the UV map. Copy works fine. Win10 b2.81a
Add some video tutorials about how to get started with lightmapping surfaces and lighting conditions.
Add option for supersampling
Fix error where lighmaps aren't encoded during background baking (in UI), denoising works, filtering works, but error related to encoding with GPU, although should only be the case for LogLuv
When attempting to use Intel's OpenImageDenoise on Linux with Release 0.3 of The Lightmapper, the following error appears in the output log:
Denoiser search: /home/username/Downloads/oidn-1.2.3.x86_64.linux/bin/oidnDenoise.exe
/bin/sh: 1: /home/username/Downloads/oidn-1.2.3.x86_64.linux/bin/oidnDenoise.exe: not found
In Linux, executable files typically don't have any extension and are simply marked as executable. This is the case for OIDN, where the executable is simply named oidnDenoise
. Although the user could simply rename the file to oidnDenoise.exe
for a temporary workaround, it'd be nice to properly support Linux executables.
Right now the console information is messy
Store material links as properties - So cleaning materials allows for returning to materials with multiple users.
Hello,
I really like your addon and I would love to bake the textures with AWS to accelerate the process. Is it possible to use the command line to open the .blend file, adjust some settings like quality, filtering, .., bake the lightmap and save it as hdr?
Thanks for you me advise :)
Getting AO baking error when working with multiple objects.
Todo: Fix
Find some way to bake directional information (dominant light) to texture. Cycles and OSL doesn't work. Possibly as an external RTX module.
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.