Description

When UPrimitiveComponent::CreateDynamicMaterialInstance is called on a skinned mesh, and the input material is invalid, we call USkinnedMeshComponent::GetMaterial to get the base material on the existing mesh.  The problem is that, during actor reconstruction, the mesh that GetMaterial retrieves is always going to be the base mesh, not any overridden mesh that a user has set in the level viewport.

This is a general issue with trying to get an overridden mesh during actor construction, the component will always return the value on the class archetype.  Using SkeletalMeshComponentInstanceData to cache the mesh asset value is not the right way to fix this as that causes other serialization bugs ([Link Removed])

Steps to Reproduce
  1. Create an actor blueprint
  2. Add a SkeletalMeshComponent (has to be done via blueprint)
  3. Set a mesh on the mesh component (the base mesh)
  4. Add a Material variable to the actor blueprint and leave it's value as None
  5. In the construction script, call Create Dynamic Material Instance and pass in your Material variable (see screenshot 1)
  6. Drop the actor into the level viewport
  7. Override the mesh on the actor's skeletal mesh component
    1. Note how the overridden mesh is still using the base mesh's material (screenshot 2 - the UE4 mannequin using the UEFN mannequin material)

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-243870 in the post.

0
Login to Vote

Unresolved
CreatedFeb 6, 2025
UpdatedFeb 14, 2025
View Jira Issue