Have a bone's rotation drive a morphtarget's strength

Is there a way currently with the stock nodes to read the rotation of a particular bone and have that drive the weight of a morphtarget? For example, if an elbow on a character is straight (z rotation = 0), the morphtarget’s weight would be zero. As the Z rotation starts to interpolate up to 90 degrees, the morphtarget’s weight would gradually scale up to 1.0.

Hi,
I think you could do this in UE4 using the ‘Get Socket Transform’ node. It can return the transform of a bone as well as a socket. I played around for a few minutes this morning, and it seems like this will work. My example:

This is from an AnimBP EventGraph. I’m basically casting the PawnOwner to a Character so that I can access the Mesh (using Get Mesh). From there, I’m able to read the transform of a bone or socket (using Get Socket Transform). Then, I transform the rotation of that bone from World Space to the space of its parent (using Transform to Bone Space and supplying the parent bone). Then break that now local rotation to get the bend axis (just picked yaw arbitrarily in the example).

That’s as far as I took it, but you should be able to then use that single rotation value to drive a “Set Morph Target” node.

Hope this helps!

That’s it. Thank’s Ray! Didn’t even think of using a socket. I’m not really experienced with casting. It looks like the cast actually fails but the whole system still works?

For anyone who stumbles on this thread I attached what a near-final AnimBP would look like off of Ray’s example. I normalized one of the bone’s rotations. The normalize values aren’t precise, but they work to test it out.

No problem. Happy to help.

Couple extra things. First, you don’t actually have to supply a socket to ‘Get Socket Transform’. It will also give you a bone’s transform. So, you could just plug your upper arm bone into that ‘Socket Transform’ node. Second, ‘Get Owning Actor’, ‘Get Pawn Owner’, etc will always seem to fail in an Animation Blueprint. If you think about it, it makes sense because while you are working on the AnimBP, it doesn’t have an owning actor or pawn. It just kinda exists in a vacuum until it is utilized in-game.

That’s good to know, didn’t know it could take a regular bone too. I’m still learning a lot about casting, so thank you for the info and explanation, Ray!

I’m looking forward to using this. It would be nice if there was an even easier way to implement without even needing to use blueprints.

In UE 4.13 there’s a new node for corrective morphs controlled by a bone’s pose. You have to make a PoseAsset, though. Here are the release notes.

In UE 4.13 there’s a new node for this specific purpose: Pose Driver Animation Node. You have to use a PoseAsset together with it. From the release notes:

We have added a new Pose Driver node, which lets you drive a curve value (such as a morph target weight) based on a bone’s movement. This uses an RBF (Radial Basis Function) to interpolate driven values based on the orientation of a target bone. You use a PoseAsset to define the target poses for the bone, and the desired curve values at each pose. This node can be used as a Pose Space Deformer, to drive corrective blend shapes based on the orientation of a bone.

mr
RVillani i have 4.13.0 but pose driver is missing but bone driven controler is avilable. i m new trying to corrective shape and wrinkle map but i have no proper idea plz give me any solution

I kinda dislike the kind of answer I’ll give you now, but I’m in a hurry in a deadline here, so I hope it helps. There’s this video from Epic, teaching how to use these new pose systems. It is big, but it covers a lot of new stuff.

thank you mr RVillani …

mr RVillani
u have any trick for hair works work with morph target because i use beard eyebrow eyelash hair work but not work facial expressions blendshaps

No, man. I haven’t played with hair works yet.