Is there a way to automate the rendering of individual objects / view layers and save the images?
Edit: Solved... I do it with Compositing as suggested in an answerr
I am working on a small 2D game for which I create the images and characters with Blender. The player has the possibility to choose the clothing for a character and the characters poses changes so I used layered transparent images: the base layer is the character’s body and above that follow transparent images with parts of the clothing.
Technically I already found a good approach in Blender: I render only individual objects (eg the jeans, the hoodie, the hat and so on) and use the settings in Object > Visibility > Mask > Shadow-Catcher or Holdout (or the corresponding settings for Collections) so that I only get an image for the jeans, the hoodie, the hat and so but wth correct shadows.
But as you can imagine: This is a time consuming task when done by hand. It means toggling the settings for the objects / collections for each choosable clothing for every possible pose.
As this is also repeating I wondered if it would be possible to write a script or something to do that… for example after I’ve create a new pose I would like to press a button (or start the process in any way) and magically Blender would render the individuall objects and save them after a defined naming convention…
I am not sure if view layers are really the way to go as the clothing are child objects of a rig. When I move them to different collections (which is the only way to handle the visibility of objects for different view layers as I know so far) their visibility is not determined by the collection (as the parent rig stays in another collection)… but maybe I miss something here. Any tip / hint is highly appreciated as I am sure that this would reduce my working time heavily… If you could write such a script or whatever for me I would also be willing to pay for such a service.