Files
UnrealEngineUWP/Engine/Source/Editor/Kismet/Private/Debugging/SKismetDebuggingView.cpp

522 lines
15 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Debugging/SKismetDebuggingView.h"
#include "Debugging/SKismetDebugTreeView.h"
#include "BlueprintEditor.h"
#include "ClassViewerFilter.h"
#include "ClassViewerModule.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "EdGraph/EdGraphPin.h"
#include "Engine/Blueprint.h"
#include "Textures/SlateIcon.h"
#include "Framework/Commands/UIAction.h"
#include "Widgets/Images/SImage.h"
#include "Framework/MultiBox/MultiBoxDefs.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "Widgets/Input/SButton.h"
#include "Styling/AppStyle.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "GameFramework/Actor.h"
#include "Editor/EditorEngine.h"
#include "EngineGlobals.h"
#include "Engine/BlueprintGeneratedClass.h"
#include "Editor.h"
#include "GraphEditorSettings.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Kismet2/KismetEditorUtilities.h"
#include "K2Node.h"
#include "Kismet2/Breakpoint.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Kismet2/KismetDebugUtilities.h"
#include "Kismet2/DebuggerCommands.h"
#include "Widgets/Input/SHyperlink.h"
#include "ToolMenus.h"
#include "PropertyEditor/Private/SDetailsView.h"
#include "Styling/SlateIconFinder.h"
#include "Styling/StyleColors.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "PropertyInfoViewStyle.h"
#include "GenericPlatform/GenericPlatformApplicationMisc.h"
#include "Widgets/Input/SCheckBox.h"
#include "Widgets/Input/SSearchBox.h"
#include "HAL/PlatformApplicationMisc.h"
#define LOCTEXT_NAMESPACE "DebugViewUI"
DEFINE_LOG_CATEGORY_STATIC(LogBlueprintDebuggingView, Log, All);
//////////////////////////////////////////////////////////////////////////
namespace KismetDebugViewConstants
{
const FText ColumnText_Name( NSLOCTEXT("DebugViewUI", "Name", "Name") );
const FText ColumnText_Value( NSLOCTEXT("DebugViewUI", "Value", "Value") );
const FText ColumnText_DebugKey( FText::GetEmpty() );
const FText ColumnText_Info( NSLOCTEXT("DebugViewUI", "Info", "Info") );
}
//////////////////////////////////////////////////////////////////////////
// SKismetDebuggingView
TWeakObjectPtr<const UObject> SKismetDebuggingView::CurrentActiveObject = nullptr;
TSharedRef<SHorizontalBox> SKismetDebuggingView::GetDebugLineTypeToggle(FDebugLineItem::EDebugLineType Type, const FText& Text)
{
return SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
[
SNew(SCheckBox)
.IsChecked(ECheckBoxState::Checked)
.OnCheckStateChanged_Static(&FDebugLineItem::OnDebugLineTypeActiveChanged, Type)
]
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(4.0f, 0.0f, 10.0f, 0.0f)
.VAlign(VAlign_Center)
[
SNew( STextBlock )
.Text(Text)
];
}
void SKismetDebuggingView::OnSearchTextChanged(const FText& Text)
{
DebugTreeView->ClearExpandedItems();
OtherTreeView->ClearExpandedItems();
DebugTreeView->SetSearchText(Text);
OtherTreeView->SetSearchText(Text);
}
FText SKismetDebuggingView::GetTabLabel() const
{
return BlueprintToWatchPtr.IsValid() ?
FText::FromString(BlueprintToWatchPtr->GetName()) :
NSLOCTEXT("BlueprintExecutionFlow", "TabTitle", "Data Flow");
}
void SKismetDebuggingView::TryRegisterDebugToolbar()
{
static const FName ToolbarName = "Kismet.DebuggingViewToolBar";
if (!UToolMenus::Get()->IsMenuRegistered(ToolbarName))
{
UToolMenu* ToolBar = UToolMenus::Get()->RegisterMenu(ToolbarName, NAME_None, EMultiBoxType::SlimHorizontalToolBar);
FToolMenuSection& Section = ToolBar->AddSection("Debug");
FPlayWorldCommands::BuildToolbar(Section);
}
}
FText SKismetDebuggingView::GetTopText() const
{
return LOCTEXT("ShowDebugForActors", "Showing debug info for instances of the blueprint:");
}
FText SKismetDebuggingView::GetToggleAllBreakpointsText() const
{
const FBlueprintBreakpoint* EnabledBreakpoint = FKismetDebugUtilities::FindBreakpointByPredicate(BlueprintToWatchPtr.Get(), [](const FBlueprintBreakpoint& Breakpoint)
{
return Breakpoint.IsEnabled();
});
if (EnabledBreakpoint)
{
return LOCTEXT("DisableAllBreakPoints", "Disable All Breakpoints");
}
else
{
return LOCTEXT("EnableAllBreakPoints", "Enable All Breakpoints");
}
}
bool SKismetDebuggingView::CanToggleAllBreakpoints() const
{
if(BlueprintToWatchPtr.IsValid())
{
return FKismetDebugUtilities::BlueprintHasBreakpoints(BlueprintToWatchPtr.Get());
}
return false;
}
FReply SKismetDebuggingView::OnToggleAllBreakpointsClicked()
{
if (UBlueprint* Blueprint = BlueprintToWatchPtr.Get())
{
const FBlueprintBreakpoint* EnabledBreakpoint = FKismetDebugUtilities::FindBreakpointByPredicate(BlueprintToWatchPtr.Get(), [](const FBlueprintBreakpoint& Breakpoint)
{
return Breakpoint.IsEnabled();
});
bool bHasAnyEnabledBreakpoint = EnabledBreakpoint != nullptr;
if (BlueprintToWatchPtr.IsValid())
{
FKismetDebugUtilities::ForeachBreakpoint(BlueprintToWatchPtr.Get(),
[bHasAnyEnabledBreakpoint](FBlueprintBreakpoint& Breakpoint)
{
FKismetDebugUtilities::SetBreakpointEnabled(Breakpoint, !bHasAnyEnabledBreakpoint);
}
);
}
return FReply::Handled();
}
return FReply::Unhandled();
}
class FBlueprintFilter : public IClassViewerFilter
{
public:
FBlueprintFilter() = default;
virtual bool IsClassAllowed(const FClassViewerInitializationOptions& InInitOptions, const UClass* InClass, TSharedRef< FClassViewerFilterFuncs > InFilterFuncs ) override
{
return InClass && !InClass->HasAnyClassFlags(CLASS_Deprecated) &&
InClass->HasAllClassFlags(CLASS_CompiledFromBlueprint);
}
virtual bool IsUnloadedClassAllowed(const FClassViewerInitializationOptions& InInitOptions, const TSharedRef< const IUnloadedBlueprintData > InUnloadedClassData, TSharedRef< FClassViewerFilterFuncs > InFilterFuncs) override
{
return !InUnloadedClassData->HasAnyClassFlags(CLASS_Deprecated) &&
InUnloadedClassData->HasAllClassFlags(CLASS_CompiledFromBlueprint);
}
};
void SKismetDebuggingView::OnBlueprintClassPicked(UClass* PickedClass)
{
if (PickedClass)
{
BlueprintToWatchPtr = Cast<UBlueprint>(PickedClass->ClassGeneratedBy);
}
else
{
// User selected None Option
BlueprintToWatchPtr.Reset();
}
FDebugLineItem::SetBreakpointParentItemBlueprint(BreakpointParentItem, BlueprintToWatchPtr);
DebugClassComboButton->SetIsOpen(false);
}
TSharedRef<SWidget> SKismetDebuggingView::ConstructBlueprintClassPicker()
{
FClassViewerInitializationOptions Options;
Options.Mode = EClassViewerMode::ClassPicker;
Options.bShowBackgroundBorder = false;
Options.ClassFilters.Add(MakeShared<FBlueprintFilter>());
Options.bIsBlueprintBaseOnly = true;
Options.bShowUnloadedBlueprints = false;
Options.bShowNoneOption = true;
FClassViewerModule& ClassViewerModule = FModuleManager::LoadModuleChecked<FClassViewerModule>("ClassViewer");
FOnClassPicked OnClassPicked;
OnClassPicked.BindRaw(this, &SKismetDebuggingView::OnBlueprintClassPicked);
return SNew(SBox)
.HeightOverride(500.f)
[
ClassViewerModule.CreateClassViewer(Options, OnClassPicked)
];
}
void SKismetDebuggingView::Construct(const FArguments& InArgs)
{
BlueprintToWatchPtr = InArgs._BlueprintToWatch;
// Build the debug toolbar
static const FName ToolbarName = "Kismet.DebuggingViewToolBar";
TryRegisterDebugToolbar();
FToolMenuContext MenuContext(FPlayWorldCommands::GlobalPlayWorldActions);
TSharedRef<SWidget> ToolbarWidget = UToolMenus::Get()->GenerateWidget(ToolbarName, MenuContext);
DebugClassComboButton =
SNew(SComboButton)
.OnGetMenuContent_Raw(this, &SKismetDebuggingView::ConstructBlueprintClassPicker)
.ButtonContent()
[
SNew(STextBlock)
.Text_Lambda([&BlueprintToWatchPtr = BlueprintToWatchPtr]()
{
return BlueprintToWatchPtr.IsValid()?
FText::FromString(BlueprintToWatchPtr->GetName()) :
LOCTEXT("SelectBlueprint", "Select Blueprint");
})
];
FBlueprintContextTracker::OnEnterScriptContext.AddLambda(
[](const FBlueprintContextTracker& ContextTracker, const UObject* ContextObject, const UFunction* ContextFunction)
{
CurrentActiveObject = ContextObject;
}
);
FBlueprintContextTracker::OnExitScriptContext.AddLambda(
[](const FBlueprintContextTracker& ContextTracker)
{
CurrentActiveObject = nullptr;
}
);
this->ChildSlot
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew(SBorder)
.BorderImage( FAppStyle::GetBrush( TEXT("NoBorder") ) )
[
ToolbarWidget
]
]
+SVerticalBox::Slot()
.AutoHeight()
[
SNew( SVerticalBox )
+SVerticalBox::Slot()
.AutoHeight()
[
SNew( STextBlock )
.Text( this, &SKismetDebuggingView::GetTopText )
]
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew( SHorizontalBox )
+ SHorizontalBox::Slot()
.HAlign( HAlign_Left )
[
SNew(SBox)
.WidthOverride(400.f)
[
DebugClassComboButton.ToSharedRef()
]
]
+ SHorizontalBox::Slot()
.HAlign( HAlign_Right )
[
SNew( SButton )
.IsEnabled( this, &SKismetDebuggingView::CanToggleAllBreakpoints )
.Text( this, &SKismetDebuggingView::GetToggleAllBreakpointsText )
.OnClicked( this, &SKismetDebuggingView::OnToggleAllBreakpointsClicked )
]
]
+ SVerticalBox::Slot()
.AutoHeight()
[
SAssignNew(SearchBox, SSearchBox)
.OnTextChanged(this, &SKismetDebuggingView::OnSearchTextChanged)
]
]
+SVerticalBox::Slot()
[
SNew(SSplitter)
.Orientation(Orient_Vertical)
+SSplitter::Slot()
[
SAssignNew( DebugTreeView, SKismetDebugTreeView )
.InDebuggerTab(true)
.HeaderRow
(
SNew(SHeaderRow)
+ SHeaderRow::Column(SKismetDebugTreeView::ColumnId_Name)
.DefaultLabel(KismetDebugViewConstants::ColumnText_Name)
+ SHeaderRow::Column(SKismetDebugTreeView::ColumnId_Value)
.DefaultLabel(KismetDebugViewConstants::ColumnText_Value)
)
]
+SSplitter::Slot()
[
SAssignNew( OtherTreeView, SKismetDebugTreeView )
.InDebuggerTab(true)
.HeaderRow
(
SNew(SHeaderRow)
+ SHeaderRow::Column(SKismetDebugTreeView::ColumnId_Name)
.DefaultLabel(KismetDebugViewConstants::ColumnText_DebugKey)
+ SHeaderRow::Column(SKismetDebugTreeView::ColumnId_Value)
.DefaultLabel(KismetDebugViewConstants::ColumnText_Info)
)
]
]
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
[
GetDebugLineTypeToggle(FDebugLineItem::DLT_Watch, LOCTEXT("Watchpoints", "Watchpoints"))
]
+ SHorizontalBox::Slot()
.AutoWidth()
[
GetDebugLineTypeToggle(FDebugLineItem::DLT_LatentAction, LOCTEXT("LatentActions", "Latent Actions"))
]
+ SHorizontalBox::Slot()
.AutoWidth()
[
GetDebugLineTypeToggle(FDebugLineItem::DLT_BreakpointParent, LOCTEXT("Breakpoints", "Breakpoints"))
]
+ SHorizontalBox::Slot()
.AutoWidth()
[
GetDebugLineTypeToggle(FDebugLineItem::DLT_TraceStackParent, LOCTEXT("ExecutionTrace", "Execution Trace"))
]
]
];
TraceStackItem = SKismetDebugTreeView::MakeTraceStackParentItem();
BreakpointParentItem = SKismetDebugTreeView::MakeBreakpointParentItem(BlueprintToWatchPtr);
}
void SKismetDebuggingView::Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime)
{
// don't update during scroll. this will help make the scroll smoother
if (DebugTreeView->IsScrolling() || OtherTreeView->IsScrolling())
{
return;
}
// update less often to avoid lag
TreeUpdateTimer += InDeltaTime;
if (TreeUpdateTimer < UpdateInterval)
{
return;
}
TreeUpdateTimer = 0.f;
// Gather the old root set
TSet<UObject*> OldRootSet;
for (const FDebugTreeItemPtr& Item : DebugTreeView->GetRootTreeItems())
{
if (UObject* OldObject = Item->GetParentObject())
{
OldRootSet.Add(OldObject);
}
}
// Gather what we'd like to be the new root set
Copying //UE4/Dev-Framework to //UE4/Main #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2830238 on 2016/01/15 by Aaron.McLeran Added comment and documentation for CreateAudioComponent function in FAudioDevice Change 2830283 on 2016/01/15 by Aaron.McLeran Adding call to XAudio2->Release() when no audio devices are found. Change 2830286 on 2016/01/15 by Aaron.McLeran Re-enabling voice recycling. Change 2830287 on 2016/01/15 by Aaron.McLeran Reseting LastLPFFrequency to FLT_MAX instead of MAX_FILTER_FREQUENCY so that the xaudio2 voice will get SetFilterParameters called on it at least once. Change 2830336 on 2016/01/15 by Zak.Middleton #ue4 - Replace FMath::Fmod(x, y) with our own implementation on all platforms. Ensure on y=0 input, and return 0 in this case (rather than NaN). - We have been using this replacement on all platforms for a while recently because of an accidental #ifdef instead of #if PLATFORM_WINDOWS introduced about 2 months ago. #rb Laurent.Delayen Change 2830374 on 2016/01/15 by Zak.Middleton #ue4 - Add comment explaining how AttachmentReplication is updated (via GatherCurrentMovement). Change 2830520 on 2016/01/15 by Ori.Cohen Fix AActor::IsOverlappingActor to iterate over owned components instead of attached components #rb Marc.Audy Change 2831932 on 2016/01/18 by Thomas.Sarkanen Added extra debug info to help track down UE-24732. Issue should no longer be present in 4.11, although there is still no reliable repro, hence adding more info to logging. #rb Martin.Wilson #jira UE-24732 Change 2832100 on 2016/01/18 by Benn.Gallagher Fixed memory leak in cloth (1.43KB per cloth chunk per render creation) and unsafe memory management of all other vertex factories. #rb Gareth.Martin Change 2832497 on 2016/01/18 by Aaron.McLeran UE-25579 Reversing coodinates of Z-axis for translating UE4 coordinates to oculus coordinates. Change 2832511 on 2016/01/18 by Aaron.McLeran Checking in assets for QAGame to test HRTF spatialization Change 2832920 on 2016/01/18 by Lina.Halper Fix crash on calling SetRootBody on mesh component with MasterPoseComponent on. - Should not create physics body for slave mesh component #rb : Ori.Cohen - duplicated CL with 2832738 Change 2833052 on 2016/01/18 by Aaron.McLeran UE-24237 UE-18686 Audio not playing at Start Time set by Play node on PC Change 2834793 on 2016/01/19 by Mason.Seay Deleting asset that is no longer needed Change 2835560 on 2016/01/20 by Thomas.Sarkanen Anim graphs are now debuggable in the Persona graph editor Added pin properties to the debug object map so they can be tracked. Added code to route debug data via anim nodes for anim blueprints. This allows us to retrieve the properties of these nodes by looking them up in the correct container (i.e. the node, not the anim instance). Changed FBlueprintDebugData::FindClassPropertyForPin to also traverse output pins. This was seemingly some legacy code that was no longer needed and was preveting watches form being displayed even when data was present. Fixed SKismetDebuggingView to actually display the debugged object if one is selected. Previously it only displayed the UBlueprint itself or selected actors. The old behaviour is still there if no debug object is displayed. Changed UEditorEngine::GetFriendlyName to not crash if passed an actual UStruct property. The function purported to deal with UStructs but in fact assumed that all properties were UClass members by calling Property->GetOwnerClass(). #jira UE-25100 - Anim BP watch doesn't work for PIE characters #rb James.Golding Change 2835924 on 2016/01/20 by Marc.Audy Bitpack FModifierKeysState key state booleans Change 2835927 on 2016/01/20 by Marc.Audy Cache on the stack returned values Change 2835961 on 2016/01/20 by Marc.Audy PR #1953: PIE: Support more then one digits in PIE prefix ("UEDPIE_[0-9]+_" instead of "UEDPIE_[0-9]_") (Contributed by bozaro) #jira UE-25652 Change 2836033 on 2016/01/20 by Benn.Gallagher Clamped cloth solver frequency to always have a frequency of at least 1 #rb Graeme.Thornton Change 2836339 on 2016/01/20 by Ori.Cohen Give the ability to turn off face remap table which saves memory in physx #rb Lina.Halper Change 2836364 on 2016/01/20 by Ori.Cohen Turn off face index remap at runtime. #rb Lina.Halper [CL 2839496 by Marc Audy in Main branch]
2016-01-22 00:23:21 -05:00
const bool bIsDebugging = GEditor->PlayWorld != nullptr;
TSet<UObject*> NewRootSet;
const auto TryAddBlueprintToNewRootSet = [&NewRootSet](UBlueprint* InBlueprint)
Copying //UE4/Dev-Framework to //UE4/Main #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2830238 on 2016/01/15 by Aaron.McLeran Added comment and documentation for CreateAudioComponent function in FAudioDevice Change 2830283 on 2016/01/15 by Aaron.McLeran Adding call to XAudio2->Release() when no audio devices are found. Change 2830286 on 2016/01/15 by Aaron.McLeran Re-enabling voice recycling. Change 2830287 on 2016/01/15 by Aaron.McLeran Reseting LastLPFFrequency to FLT_MAX instead of MAX_FILTER_FREQUENCY so that the xaudio2 voice will get SetFilterParameters called on it at least once. Change 2830336 on 2016/01/15 by Zak.Middleton #ue4 - Replace FMath::Fmod(x, y) with our own implementation on all platforms. Ensure on y=0 input, and return 0 in this case (rather than NaN). - We have been using this replacement on all platforms for a while recently because of an accidental #ifdef instead of #if PLATFORM_WINDOWS introduced about 2 months ago. #rb Laurent.Delayen Change 2830374 on 2016/01/15 by Zak.Middleton #ue4 - Add comment explaining how AttachmentReplication is updated (via GatherCurrentMovement). Change 2830520 on 2016/01/15 by Ori.Cohen Fix AActor::IsOverlappingActor to iterate over owned components instead of attached components #rb Marc.Audy Change 2831932 on 2016/01/18 by Thomas.Sarkanen Added extra debug info to help track down UE-24732. Issue should no longer be present in 4.11, although there is still no reliable repro, hence adding more info to logging. #rb Martin.Wilson #jira UE-24732 Change 2832100 on 2016/01/18 by Benn.Gallagher Fixed memory leak in cloth (1.43KB per cloth chunk per render creation) and unsafe memory management of all other vertex factories. #rb Gareth.Martin Change 2832497 on 2016/01/18 by Aaron.McLeran UE-25579 Reversing coodinates of Z-axis for translating UE4 coordinates to oculus coordinates. Change 2832511 on 2016/01/18 by Aaron.McLeran Checking in assets for QAGame to test HRTF spatialization Change 2832920 on 2016/01/18 by Lina.Halper Fix crash on calling SetRootBody on mesh component with MasterPoseComponent on. - Should not create physics body for slave mesh component #rb : Ori.Cohen - duplicated CL with 2832738 Change 2833052 on 2016/01/18 by Aaron.McLeran UE-24237 UE-18686 Audio not playing at Start Time set by Play node on PC Change 2834793 on 2016/01/19 by Mason.Seay Deleting asset that is no longer needed Change 2835560 on 2016/01/20 by Thomas.Sarkanen Anim graphs are now debuggable in the Persona graph editor Added pin properties to the debug object map so they can be tracked. Added code to route debug data via anim nodes for anim blueprints. This allows us to retrieve the properties of these nodes by looking them up in the correct container (i.e. the node, not the anim instance). Changed FBlueprintDebugData::FindClassPropertyForPin to also traverse output pins. This was seemingly some legacy code that was no longer needed and was preveting watches form being displayed even when data was present. Fixed SKismetDebuggingView to actually display the debugged object if one is selected. Previously it only displayed the UBlueprint itself or selected actors. The old behaviour is still there if no debug object is displayed. Changed UEditorEngine::GetFriendlyName to not crash if passed an actual UStruct property. The function purported to deal with UStructs but in fact assumed that all properties were UClass members by calling Property->GetOwnerClass(). #jira UE-25100 - Anim BP watch doesn't work for PIE characters #rb James.Golding Change 2835924 on 2016/01/20 by Marc.Audy Bitpack FModifierKeysState key state booleans Change 2835927 on 2016/01/20 by Marc.Audy Cache on the stack returned values Change 2835961 on 2016/01/20 by Marc.Audy PR #1953: PIE: Support more then one digits in PIE prefix ("UEDPIE_[0-9]+_" instead of "UEDPIE_[0-9]_") (Contributed by bozaro) #jira UE-25652 Change 2836033 on 2016/01/20 by Benn.Gallagher Clamped cloth solver frequency to always have a frequency of at least 1 #rb Graeme.Thornton Change 2836339 on 2016/01/20 by Ori.Cohen Give the ability to turn off face remap table which saves memory in physx #rb Lina.Halper Change 2836364 on 2016/01/20 by Ori.Cohen Turn off face index remap at runtime. #rb Lina.Halper [CL 2839496 by Marc Audy in Main branch]
2016-01-22 00:23:21 -05:00
{
for (FThreadSafeObjectIterator Iter(InBlueprint->GeneratedClass, /*bOnlyGCedObjects =*/ false, /*AdditionalExclusionFlags =*/ RF_ArchetypeObject | RF_ClassDefaultObject); Iter; ++Iter)
{
UObject* Instance = *Iter;
if (!Instance)
{
continue;
}
// only include instances of objects in a PIE world
if (UWorld* World = Instance->GetTypedOuter<UWorld>())
{
if (!World || World->WorldType != EWorldType::PIE)
{
continue;
}
}
NewRootSet.Add(Instance);
}
};
if(bIsDebugging)
{
if (BlueprintToWatchPtr.IsValid())
{
// Show blueprint objects of the selected class
TryAddBlueprintToNewRootSet(BlueprintToWatchPtr.Get());
}
else
{
// Show all blueprint objects with watches
for (FThreadSafeObjectIterator BlueprintIter(UBlueprint::StaticClass(), /*bOnlyGCedObjects =*/ false, /*AdditionalExclusionFlags =*/ RF_ArchetypeObject | RF_ClassDefaultObject); BlueprintIter; ++BlueprintIter)
{
UBlueprint* Blueprint = Cast<UBlueprint>(*BlueprintIter);
if (Blueprint && FKismetDebugUtilities::BlueprintHasPinWatches(Blueprint))
{
TryAddBlueprintToNewRootSet(Blueprint);
}
}
}
}
// This will pull anything out of Old that is also New (sticking around), so afterwards Old is a list of things to remove
DebugTreeView->ClearTreeItems();
for (UObject* ObjectToAdd : NewRootSet)
{
TWeakObjectPtr<UObject> WeakObject = ObjectToAdd;
// destroyed objects can still appear if they haven't ben GCed yet.
// weak object pointers will detect it and return nullptr
if(!WeakObject.Get())
{
continue;
}
if (OldRootSet.Contains(ObjectToAdd))
{
OldRootSet.Remove(ObjectToAdd);
const TSharedPtr<FDebugLineItem>& Item = ObjectToTreeItemMap.FindChecked(ObjectToAdd);
DebugTreeView->AddTreeItemUnique(Item);
}
else
{
FDebugTreeItemPtr NewPtr = SKismetDebugTreeView::MakeParentItem(ObjectToAdd);
ObjectToTreeItemMap.Add(ObjectToAdd, NewPtr);
DebugTreeView->AddTreeItemUnique(NewPtr);
}
}
// Remove the old root set items that didn't get used again
for (UObject* ObjectToRemove : OldRootSet)
{
ObjectToTreeItemMap.Remove(ObjectToRemove);
}
// Add a message if there are no active instances of DebugClass
if (DebugTreeView->GetRootTreeItems().Num() == 0)
{
DebugTreeView->AddTreeItemUnique(SKismetDebugTreeView::MakeMessageItem(
bIsDebugging ?
LOCTEXT("NoInstances", "No instances of this blueprint in existence").ToString() :
LOCTEXT("NoPIEorSIE", "run PIE or SIE to see instance debug info").ToString()
));
}
// Show Breakpoints
if(FDebugLineItem::IsDebugLineTypeActive(FDebugLineItem::DLT_BreakpointParent))
{
OtherTreeView->AddTreeItemUnique(BreakpointParentItem);
}
else
{
OtherTreeView->RemoveTreeItem(BreakpointParentItem);
}
// Show the trace stack when debugging
if (bIsDebugging && FDebugLineItem::IsDebugLineTypeActive(FDebugLineItem::DLT_TraceStackParent))
{
OtherTreeView->AddTreeItemUnique(TraceStackItem);
}
else
{
OtherTreeView->RemoveTreeItem(TraceStackItem);
}
OtherTreeView->RequestUpdateFilteredItems();
}
void SKismetDebuggingView::SetBlueprintToWatch(TWeakObjectPtr<UBlueprint> InBlueprintToWatch)
{
BlueprintToWatchPtr = InBlueprintToWatch;
FDebugLineItem::SetBreakpointParentItemBlueprint(BreakpointParentItem, BlueprintToWatchPtr);
}
#undef LOCTEXT_NAMESPACE