Progress Report: Adding Facial Expressions (Patreon)
Content
I deliberated on how to add facial expressions for a while, but I finally settled on separating the head and body of each character into two separate images. That meant I had to do 2 things: Render each facial expression once for each skin tone and position (body type doesn't affect the head, so they could be reused across each body) and find a way to automate the separate of head from body on the rendered images (otherwise I would have to manually edit hundreds of images).
The rendering portion was easy. I've defined four emotions right now (default, happy, sad, angry), but plan on adding many more over the next few weeks now that I have a system in place for editing the images after they're produced in Daz. The automated separating was harder to do, and took a lot of research and testing to get right. The batch image manipulation software for GIMP that I've been using to crop all of the images doesn't have a way to mask an image, so I was forced to look elsewhere. I ended up using ImageMagick, a command line base based image editing program. I manually outlined the head in each position and turned that into a black mask. ImageMagick then uses that to go through every emotion/skin tone combination and produces a separate head and body image.
Once I had all of the images it was relatively easy to modify the character drawing code in LR2 to handle the new drawing step. Now that the technical aspect is handled I will have to decide what criteria decides what emotion is used for a character. If you have any suggestions I'd love to hear them!