makePaintable for Lattice Envelope

Hi folks,

I’ve been searching for a method to paint the influence of a deformer; specifically a lattice.

I have a lattice that is controlling an elephant’s ear. I’d like to paint a soft falloff of influence where the lattice ends.

My search led me to the makePaintable command. But I am having trouble finding help that explains the scope and usage of this command, or where I should be looking once it is registered.

from pymel.core import *
makePaintable('ffd1', 'envelope', ui='latticeWeight')

This doesn’t fail, but I definitely can’t see the attribute anywhere. I’ve tried selecting the geometry and the lattice and using Paint Attributes Tool.

Chad Vernon says:
“All deformers come with a per-vertex weight attribute so we are simple activating the paintability of that attribute.”
And then one of his commands is:

MGlobal::executeCommand( "makePaintable -attrType multiFloat -sm deformer blendNode weights;" );

Am I missing something obvious? Am I on the wrong track? Perhaps the envelope isn’t a valid attribute to use, but I can’t find any .blend .blendWeights .blendNode or .weight(s) attributes as suggested on Chad’s tutorial.

And finally if I am on the wrong track, is there another method I can use to soften the edges of a lattice? (this is not a lattice falloff issue.)

Thanks a bunch.

Hi again,

I still haven’t made any progress with this problem. Does anyone have any alternative solutions for me? Or can you let me know if I am on the right or wrong path?

Summary:

  • I’m in Maya 2012, deforming an elephant ear with a lattice for a nice smooth flapping effect.
  • I’m trying to blend between where the lattice affects the mesh and doesn’t using two methods:
  1. makePaintable (no success)
  2. adjusting weights on the lattice so that the part near the head doesn’t move. (difficult because of the shape of the ear. I’m still getting some stretch in the back of the ear where the limits of the Deformer Membership are.)

If all else fails, I’ll likely resort to tedious weight painting. :scared:

Weight painting might be the solution. I tried to recreate what you are describing (extruded some polys from a sphere and added a lattice) and after playing with it a bit it seems that the only adjusting of weight for a lattice is the falloff. I tried attaching a ramp shader to that attribute but it only reads the bottom value of the shader (0-1). The only kind of smoothing was when I pulled the lattice away from the mesh and increased the falloff. This was with the lattice applied to only the verts of the “ear”. This is just my observation of course. Good luck!

Thanks Matt,

I agree. We did a pterosaur once and tried wrap deformers, and other fancy tricks and in the end resorted to painting weights and backface culling in rendering.

Anyway, it turns out that I was missing an obvious solution. The lattice ear is on a live blendshape rig, which means I can paint the influence with Paint Blendshape Weights Tool!

Exactly what I need. :wink:

What I am doing is more involved than just this lattice. I’m driving a small poly plane with cloth that is pinned to a simple control chain in the ear.

  1. The cloth has follicles pinned to it (a deleted hair system)
  2. Joints are parented under the follicles
  3. The joints drive the lattice
  4. The lattice drives the ear smoothly
  5. The geo is fed as a blendshape into the rig.
  6. The cloth is made to collide with a low poly duplicate of the elephant’s neck.

I can therefore get a nice cloth effect localized to the ear, without the heavy weight of driving the entire geo with cloth.

Thumbs up!

Hey that IS a pretty handy dandy setup, thanks for sharing. Do you think if you just painted weights and got rid of the lattice it would improve your rig’s speed? or is the speed of the rig with that extra step still just as fast? Using the lattice does speed the setup process itself but I’m curious how taxing it is. Either way, very cool.

Good point, I hadn’t measured this. With a lattice (only 1 ear is done so it will get worse) I get 9fps, and with skin weights alone I get 14fps.

(It’s heavy, but we also make a low res animation rig which will be closer to 40fps)

I’m really wishing we had modeled the ear out straight to make this step easier. But it is modeled slightly bent and natural and along the body, and to make matters worse, it is asymmetrical. :|:

I’ll have to do a similar benchmark on the low poly version. If it dips below 30fps, I’ll likely have to drop the lattice. (Or just drop the lattice on the low poly version and keep it on the high version.)

Edit: Disregard that, my tests are flawed. Now I’m getting 14fps with 2 lattices. Maybe I should add 20 lattices and it will be even faster? :slight_smile: