Help animators fix intersections with a softMod deformer

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.

Maya softMod deformer - demo

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 softMod deformer’s softModXforms attribute, in order to have your own controls driving the softMod deformation in world space after the skinCluster.

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 softModXformspreMatrix, weightedMatrix and 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.

The actual softMod deformer setup

With that out of the way let us have a look at the graph.

Maya softMod deformer - node 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.

Conclusion

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.

5 Comments on "Help animators fix intersections with a softMod deformer"


  1. What am I missing here – when trying to apply a softMod to any sort of geo that has no history, I can not for the life of me get the geo to deform… Do you need to manually add the tweak node and the deformerSet etc?

    From my testing that doesn’t seem to help anyway so I don’t think it’s that.

    Reply

  2. Sorry just as a follow up – I mean applying the softMod as in creating it in the Node Editor and manually hooking up the outputGeometry connection to the inMesh input of the geo shape node. I’m not using the softMod deformer interface at all.

    Reply

    1. Oh, I see. Yeah, I have never tried building it entirely from scratch in the node editor, since in that case as you said, we need to create our own set and attach it, which I would say is a bit too much hassle (not even sure how I would go about it off the top of my head). That being said, I think the softMod command is not very cool either.

      A nice and simple way to go about it, I think, is to use the deformer command with the type flag set to softMod. What this would do is create the bare minimum of connections to get the deformer to work on the geo. So, the set and the tweak are being created, but nothing softMod specific.

      Hope that helps. If you need to get it to work when building it entirely yourself, you would definitely need a way to create and attach the set.

      Reply

  3. Hey,
    Really like the way you go about explaining how you figured this out.
    Curious to know how you got this to work without getting a cyclic loop error on the mesh. I tried creating this on a sphere and parented the locators to the rivet and unsurprisingly it bugged out and started throwing cyclic errors.

    Reply

    1. Hi,
      You know, I haven’t really thought about that. When I was researching for this post I found a few topics where people were doing it, but now that I think about it it makes perfect sense for it to cycle and bug out. I’ll have to try it myself, as I’ve never tried this setup with a rivet.

      I’ll keep you posted.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *