Reapply the rig using vertex positions

Hi Guys,

I have a character that changes size during animation but the size change doesnt happen with the rig but with the blendshapes.
do you guys know how can i tell the rig that the vertex positions have changed and now reapply yourself to the new position.
it doesnt have to be real time. i have sequences with the smaller body and sequences with the bigger body. but it not just 2 times. it like 600-1000 times.

if you need visual help, think of hulk as an example.

Thanks,
Hoss

Can you change proportions with the rig but mass with blendshapes? Otherwise it’s going to be mighty difficult- you would have to drive some rig parameters with whatever is driving the blendshape parameters.

Thanks Rob,
I cant really change the rig parameters manually.
I am thinking of a script which would work like this:

-. rig a character
-. save the vertex weights and vertex ordering and position.
-. morph the character
-. now here i could use a script where it would load the vertex weights back to the model as well as it would kinda re-size the rig based on the changed-vertex position which it had from the save weight function.
-. next character / next morph

i know that this can be done much easier with re-sizing and re-positioning the rig, but i can only use morphs and i have almost 1000 characters to work with or even more.

Any idea?

Thanks,
Hoss

you might want to check out this thread and see if there is anything similar going on here

Could you do something like this? Write a script to query the 10 (or 20 or whatever) closest vertices to each joint. Save the average global position of all of them and save their point IDs.

Then when you apply a blendshape, find the average global position of those same vertices and move the joint by the difference between those two points.

jointPosition = averageOfPointsAfter - averageOfPointsBefore

If there is a lot of stretching in the vertices, relative to each other, this might not be totally accurate, but I think it might work. Sampling more vertices might make it more accurate. Sampling with fancy weighted averaging might make it more accurate. See this which might help for finding the center of a group of vertices: http://mayastation.typepad.com/maya-station/2009/11/where-is-the-center-of-a-polygon.html

Thanks Matt, very interesting.

[QUOTE=clesage;16494]Could you do something like this? Write a script to query the 10 (or 20 or whatever) closest vertices to each joint. Save the average global position of all of them and save their point IDs.

Then when you apply a blendshape, find the average global position of those same vertices and move the joint by the difference between those two points.

jointPosition = averageOfPointsAfter - averageOfPointsBefore

If there is a lot of stretching in the vertices, relative to each other, this might not be totally accurate, but I think it might work. Sampling more vertices might make it more accurate. Sampling with fancy weighted averaging might make it more accurate. See this which might help for finding the center of a group of vertices: http://mayastation.typepad.com/maya-station/2009/11/where-is-the-center-of-a-polygon.html[/QUOTE]

Chris, this is a good idea. i dont have much streching in my morphs, its very much uniform.
but thinking of the script… i though of this too.
like:
-. query the bone hierarchy then query the vertex positions within a radius of x for every bone
-. morph the mesh
-. query the new position of the same vertices
-. reposition the bones.

im not sure how good it would work though, since i have facial bones as well
it has to need no reworking.

Hmm… i will think a little bit more and will keep you guys updated…

[QUOTE=katetsu;16477]Hi Guys,
I have a character that changes size during animation but the size change doesnt happen with the rig but with the blendshapes.
do you guys know how can i tell the rig that the vertex positions have changed and now reapply yourself to the new position.[/QUOTE]

Hi,

For cases where rig needs to actually follow surface then gluing objects to the surface may be helpful, here’s an excellent explanation by
Jamie McCarter ( www dot jamiemccarter dot com ) :Constraining to a Mesh in Maya.

For other areas maybe the rig doesn’t need to know that the vertex positions have changed or how the blendshapes make the size change. Maybe try piping the blendshape mesh and the rigged mesh into a duplicate of the geometry following along with Jason Osipa’s (Stop Starring) chapter on local and global rigs. This way the size change from the blendshape can happen, and the rig used simultaneously with neither knowing how each other did their vertex movement contribution.

Hope this was helpful,

Cheers,
Nate

As mentioned, some sort of surface constraints may work well. Constraint some locators with geometry constraints to the vertices around a joint with offsets to have them all line up near the joint’s original position. Then when the mesh morphs, the locators move with the geo and you find the new average of the locators, this spot may be the new correct spot for the joint to bind to the mesh again. Will take some experimentation.

Thanks guys for the replies.
ill will see, what i can do:)
thanks,
Hoss

The other option is to select and create or store in script selection sets for edge face loops around each joint and then you can create a cluster at each selection and now you have a snapable/constrainable target that you can then update the joint positions to. The real problem is that if you don’t drive the Transformation with the Joints you are going to have a hard time fixing and correcting the local rotation axis on the joints.

I would drive the transformation with the rig and then create a fix blendshape that can blend on during the transformation.

Hard to guess with out seeing the mesh and if it something that needs to happen with animation control or if it can be done as a post script to fix the joints. There are a few ways to deal with the transformation problem but if it is a game rig then you are limited in what you can do with the skeleton.

Good luck, I hope you figure out a good solution, there are some great ideas in the thread all ready.

hi guys,

Okaay!

Finally, its all over. i got it working and the art director can now model/texture/skin a character within an hour having control over all character requirements.
so when he uses the morphs, the bones move appropriately with them.

what i did was, i wrote a script where for every bone i got the vertices around it and constrained the bone to them. at the same time i made it to save the skinning info in blind data.
so when the character morphs, maya automatically removes the skinning, morphs the character(bones move with the morphs), maya applies the skinning back.

character is ready to go.

Thanks guys for your support!
Hoss