Hi guys! I have run into an interesting problem, which is quite out of my level of expertise as it’s all getting quite complicated, I was wondering if a guru here knows of a solution.
So I am working on a mod for Crusader Kings 3, the game engine supports additive animations, and morphs, it does not support custom skeletons, however.
I am creating quite a complex model of cat’s whiskers with over 10 shape keys to give them variation. Due to the technical constraints, they need to be weighted to the existing head bones.
Now the problem comes in when I want to create a way of scaling them, on paper it seems simple, scale the bone and the whiskers attached scale with them! Which works for the whiskers, but it also deforms the base head model too as that has vertices weighed to it also.
So what I am trying to do is find a way to create a shape key, a counter-shape key if you will that will reverse all the vertex transforms that scaling the bones is making to the base model. So it would still be scaling the facial bones, but it would be masked by applying the counter morph at the same rate giving me the result of the whiskers scaling independently.
Now before you ask I have also tried scaling the whiskers with a blend shape, however, it only works if you make a scaled version of each blend shape which would be quite inefficient and I don’t even know if I would be able to implement such system in-game without major conflicts.
I have gotten close, by just making a new shape key and then trying to sculpt the result back to where it looks normal, but it’s never going to be exact doing it this way, and I am hoping there is a script or something that could help me accomplish this in a more systematic manner. Maybe a way to copy the global position of all vertices in the model at a certain keyframe, and move all vertices back to that position at a later keyframe irrespective to the fact that the bones have been scaled.
In the below video you can see what I mean. Scaling the whiskers deforms the whole face. In the end, you can see what I’m doing with a hand-sculpted shape key to counteract the bone scaling which works quite well. A little deformation along the way is expected and acceptable, but I want to be able to get as close as I possibly can.