void FSCSEditorViewportClient::FocusViewportToSelection() { AActor* PreviewActor = GetPreviewActor(); if(PreviewActor) { TArray<FSCSEditorTreeNodePtrType> SelectedNodes = BlueprintEditorPtr.Pin()->GetSelectedSCSEditorTreeNodes(); if(SelectedNodes.Num() > 0) { // Use the last selected item for the widget location USceneComponent* SceneComp = Cast<USceneComponent>(SelectedNodes.Last()->FindComponentInstanceInActor(PreviewActor)); if( SceneComp ) { FocusViewportOnBox( SceneComp->Bounds.GetBox() ); } } else { FocusViewportOnBox( PreviewActor->GetComponentsBoundingBox( true ) ); } } }
void FStaticMeshEditorViewportClient::ResetCamera() { FocusViewportOnBox( StaticMeshComponent->Bounds.GetBox() ); Invalidate(); }
virtual void ResetCamera() { if (!SelectedActor) return; FocusViewportOnBox(SelectedActor->GetComponentsBoundingBox()); }