Control Blendshape with an attribute

   2844   2   1
User Avatar
Member
562 posts
Joined: March 2014
Offline
How does one control Blendshapes with an attribute in Houdini ?

It seems all I can do to control where the Shape is applied is using a Group with a bounding object, but that creates a very sharp edge.

What I'm looking for is a smooth falloff to control the Shape amount.

In Softimage this was really easy by using a weightmap. And I've been searching for a way to do something similar in Houdini, but so far not much luck without writing a lot of VEX code it seems.

I was hoping for a simpler solution for something so basic.

Does anyone have any pointers ?

Thanks.

R.
Edited by toonafish - April 17, 2022 07:58:11
User Avatar
Member
173 posts
Joined: Aug. 2017
Offline
take the two models -> Ray Sop- projects ray /direction from vector -than attribute paint ' blendshape mask '

than use this VEx

@P2 = point(1, "P", @ptnum);
if(haspointattrib(1, "blendshape_mask")){
@M2 = point(1, "blendshape_mask", @ptnum);
@P = lerp(@P, v@P2, f@M2*ch("intensity"));
}
else{
@M2 = point(1, "blendshape_mask", @ptnum);
@P = lerp(@P, v@P2, ch("intensity"));
}

+ some other vex on grid and mountain
vector offset = point(1, "P", @ptnum) - v@P;
vector color_offset = point(1, "Cd", @ptnum);

float offset_dot = dot(normalize(offset), set(0,1,0));

if(offset_dot > 0){
   
    v@P += offset;
    
    v@Cd = color_offset;
    
}

vector offset = point(1, "P", @ptnum) - v@P;
vector color_offset = point(1, "Cd", @ptnum);

float offset_dot = dot(normalize(offset), v@N);

if(offset_dot > 0){
   
    v@P += offset;
    
    v@Cd = color_offset;
    
    v@N = point(1, "N", @ptnum);
    
    if(length(offset) > chf('Height')){
    
        v@Cd = set(1,1,1);
    
    }    
    
}
Edited by cncverkstad - April 17, 2022 09:26:29
Conservation of Momentum
User Avatar
Member
562 posts
Joined: March 2014
Offline
Great, thanks a lot, I'll give it a shot.

I also ran into this tutorial that also looks promising : https://youtu.be/gINvU11LHB0 [youtu.be]

Just in case someone else runs into the same problem.
  • Quick Links