View Full Version : ramp controlling blendshapes
Hi there;
Since I can paint blendshape's weights with artisan..., Is there a way to connect a file texture or a ramp to control those weights instead of painting them?.
Thank's for the info.
|
|
thematt
10-31-2008, 08:19 AM
yep I agree it would be cool, but it's not possible just like that.Because we don't have access to a node that would apply vetex color coresponding to a uv point..a agree it's pretty bad.
I bet you can do it easily in XSI ice. oh well maybe one day.
cheers
Well, I guess I can manually paint the weights, but I was searching for a more elegant solution, like being able to SDK the ramp wich control the weights of the blendshape so I don't have to animate my paint weights work everytime I want to use it...
Thank's for the info though.
A while ago I had a look at the Stroika plugins (http://www.kolektiv.com/products.php) and I'm pretty sure they had something called non-linear blendshapes that could be controlled by shaders. It might be worth a look.
-- David
thematt
10-31-2008, 01:46 PM
yes the strika plug do have that option, and it's darn powerfull, but you ahve to buy it.
Why something so usefull hasn't it been interger in maya for all that time is still a mistery to me. I can see tons of aplication for such usefull fonction.
cheers
thematt
11-04-2008, 01:54 PM
Hey Joie I've managed to take a look at the Dg and it's definetly not possible to do it stricly with node, but it was actually quite easy in mel.
So it's a start I guess and can be quite slow but you can assign a texture to an objet that have a blendShape and following the Uv you have set on the object it will set the blendShape accordingly.Can be much faster than painting and it can be animated without problem actually.
If you're interested I can share it here. Although it's can be quite slow on mesh with a lot of vertice since it has to loop through every vertice. still faster than painting on certain situation mostly for animation.
Would be cool if someone knowing API would write a simple node for getting the color at a vertex with the input of a texture.Then we could plug it in all kind of different thing.In the meantime it's a hack.
cheers
I'd be very grateful if you could share that, I wanted to use it with NURBS, so my objects are very mel friendly and have very few CVs to play with. :)
thematt
11-05-2008, 07:34 AM
hahaha..nurbs!! of course the one I made is for poly..ok let me take a look at something like that for nurbs.
in the meantime here it is for poly just in case
to use it source the script below and type:
Mr_colorBlendShape myobjetName myblendshapeName
the object that have the blendshape should have a texture assign in the color slot of his shader
global proc Mr_colorBlendShape(string $obj, string $blendShape)
{
//get the texture assign to the obj
string $shader[] = `listHistory -f 1 $obj`;
string $history[] = `listHistory $shader`;
string $texture[]= `ls -materials $history`;
string $colorTexture[]=`listConnections -s 1 -p 0 ($texture[0]+".color")`;
setAttr ($colorTexture[0]+".alphaIsLuminance") 1;
// get the number of vertex to loop on
int $size[] =`polyEvaluate -vertex $obj`;
int $i;
//loop on the vertice
for ($i=0;$i<$size[0];$i++)
{
// transform the vertex in Uv
string $map[]=`polyListComponentConversion -fv -tuv ($obj+".vtx["+$i+"]")`;
float $UV[]=`polyEditUV -q $map[0]`;
//sample the color
float $color[] =`colorAtPoint -o "A" -u $UV[0] -v $UV[1] $colorTexture[0]`;
//transfert the color at the vertex index to the blendshape weight on that vertex
setAttr ($blendShape+".inputTarget[0].inputTargetGroup[0].targetWeights["+$i+"]") $color[0];
// line that can be skip in case you don't want to set keyframe
setKeyframeBlendshapeTargetWts;
}
}
thematt
11-05-2008, 08:42 AM
sorry having probl with the nurbs because I can't find the corresponding number from the blendShape deformer with cv selected..both number are way different and i don't really understand right now how to go from one to the other..in poly it was the same as the index of the vertex so it was easy.
maybe someone else can help us out..I don't have much expereience scripting for nurbs actually.
sorry.
cheers
You don't have to be sorry for anything.
I usually use NURBS for quite simple things such as logos and they work pretty well. In fact I thought this would be easier with NURBS instead of polys..., what a shame.
thematt
11-05-2008, 01:25 PM
yep me too thought it would be easier with nurbs actually..:)
maybe you can use this script "NL_morph.mel" that you can find on highend it's based on softbody but it's quite cool and works good.Should work fine with nurbs, but it's a bit different from my script.
cheers
CGTalk Moderation
11-05-2008, 01:25 PM
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.