Invalid AssetDatabase Error | Unity 6000.0.33f1
I'm currently working on a game that proecdurally generates its map, and am trying to bake the lighting in each prefab room. After adding PrefabBaker to my room prefab object in the baking scene, I click bake and after while get hit with this warning on each lightmap asset file
" Invalid AssetDatabase path: C:/Users/.../Assets/Scenes/PrefabLightmapping_Scene/End_Two story/End_Two story_light-0.asset. Use path relative to the project folder. "
and the following errors
"Couldn't create asset file!"
" [PrefabBaker] Failed to created asset: from: Assets\Scenes/PrefabLightmapping_Scene/Lightmap-0_comp_light.exr to: C:/Users/.../Assets/Scenes/PrefabLightmapping_Scene/End_Two story/End_Two story_light-0.asset UnityEngine.Debug:LogError (object) "
Also just to confirm, according to the README if the tool works as expected and i click Bake, then when I run my game scene and the prefabs are spawned in at runtime, the lightmap data will automatically read? is there anything I need to do?
Also just to confirm, according to the README if the tool works as expected and i click Bake, then when I run my game scene and the prefabs are spawned in at runtime, the lightmap data will automatically read? is there anything I need to do?
yes that's the idea, it will auto populate the scene lightmaps with the prefab baked texture. i doubt it will work with unity6 at its current state ( last commit was done 5 years ago ) , i do have a fix for that somewhere on my machine locally , just need to find it and update this repository
It would be really nice to see this get updated because it's pretty cool
Also just to confirm, according to the README if the tool works as expected and i click Bake, then when I run my game scene and the prefabs are spawned in at runtime, the lightmap data will automatically read? is there anything I need to do?
yes that's the idea, it will auto populate the scene lightmaps with the prefab baked texture. i doubt it will work with unity6 at its current state ( last commit was done 5 years ago ) , i do have a fix for that somewhere on my machine locally , just need to find it and update this repository
I think I am running into this issue as well.
it seems like it would be relatively simple to fix the pathing issue, but curious what you mean by "I doubt it will work with unity6 at its current state". what kinds of problems would you expect?
quick followup, I just added this line to the Baker.cs file, around line 199 after newFile is declared
newFile = newFile.Replace(Application.dataPath, "Assets");
this seems to get past the issue for me, and it seems like it worked! It did hit an error downstream about applying changes to a prefab, but it seems to work regardless. Here I baked a pink light along an edge of a cube. I can now drag that cube into another scene and it's respecting the generated light maps :)
neat!