Naxela / The_Lightmapper

Fast and easy baked GI Lightmaps for Blender and Cycles
GNU General Public License v3.0
707 stars 51 forks source link

Lightmap Path Properties Only Mode #19

Open KenzieMac130 opened 4 years ago

KenzieMac130 commented 4 years ago

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!

Naxela commented 4 years ago

If I've understood you correctly, you just want the lightmap to not automatically be added after baking, and instead just provide a link/property to the baked lightmap. Would a custom property suffice?, like:

billede

KenzieMac130 commented 4 years ago

If I've understood you correctly, you just want the lightmap to not automatically be added after baking, and instead just provide a link/property to the baked lightmap. Would a custom property suffice?, like:

billede

Absolutely!

Just a preference to leave the materials untouched and add the name to the object's custom properties. :)

Naxela commented 4 years ago

Should work now with the latest commit (https://github.com/Naxela/The_Lightmapper/commit/4e85bb101bd084dca457f8443b74fcdf7440363e):

billede

KenzieMac130 commented 4 years ago

Awesome! Are the paths always absolute or can they be relative to the light-map folder? Being absolute introduces incompatibilities if you are distributing the models across multiple PCs in a project.

Naxela commented 4 years ago

Hi, that shouldn't be a problem - For now the paths are made absolute during the baking process (it's necessary during encoding), although they can be converted back to relative paths after the process have finished