[UE Deformer Graph] partial application of the deformer graph

Skinned Mesh Vertex Attributes

Let's use the Skinned Mesh Vertex Attributes node of the deformer graph, this node allows you to read the value of a weight map painted over the surface of your model:

(In red each vertex is assigned 1.0f and the rest 0.0f)

Let's open up a skeletal mesh with the skeletal mesh editor:

First we need to create a per vertex attribute buffer, in New Attribute section type in your attribute name and hit Add Weight Map Layer

It should show up now in the Vertex Attributes Inspector:

We can move on to the Paint Maps tab and start painting the weight map:

Now go ahead and paint the area you'd like to deform:

Don't forget to push Apply otherwise changes will be discarded when leaving the menu.

For the deformer graph asset to access this new buffer it seems necessary to check import vertex attributes:

Go to a deformer asset, for instance /All/EngineData/Plugins/DeformerGraph/Deformers/DG_LinearBlendSkin

Let's modify to try out our new weight map, first add Skinned Mesh Vertex Attributes and connect it to your kernel:

Click on the node Skinned Mesh Vertex Attributes and set the name of the attribute in the detailed pannel

Now in your compute shader code add towards the end:

float w = ReadValue(Index); // Weight Map
SkinnedPosition = (1.0 - w) * SkinnedPosition.xyz + w * Position.xyz;

And voila! Your model's vertices should only display animation for areas that were not painted

Here we did not took care of smoothing the transition between the head and the body, so the weight maps abruptly changes from 1 to 0.

No comments

(optional field, I won't disclose or spam but it's necessary to notify you if I respond to your comment)
All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Anti-spam question: