PDA

View Full Version : Sculpt Morphing. Is it possible in Maya? Please read...


kiaran
12-22-2004, 02:03 AM
Hi guys,

I've been thinking recently about the workflow for creating muscle-simulating blendshapes. Of course, the standard 'blendshape driven by joint rotation' technique is clearly a winner for it's speed, stability and control. Especially for video game engines that don't have access to complex skin/muscle simulations.

That being said, the workflow for creating said blendshapes could use some improvement. For corrective deformation blendshapes (like armpit wrinkles, elbow volume etc...) you have to duplicate the non-deformed mesh and model the shapes from that.

This presents an inherent problem because you have to constantly guess how the blendshape you are creating on the non-deformed model is going to look when applied on top of a skinCluster (smooth binding).

So does anyone have a technique they use for WYSIWYG blendshape modeling? 3ds Max is ahead of Maya in this respect with the release of Max 7.0. They have a skinMorph modifier that allows the automatic sculpting of blendshapes at specific joint rotations. This allows the setup-artist to sculpt the shapes IN A DEFORMED STATE. Check out the video below to see what I mean:

http://mtlstream02.discreet.com/streaming/ms/skinmorph_200k.wmv

I will likely be writing a script to simulate the skinMorph modifier in Maya. Should be a fairly straightforward tool to impliment via MEL. Just thought I'd do a little research on the problem before I dive into what could be a waste of time.

Any ideas?

seven6ty
12-22-2004, 02:48 AM
Nice idea...

I think the nicest thing of that whole set up was the customizeable tangent curves for when and how the blendshape kicks into effect. That'd make it worth it for me, as I've been a bit sick of simply setting up linear blendshapes. Anyhow, nice idea again.

kiaran
12-22-2004, 04:18 AM
Adjusting the tangency can be done in Maya by simply editing the SDK curve in the graph editor. This has the exact same effect as the curve editing window on the Skinmorph thing in 3ds Max.

seven6ty
12-22-2004, 05:26 AM
Yeahhhh, I was gonna say I'm sure there has to be a way to get around to doing this in Maya, I've just been too lazy to research it or something. I want it right there infront of me, yeah!

tmac
12-22-2004, 10:42 PM
I think mike comet has a mel script on his site that does this very thing. . . .pose base deformations(can you say Hulk muscle system). . . . I havent tried it yet. . . .but it looks like it works based on how groups of jnts are posed and not a single jnt . . .I agree this type of control should be integrated in maya as this seems to be the most artistic way of getting your character to look the way you want it to in animation.

Other than that I'd love to see what you are working on.

tmac

kiaran
12-23-2004, 12:20 AM
I think mike comet has a mel script on his site that does this very thing. . . .pose base deformations(can you say Hulk muscle system).
Thanks for the link! :)

I read all of Michael's papers and I downloaded his deformer and scripts. They look good, and I want to have more time to try out his work.

The approach I'm taking differs somewhat from Comets. I'll try to describe my ideas so others can comment:

1.) With my script, the user loads a 'base' mesh (that is a mesh in a default, non-deformed, bind pose).
2.) Next, the user poses their skeleton (lets say a bent elbow for example). Duplicate the mesh and load this into the 'deformed' mesh slot in the UI.
3.)Now, the user wants to create a blendshape that kicks in at this point to squish the forearm where it collides with the bicep. Also, we can sculpt the loss of volume out of the arm. The user sculpts these changes directly on the smooth bound, deformed mesh so they can see exactly how their shape is going to look. Duplicate this mesh, delete history and load this into the script UI under 'sculpted mesh'.
4.) Now the magic part. The script compares the 'deformed' mesh with the 'base' mesh, it takes this difference and subtracts it from the 'sculpt' mesh. A new mesh is created that represents the blendShape applied back onto the default mesh. This blendshape will then be ready to be added ontop of the skinCluster node and setup via SDK, expressions, whatever.

I think this should work. I'm just about finished the script so I guess I'll find out soon enough if this is going to work or maybe I'm just wasting my time.

For those interested in an excellent acedemic paper on this very problem, I googled 'pose space deformation' and found this:
http://www.idiom.com/~zilla/Work/PSD/PSD.pdf

The paper explains, in detail, what the advantage is with this technique.

I hate working on my own. Any ideas????

seven6ty
12-23-2004, 12:45 AM
Oh I think I get it. So you just apply the offset values to the respective verts, and then undo the changes to the bound skin?

Sounds like a good base idea and I think it has a lot of possibilities. I still like the idea of having the editable graph for the blend at your finger tips, but I did check out selecting the blend and how it is displayed in the graph editor, thanks for the tip! It also might be nice to have something in there that will let you set the SDK so you don't have to go to other windows that would interrupt your work flow. But those are both just extra bells and whistles I believe... Oh, and it would be nice to be able to rotate the joint you set the SDK for and actually see the blend in action once it's all set up. I know several revisions of the paint weights box allow you to do this, rotate the joint you are applying weights for. Just thought that might be another nice feature.

But yeah, I'm just curious as to how you calculate the vertex offset for the blend shape? I'm pretty sure you couldn't simply measure the world space offset and use that, would you measure it in terms of the offset in normal values possibly??? Anyways, sounds like it'll be a good tool.

kiaran
12-23-2004, 05:09 AM
I'm pretty sure you couldn't simply measure the world space offset and use that, would you measure it in terms of the offset in normal values possibly??? Anyways, sounds like it'll be a good tool.That's the real trick. So far I have been unable to generate a blendshape that is properly subtracted from a smooth bound skin. My script will subract a properly working shape from a hand tweaked mesh, but not a deformed one.

I'm still a major newbie when it comes to vertex manipulation via MEL, so I'm sortof learning as I go along. I do think that it is possible, just not sure of exactly how the calculations work.

seven6ty
12-23-2004, 08:54 AM
You might have already thought of this, but could you, after having made a duplicate of the bound skin, store the world space coordinate location of every vert in the original posed geometry, and then allow the user to sculpt the bound skin in it's active pose, then...

1. Reset the joint structure to it's neutral pose.
2. Query and store the location of every vert (as it is still in the blend shape displaced pose.
3. Apply these values to the duplicated skin (in the neutral pose), and possibly, mirror the location of every vert and apply this value to a second duplicate, to make a mirrored blend shape ready to set up.
4. Go back to the bound skin and delete the geometry tweaks from it's history, taking it back to the bind pose skin shape.
5. Create the blends with the two duplicate target shapes (for Right and Left, if so desired, otherwise, just one duplicate target shape) and provide the graph editing and joint rotation tools if desired.

kiaran
12-23-2004, 09:03 AM
Yes this is likely how the script will have to work. I've been trying to avoid using world space coordinates because they change if the user translates the mesh while sculpting. This would be an acceptable limitation if my current method won't work.

Thanks for the help. :)

tmac
12-23-2004, 06:52 PM
kiaran,

thankyou for looking into making this work in maya. . . if it was possible to make it work as easy as it does in the max video that would rule. . . .interactivity is a good thing.

keep up the good work!

tom

mattcioffi
12-23-2004, 07:35 PM
i think i understand exactly what your asking - read it quickly. someone already released a script that does this. i've used it a few times and it saves you a rediculous amount of time. i can't find the thread but i've attached the script.

also there is a smart way of doing this without a script. Jeff Unay's alias masterclass dvd walks you thro it. no script. i just can't remember the exact steps -- but it's easy.

macaroniKazoo
12-24-2004, 03:56 AM
kiaran, mike comets plugin does exactly what you're after. it allows you to sculpt blendshape targets using a deformed mesh directly.

Firas
12-26-2004, 07:39 AM
wow .. i hope alias will take a look on Max features ..

i did small mel sometime ago.. and its for painting morphs .. not like max one .. but i think it helps in modeling blend shapes..
its smartPaint .. check www.ztoon.com/3d/smartVtxII (http://www.ztoon.com/3d/smartVtxII) hope it help in a way.

mattcioffi
12-26-2004, 09:09 PM
i just check out that max vid -- yeah that would be handy -- mike comet's script looks good too. i'll be sure check it out when i get a chance. someone i'm working on a project with has a plugin they're selling with a shape generator -- haven't tried it yet.
http://www.3doddball.com/prat/?shaper


someone needs to write script to do this with zbrush -then your talking some real power:buttrock: -- exporting morph targets with texture maps -- auto generating driven keys with blendshapes and shading network.

kiaran
12-27-2004, 05:56 AM
kiaran, mike comets plugin does exactly what you're after. it allows you to sculpt blendshape targets using a deformed mesh directly.
Macaroni- Yeah, Comets plugin does the trick, but I wanted a way to bake it into a blendshape. This way, I know that there are going to be no compatibility issues with some machines not having the plugin etc...

someone already released a script that does this. i've used it a few times and it saves you a rediculous amount of time.
mattcioffi- YES!!! This is what I'm looking for. This script is perfect! (I had to d/l directly from highend, the file in the link above opens with wonky null characters, corrupted).

Since my method of substracting the shape from the deformed mesh did NOT work, I'll be tearing into this guys script and figuring out how to integrate his algo into a more user friendly window that will streamline creating AND setting up the shapes.

Man, I can't believe this isn't in Maya already. *shrug*

seven6ty
12-28-2004, 02:18 AM
Man, I can't believe this isn't in Maya already.
Lol, I say that every day. Well, not everyday, but yeah, it seems like they can be awfully behind what their users are doing sometimes, but oh well, I guess that's the beauty of it at times as well.

Sagroth
01-04-2005, 12:36 PM
also there is a smart way of doing this without a script. Jeff Unay's alias masterclass dvd walks you thro it. no script. i just can't remember the exact steps -- but it's easy.I spent a couple of days lately on the purpose of volume maintaining... Unay/Thuriot technique doesn't work properly - in their example everything is ok what concerns elbow bending, but if you try to rotate any joint above in hierarchy there would be incorrect deformations in elbow. Just don't understand how they decided to presented this technique on SIGGRAPH and how Alias put it on DVD ;)

Though I found a couple of ways to setup corrections without this problem, they all are too "heavy" or with pretty disguisting in-betweens :( So, kiaran, waiting very much for your results on that matter. Respect.

mattcioffi
01-04-2005, 07:06 PM
[QUOTE=Sagroth]Unay/Thuriot technique doesn't work properly QUOTE]

well -i haven't tried it personally but it looked convincing at the master's class. can't imagine that it doesn't work. maybe they just omitted the right steps to do compound joints - i can imagine that.

also try the script i attached or look for it on highend -- that definitly does work for compound joints.

Sagroth
01-04-2005, 07:39 PM
also try the script i attached or look for it on highend -- that definitly does work for compound joints.Yeah, the script is great and works awesome. Thanks for it.

Morganism
01-06-2005, 05:18 AM
The way I've been doing it is to duplicate the undeformed mesh, then rotate your joint and duplicated that mesh twice. Then on one of them you can model your correction in world space so everything looks nice. So then you take your corrected deformed shape, and your uncorrected deformed shape and apply them as blendshapes to the undeformed shape. You set the corrected target to 1 and the uncorrected deformation target to -1, effectively giving you the difference between the two.
I think this is similar to what Unay and Thuriot went into more depth on.

Unfortunately, Sagroth is right, it isn't perfect. I found that it will usually get me only 90 percent there. For small fixes or joints that don't rotate a lot it's great, but places like inside elbows and knees it doesn't get exactly like you modelled it. I don't know why.

I haven't tried this yet, but I thought that it might work if you piped the corrective shapes and the deformed skin into another blenshape, and mixed them there, rather than having the skin cluster and the blendshape effecting the same mesh. Does that make sense? I don't know if it will work or not.

Sagroth
01-06-2005, 08:05 AM
I think this is similar to what Unay and Thuriot went into more depth on.
Yes, that's it exactly.

I haven't tried this yet, but I thought that it might work if you piped the corrective shapes and the deformed skin into another blenshape,
and mixed them there, rather than having the skin cluster and the blendshape effecting the same mesh. Does that make sense? I don't know if it
will work or not.
Well, I tried a lot of these - different blendshape types and their places in deformation order - only Parallel works. However, this Parallel is what causing problems when parent joints are rotating. BSpirit script works ok - corretive shape generated by it should be just added as Front of Chain blendshape and everything works properly.

JakobWelner
01-06-2005, 04:09 PM
I'd use a script like that on a project I did some time ago. It was i quite tedious process though, cos the script I used - bodyShape - was very very slow cos it moved a vertex randomly, tested if it was any closer to the final position. Moved again undtil it was inside a threshold of a kind. This is done for every vertex you have moved which really takes hours/days!.
Anyhow I thought of a new way og doing this through tranformation matrices where you calculate the difference between the world coordinate system and the local coordinate system of the binded vertex and just plots in the remodelled vertex position.
Others must have gotten the same idea cos I've seen other scripts that use this technique and I suppose the one posted above uses the same.

This was a very short version of the method explanation, but it should give a clue of what to seach for :)
Hope it helps in some way

tmac
01-14-2005, 05:12 AM
I've been testing the bspirt correctiveshape script. . . so far it works exactly as I would want in 2d joints(like elbows) one axis of rotation = one blendshape. . .very nice results very predictible. . . but I'm struggling with ball joints(shoulders). . . . you now have 3 axis of rotation that can be shared which mean you now have multiple blendshapes adding on top of one another. . .it kind of works but kind of doesn't. . . .is there a better way? I'm using set driven key to drive my shape. . . .and my blendshape node is at the bottom of the list. . . .has anyone else made this work the way they want. . . .how do I avoid conflicting blendshapes?

thanks
tmac

Arcon
01-14-2005, 09:21 PM
I've been testing the bspirt correctiveshape script. . . so far it works exactly as I would want in 2d joints(like elbows) one axis of rotation = one blendshape. . .very nice results very predictible. . . but I'm struggling with ball joints(shoulders). . . .and my blendshape node is at the bottom of the list. . . .has anyone else made this work the way they want. . . .how do I avoid conflicting blendshapes?
tmac

yep, most common problem using blends for joints is when u have more than one axis ;) you can edit the values of the SDK curves to limit their influence but as you probably know already its still a hassle getting the look right - personally i wouldn't use blends for the shoulders, but build your own custom SDK solution based on joints or influence objects.

tmac
01-14-2005, 11:17 PM
Yep it's good to know that it's not just me I tried this on a simple tube arm the results of mixing multiple blendshape even with a linear fade from one into the other looks ugly. . . .I'm going to try some other techniques.


thanks tmac

CGTalk Moderation
01-20-2006, 06:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.