Unable to update Morph targets via editor utility widget

Calling “SetMorphTarget” on a skeletal mesh component from an editor utility widget updates the value, but does not reflect any change in the viewport.

Running the blueprint’s construction script manually outside of the widget refreshes the skeletal mesh component in the viewport and applies the morphs as expected using the previously applied values.
Using “Run actor construction scripts” after updating the morph targets does not work either.

I was facing the same issue and by adding “Set Update Animation in Editor” node after setting the new morph target value did work in editor viewport.

1 Like

That worked for me, thanks. Previously I was building my NPCs using the construction script, but that was getting a bit messy and slow since the construction script has a tendency to execute many times (even with update on drag disabled- still executed for me 11 times! on compile).

For whatever reason, since the character animation blueprint is active when you look in the blueprint viewport (unless you’ve disabled it), that seems to allow morph targets to update for both the character in the BP viewport as well as in the level at editor time.

If you add a live link component to your character, it will also let you update morphs, since it’s also executing ‘Set Update Animation In Editor’:

if (bIsDirty)
	{
		TArray<USkeletalMeshComponent*> SkeletalMeshComponents;
		GetOwner()->GetComponents(SkeletalMeshComponents);
		for (USkeletalMeshComponent* SkeletalMeshComponent : SkeletalMeshComponents)
		{
			SkeletalMeshComponent->SetUpdateAnimationInEditor(true);
		}
		bIsDirty = false;
	}

The only downside is that the character idle animation will play as you update morphs, which can be a little annoying. So I added a new locomotion state in my anim BP that uses the idle animation at play rate 0. That allowed me to edit morphs in the editor while the character remains still

Capture