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.
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.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-44252 in the post.
0 |
Component | OLD - Anim |
---|---|
Affects Versions | 4.16 |
Target Fix | 4.17 |
Fix Commit | 3488952 |
---|---|
Main Commit | 3502661 |
Created | Apr 21, 2017 |
---|---|
Resolved | Jun 14, 2017 |
Updated | May 18, 2020 |