Best way to duplicate a skeletal mesh that is animating for the purpose of applying a highlight to

I need to be able to apply an outline to a skeletal mesh, and have it update with it as it animates. This needs to work on iOS, so it cannot use a post-process with the custom depth buffer. Currently, we are duplicating the model in the actual maya file and inverting its normals. This solution looks bad visually though, as it isn’t just an edge highlight, but is instead highlighting all of the little details in the core of the model as well.

The methods I’ve found that look the best require duplicating the mesh still, but without the inverted normals, and apply a translucent material to it with some highlighting logic. This sounds great, but I am not sure how to go about duplicating the mesh in unreal as opposed to in the model file, on a model with a moving and animating skeletal mesh component, and have the duplicated model inherit all of the movement and animations.

TL;DR: What is the best method of duplicating an animating model at run time for the purpose of applying a highlight material to it?

Hi Alex,

There’s a few ways you could handle this. The easiest way to duplicate your mesh without writing some custom rendering code is probably to add a new skeletal mesh component to your actor using the same mesh but your new material. On BeginPlay for the actor use the node SetMasterPoseComponent and set the master pose of the new mesh to the original mesh.

This will make the new mesh take the pose from the original and they should appear identical.

Hope this helps,

Benn.

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

That’s fine by me, go ahead.