cats-blender-plugin
cats-blender-plugin copied to clipboard
"Fix Materials" breaks Material Combiner if the blend file has not been saved
The "Fix Materials" option of "Fix Model" only saves the altered images if the blend file has been saved: https://github.com/absolute-quantum/cats-blender-plugin/blob/3596f2e262aaeca0c204da4c5bd371ab2d20e04d/tools/common.py#L2027 This breaks Material Combiner when the blend file has not been saved somewhere because Material Combiner needs to read the filepaths of the images and then load the images into Pillow from disk. It doesn't raise any errors when this is the case, but appears to get the diffuse colour from the material instead, resulting in an atlas of coloured squares instead of the images.
I'm honestly not sure what the best course of action would be.
It is at least simple to workaround, since users can either save the blend file somewhere before doing "Fix Model", turn off "Fix Materials" or they can atlas first and then "Fix Model" afterwards.
I do have a Pillow-less Material Combiner fork that would work with these unsaved images, but it's not going to be ready for PR-ing to Material Combiner for a while yet.