View Full Version : messed up on blend shapes need help on moving vertices to bind pose
Richie_P 08-28-2003, 08:47 PM hi everyone
on the lastest model i created 6 or so blend shapes for a eight legged character only to find all the blend shape legs have moved cos i copied the model from an ik character :(
is there any way i can move the vertice of the blend shapes back to the bind pose?
|
|
fongSaiYuk
08-29-2003, 02:55 AM
i do not understand the problem with having copied the model
from an ik character - what do you mean?
Richie_P
08-29-2003, 06:29 AM
sorry i didnt make it understanable
i copied from an ik`ed model meaning that the legs are in a different position from the bind pose
misterdi
08-29-2003, 12:21 PM
Maybe what you could do using a MEL script, select all the vertices that should be move back to the bindpose model, let say "basemodel", so you will have a bunch of vertices which could be flatten, store the position of these vertices (as local) to a temporary variable let say $pos.
Than for each blendshape target, look at the same number (indices) for this vertices an change their position (as local) matching the one you have stored.
I have wrote that MEL script couple months back, but as usual I never keep it in backup so it was removed when I remove my project.
But it is possible to solve your problem, and it is fast.
There also several different approach that I have research like using softbody both to basemodel and blendshape target, than use the basemodel particle as goal of the blendshape target selectively by painting goal weights.
But finally I decide to use the MEL script since it is fast and reliable for multiple blendshape target in one go.
BTW: If you really needed I can try to rewrite my script.
Best regards,
fongSaiYuk
08-29-2003, 07:06 PM
If what you want is to return the newly modeled blendshapes to the bind pose of the original ik'ed source model while preserving the modeling details you have added, this is no problem.
Duplicate each of the new models.
Select the original ik'ed model and return it to bind pose. Disable the evaluation of any nodes if necessary.
Set the blendshape options to parallel and select the ik model as target and then the first of new blendshapeModels as base. create blendshape.
repeat with the duplicateModel of the blendshapeModel as target and the blendshapeModel as base.
set the 2 blendshapes to 1. repeat for the other models.
Your models should now be in the bind pose of the ik model with the modelled details retained.
Hope this does the trick. This technique is used a lot to apply existing phonemes etc. of one character to a different looking character with the same topology.
Apologies if I have not understood the question.
misterdi
09-01-2003, 09:27 AM
Dear Richie, sorry I never check my PM,
Richie_P wrote on 08-29-2003 06:14 PM:
misterdi
thanks for the offer your script would really help me out,
im sure a few others are in the same situation so maybe you can post it back on cgtalk
tahnks again your scprit will save me a day or 2 of manuel vert snapping :)
Richie_P, this script is composed of 2 parts.
First part is used to collect all the vertex id that you want to snap back to the base model. Select all the vertex that you want to snap back in basemodel (even though it doesn't matter if you selected from any blendshape target, it just collecting the information for the id for the second process).
I warp the script in a proc:
proc selVert ()
{
string $selections[] = `ls -sl -flatten`;
global string $vertId[];
clear $vertId;
for ($sel in $selections)
{
$vertId[size($vertId)] = `match "\\..*" $sel`;
}
}
As you see I use a global string var $vertId to store it outside the proc, so you can use it for the second step.
Second part is actually snapping all vertices (in the selected list from step one) back to the base model. Select all your blendshape target, and select base model last.
proc snapVertBack ()
{
string $selections[] = `ls -sl`;
string $baseModel = $selections[size($selections) - 1];
global string $vertId[];
for ($sel in $selections)
{
for ($i = 0; $i < size($vertId); $i++)
{
float $pos[3] = `xform -q -t ($baseModel + $vertId[$i])`;
xform -t $pos[0] $pos[1] $pos[2] ($sel + $vertId[$i]);
}
}
}
I use the same global var $vertId, as long as you are not overwriting it it will keep your vertex id selection intact.
It will traverse from your selected object (the blendshape target) and for each blendshape target, it will just move back the vertices to the base model.
Hope it helps,
Richie_P
09-03-2003, 06:04 AM
thanks everyone for the reply,
i tried to do both methods but no sucess so far,
misterdi, does your script work for maya 4.5
i have selected all vertexs that need to be reverted
then set up part 1 of the script as a button
then following your other instructions, part 2 as a buttons as well nothing happens,
im sure i missed out a step somewhere.
fongSaiYuk i think its a good solution although im lost after the third step of
repeat with the duplicateModel of the blendshapeModel as target and the blendshapeModel as base.
thanks for the replys all very helpful peeps
misterdi
09-03-2003, 07:20 AM
Richie, my script is a declaration only, you need to call it via command line or script editor.
First you need to do is run the script, when it has been run you will have 2 new function :
1. selVert()
2. snapVertBack().
When you have run the script:
select all the vertex you need to snap back, and type : "selVert" in command line (without the quote).
Then, select all your blendShape targets and basemodel (last), and type: "snapVertBack" in command line (without the quote).
Best regards,
Richie_P
09-03-2003, 09:40 PM
thanks misterdi,
your script worked a treat,
a few mins with the script saved hours of vert snapping
thanks again :)
fongSaiYuk
09-03-2003, 11:50 PM
"gotta admit, i'm a little bit confused" - r.waters
the essence of the script behaves as if the original model were a target shape and the newModelsThatNeedFxin were the baseShape, if blendShape had been used.
[ in this respect, the scripts are very cool because it handles multiple baseShapes with a single target.]
But, is that the essence?
i still do not undestand the original problem.
especially since, to repeat, had the ik'ed model been defined as target and the newModelsThatNeedFxin as base
( 1 x 1 unfortunately|coolScript), this would have achieved the same result, if using blendshape.
It would be great to see the model -
misterdi
09-04-2003, 09:19 AM
FongSaiYuk, I think the problem that Richie had, is due to some mistake that he create new the blendshape target (maybe adding to existing blendshape node) from an object that has been controlled by other deformer (in this case is the IK skin).
When he is concentrating on one area (like the face or the head) he didn't realize that the legs already deform, so when he add the new blendshape targets, he found out that the legs also deform when he change the weight of that target in blendshape editor.
This is due to the fact that those leg vertices is at different location from the base model. One thing he can do, is actualy redo the work for the target with correct base model or modify the target (in leg area) to match back the base model.
Redoing the work for facial target, I believe involved a lot of effort, tears and blood if dramatized. So he go to the other approach fixing the new blendshape target for the leg by snapping the vertices back to where it should be.
My script is actually not intended for this, I write the script for my student when he make mistake on doing facial modelling (which involve more than 10.000 vertices - hi poly). He has a saved version, when he start pulling/pushing point. His mistake is he didn't even care using back culling to isolate the back vertices when he do the model, and as you see the front face is quite nice, but when you rotate it you will see the back area is quite a mess.
So I suggest him to reload the saved version and start it over, and he start crying and begging for more time to redo it. So I just write the script to fix it and the same script I write for Richie.
Best regards,
fongSaiYuk
09-04-2003, 12:08 PM
thanks for the explanation, misterdi.
CGTalk Moderation
01-16-2006, 12: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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.