I'm making a HDA that makes door system: it can generate different kind of doors, different sizes, ornaments, door frames etc. It also generates 3 LODs (0, 1 and 2) and hi-res model for maps baking. This asset also unwraps the UVs (for each LOD) and then I have a Maps Baker (normals, ao, material IDs, metallic).
Ideally I'd like this asset to be as much reusable as possible, and trying to achieve this I got to several questions:
1. Since I have slightly different UV-layout for each LOD is it possible to create one “Bake” button to bake them all in the asset UI? Or there must be one button for each baker?
2. I'd like to push all baked textures automatically to UE project (in the case when I use Unreal material for my doors) – AFAK the only way to do it is to create Houdini material that utilizes that textures and send it to the output… I use this expression (in the “File” field) to access to the files
, but I'm not sure if this way is correct. Or maybe there's another (more convinient) way for that – since this approach can cause errors if files don't exist until they are baked*. Could you please help me with this?
strreplace(chs("../../maps_baker1/sOutputFile"), "$(CHANNEL)", "normal")
* Ofcourse I can use file_stat VEX function to check if baked files are exist and then pass the result to the Switch node that simply will skip the material assignment if no textures were baked, but maybe this approach is too overwelmed, idk.