Description

There are multiple issues with the code at present

1) The animation preview world listener is not updated. This can be solved with the following override on AnimationEditorViewportClient (Following LevelEditorViewport's example)

virtual void SetupViewForRendering(FSceneViewFamily& ViewFamily, FSceneView& View)
	{
		FEditorViewportClient::SetupViewForRendering(ViewFamily, View);

		UWorld* ViewportWorld = GetWorld();
		if(!ViewportWorld)
		{
			return;
		}

		if (FAudioDevice* AudioDevice = ViewportWorld->GetAudioDevice())
		{
			FVector ViewLocation = GetViewLocation();

			const FRotator& ViewRotation = GetViewRotation();

			FTransform ListenerTransform(ViewRotation);
			ListenerTransform.SetLocation(ViewLocation);

			AudioDevice->SetListener(ViewportWorld, 0, ListenerTransform, 0.f);
		}
	}

2) FAudioDevice does not honour attenuation settings from non game worlds. We need an override on FAudioDevice eg:

bool bHasAttenuationSettings = ((bIsInGameWorld || bUseAttenWithoutGameWorld)&& AttenuationSettingsToApply);

~ *Note there is more than one place in the code where the bIsInGameWorld check is made, they will all need to be found / updated. ~

Use of attenuation settings should be exposed in the editor. Default of either off or on should probably be discussed.

Steps to Reproduce

1) Open and animation
2) Add a sound notify if one is not present.
3) notice sound attenuation does not change with distance and that sound radius/falloff are not respected.

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentOLD - Anim
Affects Versions4.16
Target Fix4.17
Fix Commit3488952
Main Commit3502661
CreatedApr 21, 2017
ResolvedJun 14, 2017
UpdatedMay 18, 2020