Rigging clothes of not very high res cartoon characters can get very tricky as with a lot of the designs intersections are inevitable. It can get very frustrating for animators to fix issues like that, and the easier we can make it for them the better. Today, I am going to have a quick look at a setup that can help with fixing small intersections, but can also be used to achieve a variety of effects. It is a nice simple tool that maya provides us – the
softMod deformer – but they have not necessarily provided us with a great interface to interact with it, so we will have a look at a way to make it work a bit nicer for us.
Essentially, what we have is a couple of controls, where one of them defines the origin of the deformation and the other one is actually deforming the geometry. The nice thing is that by placing the deformer after the
skinCluster in the chain we can have the controls follow any of our rig controls, in order to be able to easily pick them up and deform our geo in world space.
tl;dr: You can connect your own matrices to the
softModXforms attribute, in order to have your own controls driving the
softMod deformation in world space after the
Figuring it out
When I was trying to figure out what matrices I need to plug to which attributes, I was having a hard time making sense of the available documentation on the subject. I found a few people online making use of the
preBindMatrix attribute, but I could not get that to work properly, so naturally, I thought screw it, I am going to write my own
softMod out of frustration.
After a couple of minutes of setting up the boilerplate code I was up and running, and it was a really simple effect that I needed, so the code was quite straightforward. I was having issues with the deformation not being accurate in world space though, so I had to account for that, which meant I would multiply by the
worldInverseMatrix of the origin object I am using, then deform by the local matrix of the deforming object and finally multiply by the
worldMatrix of the origin object in order to bring it back to world.
Doing that after having a look at making it work with the vanilla Maya
softMod, though, made me think that I have seen similarly named matrices in the deformer attributes. Namely, the children of the compound
postMatrix. Connecting the proper matrices to these attributes, gave me the result I was looking for.
The reason I am saying this, is because I wanted to point out that is really helpful sometimes to just try and write your own node/deformer/plugin/script in order to understand what Maya is doing and why. I did this exact same thing when trying to figure out how to account for joint orientation in my matrix constraint post.
softMod deformer setup
With that out of the way let us have a look at the graph.
So essentially, by making use of the
softModXforms we are building exactly what I mentioned in the previous chapter, where we account for the world positioning of our deformer controls, by bringing back the deformation to local space, deforming our object and then placing it back in it’s world position.
Of course, these locators are there just so I can have a nice and simple example. In reality, the way this would work is that these locators would probably be replaced by two controls – one controlling the origin of the deformation and the other actually deforming the object. Additionally, exposing the
falloffRadius attribute of the
softMod deformer somewhere on these controls would be a good idea as well.
A nice benefit of having our own controls driving the
softMod is that we can get rid of the
softModHandle since it won’t be doing anything, which would result in a cleaner scene.
Using the tool in production
Now, I could imagine a couple of approaches for using this setup. The first one would be to build these into your rigs before passing them to the animators. Depending on the geometry, though, this could easily be an overkill if they are not used in every shot. If that is the case, the better approach would be to build some sort of an UI for the animators to create these into their scenes.
Additionally, while looking for info on this setup, I stumbled upon a few people having a riveted object be the origin control, so essentially achieving something similar to the infamous tweaker dorito setup.
Even though, the
softMod is a very simple deformer, in cartoony productions I could imagine it being very handy for fixing intersections and giving the animators control over finer deformations.