Auto Skinning Tool Question

I’m the kind of person that likes to build things on my own, but this is an area that I have had no formal training or mentor OR resource of any kind, hence I am here. There a couple of auto rigging setups out there that offer auto skinning as well. Paolo http://www.paolodominici.com/demos.php
and Anzovin rigging system, are pretty awesome. My question is where do you even start when it comes to auto skinning, I have built the auto rigger I want, but not sure what the first step is in skinning. Are they using an influence object, or does it get weighted to the bones the rig creates? I’m sure there is a ton of math or something, I bet I could just get most the code form the output window, I just don’t know what to start testing with. Thanks in advance :D:

This is conceptually easy but technically difficult because of the ‘edge cases.’ All they are doing is using a pre-weighted low-poly mesh as the influence for a different mesh (the different mesh can be high or low poly, it doesn’t really matter). There are multiple ways to do this, starting from versions that use built-in features (such as Maya’s version of Skin Wrap, can’t remember what it’s called), to simple custom routines (ray casting from the new mesh to the pre-weighted mesh), but to do it well really takes a lot of custom algorithms and skill. I’m not sure what actual technique they’re doing, just conceptually what’s going on.

I’ve found scripting weighting to be a subject and specialty all unto itself (far more similar to mesh manipulation than anything to do with animation). If you’re not going to get deep into it, the biggest bang for your buck is automating built in Maya features that do sort of what you need. If you really want to get into it, you should start with simple ray casting (for closest point on mesh systems). From there, you can expand your system to work with different types of geometry conditions (open edges, severe angles, very different geo, tight folds, etc). Exactly how you expand your system is up to you- every implementation tends to be a different technique or spin. That’s how these highly arbitrary systems that try to approximate arbitrary human judgments usually go.

We use a pre-weighted low poly mesh, and just skin copy to the rigged mesh(es). Works very well for most cases, and edge cases would take longer to figure out than to just do them by hand anyways most of the time. Works well for faces as well as bodies assuming you use a fitted facial rig on multiple characters. Maya’s built-in skin copy tools have gotten much much better in the past few versions. Maya skin copy can do by: UV, closest point on mesh, closest point(Global), and ray cast (Closest point on mesh is usually the best)

And, since in our case the rigged mesh is skinned to the template, it automatically fits to the final character when the template is sized to match. (Although we can tweak by hand on top of that if it’s still too far off.)

Also, to answer your questions about how they were doing it: The Setup Machine uses a variation of a standard skin cluster, and some ray casting as far as I am aware (They have some special features which they implemented, although you can choose not to use their custom skinCluster if I recall correctly). While Paolo uses a wrap deformer to the skinned lowpoly (Although im sure he could use skin copy just as easily)

http://www.creativecrash.com/maya/downloads/scripts-plugins/character/c/pm_heatweight--2

If you have not looked in to heatweight mapping here is a maya version, it is in blender as well (of course:) and if you build your skeleton well and the mesh is build to deform, it does an amazing job of creating an excellent bind, you still have to fix volume loss stuff but that is just the way it goes. The siggraph paper is a good read as well, where this tool came from.

Templated skin mesh as Nathan describes work great as well and Maya copy weights with a tweak to two produces outstanding results compared to pre 2009 maya.

I don’t like the setup machine auto weight system because it uses a custom skin cluster but at the time they had to do it that way to get the features they wanted…but I try to stick with core tools when possible.

Wow, Thanks for all that info, I think I have a place to start now. Thanks for the link too Brad.

[QUOTE=bclark;7858]http://www.creativecrash.com/maya/downloads/scripts-plugins/character/c/pm_heatweight--2

If you have not looked in to heatweight mapping here is a maya version, it is in blender as well (of course:) and if you build your skeleton well and the mesh is build to deform, it does an amazing job of creating an excellent bind, you still have to fix volume loss stuff but that is just the way it goes. The siggraph paper is a good read as well, where this tool came from.

Templated skin mesh as Nathan describes work great as well and Maya copy weights with a tweak to two produces outstanding results compared to pre 2009 maya.

I don’t like the setup machine auto weight system because it uses a custom skin cluster but at the time they had to do it that way to get the features they wanted…but I try to stick with core tools when possible.[/QUOTE]

I tried playing around with heatweight and the geometry requirements were so strict it rendered the whole thing useless for production(IMO). You’d spend more time fixing up your model than it would take to do the weights by hand.

I’d love to learn more about this myself though. It honestly always sounded to me like the type of thing that’s too good to be true.

In theory, the math is easy. You need to establish the location of the joints (midpoint works well, but you have to be prepared to handle joints like index3) and then you can calculate the distance between each vertex and each joint using the square root of the sum of the squares of the deltas between the joints:

sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1)); // 3d version of Pythagoras theory

However, more detailed logic is needed, such as attention to the hierarchy, or you end up assigning weights to joints that shouldn’t be, such as assigning 80% to rLeg and 20% to lLeg.

I worked some on this, and the best I got was an approximation to what you can get already from Maya using the standard smooth bind skin. I keep thinking that maybe I should try a version for the HIK rig that knows the HIK names and can use some extra lookup table info that specifies the allowable adjacency and some tolerances, because how you want to weight the shoulder is greatly different than the way you would do a leg.

I just found a video by the Rigging Dojo the has Raf Anzovin talk a little about his face skinning algorithm, it can be viewed here:

Thanks Brad

I have been running the heat weights tool on all kinds of meshes in Maya and have not had a problem yet…but I would like to know what the issues were you hit so I can keep an eye out for them.

and@matt, no problem…glad you found it useful… part 1 of our Anatomy lecture with Jeff Hesser is up now as well.

Maybe I didn’t get far enough into exploring it, but if I remember right the main reason was because it needed a mesh with no holes (in our pipeline that is REALLY rare) and I think it just wouldn’t work when it ran into 5 sided faces(which slip by a lot in our models) or other slightly non-uniform stuff.

Ah ok, I guess I was just getting lucky with the models I was using it on. hmm.
Well if you use a clean base lower rez skinning mesh with it, to get you a good copy weights starting point it could work well with craZy meshes. just a thought.

p.s. part 2 of jeffs lecture is up and both are ready for download.

I just played with heatweights a little more and it totally works. It looks like a really great skinning starting point after all.

The reason it wasn’t working was because we set our maya unit prefs to “meters” instead of “centimeters”… while set to “meters” heatweights sets all the verts to the origin, so it looks like it deletes the mesh. The errors I was getting were also because I didn’t realize you needed to skin the mesh before running it. Ha! Damn. Anyway I fully endorse this now.