2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "EnvironmentQueryEditorPrivatePCH.h"
|
|
|
|
|
#include "EnvironmentQueryEditorModule.h"
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// EnvironmentQueryGraph
|
|
|
|
|
|
|
|
|
|
namespace EQSGraphVersion
|
|
|
|
|
{
|
|
|
|
|
const int32 Initial = 0;
|
|
|
|
|
const int32 NestedNodes = 1;
|
2014-04-23 19:29:53 -04:00
|
|
|
const int32 CopyPasteOutersBug = 2;
|
2015-02-23 10:30:16 -05:00
|
|
|
const int32 BlueprintClasses = 3;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
const int32 Latest = BlueprintClasses;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UEnvironmentQueryGraph::UEnvironmentQueryGraph(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
Schema = UEdGraphSchema_EnvironmentQuery::StaticClass();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct FCompareNodeXLocation
|
|
|
|
|
{
|
|
|
|
|
FORCEINLINE bool operator()(const UEdGraphPin& A, const UEdGraphPin& B) const
|
|
|
|
|
{
|
|
|
|
|
return A.GetOwningNode()->NodePosX < B.GetOwningNode()->NodePosX;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
void UEnvironmentQueryGraph::UpdateAsset(int32 UpdateFlags)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
if (IsLocked())
|
2014-04-23 19:29:53 -04:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
// let's find root node
|
2014-03-14 14:13:41 -04:00
|
|
|
UEnvironmentQueryGraphNode_Root* RootNode = NULL;
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]);
|
2014-03-14 14:13:41 -04:00
|
|
|
if (RootNode != NULL)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UEnvQuery* Query = Cast<UEnvQuery>(GetOuter());
|
Copying //UE4/Dev-Frame to //UE4/Main
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2775736 on 2015/11/20 by Richard.Hinckley
Fix for Paper2D issue with repeated imports in one edutor session. Paper2D import process now creates a new importer at the end. This prevents the sprite sheet import process from leaving frame data around, causing subsequent imports (including imports of different sprite sheets) to include this data inappropriately.
#codereview michael.noland
Change 2776352 on 2015/11/20 by Zak.Middleton
#ue4 - Avoid useless DetachFromParent() for the same pending AttachParent during registration. Added missing UpdateOverlaps() when detaching from object simulating physics.
#rb Marc.Audy, Ori.Cohen
#codereview James.Golding
Change 2776401 on 2015/11/20 by Mieszko.Zielinski
Implemented a way to do batched points projection to navmesh, where every point can declare a custom projection box #UE4
The biggest advantage here is that projection box is independent from projected point - no more manual offsetting of projected point to achieve "100uu up and 500uu down"-like functionality
#jira UE-23705
#rb Lukasz.Furman
Change 2777450 on 2015/11/23 by Martin.Wilson
Bake additive data into animations during cooking to avoid doing additive calculations and extra pose extraction and blending at runtime
#rb Thomas.Sarkanen
Change 2777698 on 2015/11/23 by Mieszko.Zielinski
Gameplay debugging tools fixes #UE4
Fixes:
- made newly added logs respect Log Visualizer's filters
- added handling of invalid data when trying to draw EGameplayDebuggerShapeElement::Cylinder in AGameplayDebuggingHUDComponent::DrawPerception. This is a patch, root cause to be found.
- fixed Log Visualizer resetting it's data while trying to serialize invalid objects. This is a patch, root cause to be addressed.
In addition
- while at it removed bunch of 'auto' and 'class' keywords from the files I've touched
#rb Lukasz.Furman
Change 2777762 on 2015/11/23 by Mieszko.Zielinski
Removed BlackboardComponent's functionality deprecated since 4.7 #UE4
#rb Lukasz.Furman
Change 2777839 on 2015/11/23 by Zak.Middleton
#ue4 - Wrap all vector library calls to math functions through our FMath versions, so they benefit from fixes or improvements therein. Added Exp2() function.
#rb Laurent.Delayen
Change 2777840 on 2015/11/23 by Zak.Middleton
#ue4 - Fix up uses of library math functions to go through our FMath namespace.
#rb Laurent.Delayen
Change 2778287 on 2015/11/23 by Stan.Melax
deprecation of FCollisionQueryParams(bool)
See 2774707 description for the whole story
#OR-9936
#codereview marc.audy
Changes to kite will have to be in a separate check-in
I couldn't submit to all files from the framework branch addition fixes have their files are shelved in cl 2778299
Change 2778507 on 2015/11/23 by Marc.Audy
Eliminate spurious cook warnings for known missing packages
#rb Michael.Noland
Change 2778546 on 2015/11/23 by Aaron.McLeran
Moving occlusion feature settings from audio component to sound attenuation settings struct.
- Sound attenuation setting struct is used for all sounds that do 3d spatialization so it make sense for the occlusion feature settings to be there.
- Kept old low-pass frequency filter setting values on audio component (where HighFrequencyAttenuation used to be)
#rb Zak.Middleton
Change 2778664 on 2015/11/23 by Zak.Middleton
#ue4 - Clarify some comparison functions (IsZero, IsNearlyZero, Equals) in FRotator to explain that they compare as orientations, not other interpretations such as rotational speed, winding, etc.
#rb Aaron.Mcleran
#codereview Frank.Gigliotti
Change 2779335 on 2015/11/24 by Mieszko.Zielinski
Another VisualLog patch to avoid crashing due to a core bug that remains to be investigated #UE4
Again, the core bug here is related visual log trying to serialize invalid objects on a regular basis.
#rb Lukasz.Furman
Change 2779338 on 2015/11/24 by Benn.Gallagher
Fixed crash in Persona when focus is taken from a different window
#jira UE-22516
#rb Ben.Cosh
Change 2779375 on 2015/11/24 by Benn.Gallagher
Fix for deadlock in destructibles. Aquiring actor buffer without releasing causes an infinite wait on next aquire.
#rb Ori.Cohen
Change 2779753 on 2015/11/24 by Zak.Middleton
#ue4 - FMath::Atan2() no longer calls atan2f() because of some compiler or library bugs causing it to randomly return NaN for valid input. It now uses a high-precision minimax approximation instead, measured to be 2x faster than the stock C version.
#rb Brian.Karis
Change 2779853 on 2015/11/24 by Marc.Audy
2015-12-02 16:42:06 -05:00
|
|
|
Query->GetOptionsMutable().Reset();
|
2014-03-14 14:13:41 -04:00
|
|
|
if (RootNode && RootNode->Pins.Num() > 0 && RootNode->Pins[0]->LinkedTo.Num() > 0)
|
|
|
|
|
{
|
|
|
|
|
UEdGraphPin* MyPin = RootNode->Pins[0];
|
|
|
|
|
|
|
|
|
|
// sort connections so that they're organized the same as user can see in the editor
|
|
|
|
|
MyPin->LinkedTo.Sort(FCompareNodeXLocation());
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = 0; Idx < MyPin->LinkedTo.Num(); Idx++)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(MyPin->LinkedTo[Idx]->GetOwningNode());
|
2014-03-14 14:13:41 -04:00
|
|
|
if (OptionNode)
|
|
|
|
|
{
|
2015-03-12 12:26:19 -04:00
|
|
|
OptionNode->UpdateNodeData();
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
UEnvQueryOption* OptionInstance = Cast<UEnvQueryOption>(OptionNode->NodeInstance);
|
2015-03-12 12:26:19 -04:00
|
|
|
if (OptionInstance && OptionInstance->Generator)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-07-07 17:19:49 -04:00
|
|
|
OptionInstance->Tests.Reset();
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 TestIdx = 0; TestIdx < OptionNode->SubNodes.Num(); TestIdx++)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-03-11 12:20:56 -04:00
|
|
|
UAIGraphNode* SubNode = OptionNode->SubNodes[TestIdx];
|
|
|
|
|
if (SubNode == nullptr)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SubNode->ParentNode = OptionNode;
|
|
|
|
|
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* TestNode = Cast<UEnvironmentQueryGraphNode_Test>(SubNode);
|
2014-07-07 17:19:49 -04:00
|
|
|
if (TestNode && TestNode->bTestEnabled)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-07-07 17:19:49 -04:00
|
|
|
UEnvQueryTest* TestInstance = Cast<UEnvQueryTest>(TestNode->NodeInstance);
|
|
|
|
|
if (TestInstance)
|
|
|
|
|
{
|
|
|
|
|
OptionInstance->Tests.Add(TestInstance);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Copying //UE4/Dev-Frame to //UE4/Main
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2775736 on 2015/11/20 by Richard.Hinckley
Fix for Paper2D issue with repeated imports in one edutor session. Paper2D import process now creates a new importer at the end. This prevents the sprite sheet import process from leaving frame data around, causing subsequent imports (including imports of different sprite sheets) to include this data inappropriately.
#codereview michael.noland
Change 2776352 on 2015/11/20 by Zak.Middleton
#ue4 - Avoid useless DetachFromParent() for the same pending AttachParent during registration. Added missing UpdateOverlaps() when detaching from object simulating physics.
#rb Marc.Audy, Ori.Cohen
#codereview James.Golding
Change 2776401 on 2015/11/20 by Mieszko.Zielinski
Implemented a way to do batched points projection to navmesh, where every point can declare a custom projection box #UE4
The biggest advantage here is that projection box is independent from projected point - no more manual offsetting of projected point to achieve "100uu up and 500uu down"-like functionality
#jira UE-23705
#rb Lukasz.Furman
Change 2777450 on 2015/11/23 by Martin.Wilson
Bake additive data into animations during cooking to avoid doing additive calculations and extra pose extraction and blending at runtime
#rb Thomas.Sarkanen
Change 2777698 on 2015/11/23 by Mieszko.Zielinski
Gameplay debugging tools fixes #UE4
Fixes:
- made newly added logs respect Log Visualizer's filters
- added handling of invalid data when trying to draw EGameplayDebuggerShapeElement::Cylinder in AGameplayDebuggingHUDComponent::DrawPerception. This is a patch, root cause to be found.
- fixed Log Visualizer resetting it's data while trying to serialize invalid objects. This is a patch, root cause to be addressed.
In addition
- while at it removed bunch of 'auto' and 'class' keywords from the files I've touched
#rb Lukasz.Furman
Change 2777762 on 2015/11/23 by Mieszko.Zielinski
Removed BlackboardComponent's functionality deprecated since 4.7 #UE4
#rb Lukasz.Furman
Change 2777839 on 2015/11/23 by Zak.Middleton
#ue4 - Wrap all vector library calls to math functions through our FMath versions, so they benefit from fixes or improvements therein. Added Exp2() function.
#rb Laurent.Delayen
Change 2777840 on 2015/11/23 by Zak.Middleton
#ue4 - Fix up uses of library math functions to go through our FMath namespace.
#rb Laurent.Delayen
Change 2778287 on 2015/11/23 by Stan.Melax
deprecation of FCollisionQueryParams(bool)
See 2774707 description for the whole story
#OR-9936
#codereview marc.audy
Changes to kite will have to be in a separate check-in
I couldn't submit to all files from the framework branch addition fixes have their files are shelved in cl 2778299
Change 2778507 on 2015/11/23 by Marc.Audy
Eliminate spurious cook warnings for known missing packages
#rb Michael.Noland
Change 2778546 on 2015/11/23 by Aaron.McLeran
Moving occlusion feature settings from audio component to sound attenuation settings struct.
- Sound attenuation setting struct is used for all sounds that do 3d spatialization so it make sense for the occlusion feature settings to be there.
- Kept old low-pass frequency filter setting values on audio component (where HighFrequencyAttenuation used to be)
#rb Zak.Middleton
Change 2778664 on 2015/11/23 by Zak.Middleton
#ue4 - Clarify some comparison functions (IsZero, IsNearlyZero, Equals) in FRotator to explain that they compare as orientations, not other interpretations such as rotational speed, winding, etc.
#rb Aaron.Mcleran
#codereview Frank.Gigliotti
Change 2779335 on 2015/11/24 by Mieszko.Zielinski
Another VisualLog patch to avoid crashing due to a core bug that remains to be investigated #UE4
Again, the core bug here is related visual log trying to serialize invalid objects on a regular basis.
#rb Lukasz.Furman
Change 2779338 on 2015/11/24 by Benn.Gallagher
Fixed crash in Persona when focus is taken from a different window
#jira UE-22516
#rb Ben.Cosh
Change 2779375 on 2015/11/24 by Benn.Gallagher
Fix for deadlock in destructibles. Aquiring actor buffer without releasing causes an infinite wait on next aquire.
#rb Ori.Cohen
Change 2779753 on 2015/11/24 by Zak.Middleton
#ue4 - FMath::Atan2() no longer calls atan2f() because of some compiler or library bugs causing it to randomly return NaN for valid input. It now uses a high-precision minimax approximation instead, measured to be 2x faster than the stock C version.
#rb Brian.Karis
Change 2779853 on 2015/11/24 by Marc.Audy
2015-12-02 16:42:06 -05:00
|
|
|
Query->GetOptionsMutable().Add(OptionInstance);
|
2014-07-07 17:19:49 -04:00
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-23 19:29:53 -04:00
|
|
|
RemoveOrphanedNodes();
|
2014-09-03 05:20:46 -04:00
|
|
|
#if USE_EQS_DEBUGGER
|
2014-03-14 14:13:41 -04:00
|
|
|
UEnvQueryManager::NotifyAssetUpdate(Query);
|
2014-09-03 05:20:46 -04:00
|
|
|
#endif
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2015-03-09 05:40:56 -04:00
|
|
|
void UEnvironmentQueryGraph::Initialize()
|
|
|
|
|
{
|
|
|
|
|
Super::Initialize();
|
2015-03-17 05:56:35 -04:00
|
|
|
|
|
|
|
|
LockUpdates();
|
2015-03-09 05:40:56 -04:00
|
|
|
SpawnMissingNodes();
|
|
|
|
|
CalculateAllWeights();
|
2015-03-17 05:56:35 -04:00
|
|
|
UnlockUpdates();
|
2015-03-09 05:40:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::OnLoaded()
|
|
|
|
|
{
|
|
|
|
|
Super::OnLoaded();
|
|
|
|
|
UpdateDeprecatedGeneratorClasses();
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
void UEnvironmentQueryGraph::CalculateAllWeights()
|
|
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(Nodes[Idx]);
|
2014-03-14 14:13:41 -04:00
|
|
|
if (OptionNode)
|
|
|
|
|
{
|
|
|
|
|
OptionNode->CalculateWeights();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::MarkVersion()
|
|
|
|
|
{
|
|
|
|
|
GraphVersion = EQSGraphVersion::Latest;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::UpdateVersion()
|
|
|
|
|
{
|
|
|
|
|
if (GraphVersion == EQSGraphVersion::Latest)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// convert to nested nodes
|
|
|
|
|
if (GraphVersion < EQSGraphVersion::NestedNodes)
|
|
|
|
|
{
|
|
|
|
|
UpdateVersion_NestedNodes();
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-23 19:29:53 -04:00
|
|
|
if (GraphVersion < EQSGraphVersion::CopyPasteOutersBug)
|
|
|
|
|
{
|
|
|
|
|
UpdateVersion_FixupOuters();
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
if (GraphVersion < EQSGraphVersion::BlueprintClasses)
|
|
|
|
|
{
|
|
|
|
|
UpdateVersion_CollectClassData();
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
GraphVersion = EQSGraphVersion::Latest;
|
2014-04-23 19:29:53 -04:00
|
|
|
Modify();
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::UpdateVersion_NestedNodes()
|
|
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(Nodes[Idx]);
|
2014-03-14 14:13:41 -04:00
|
|
|
if (OptionNode)
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode* Node = OptionNode;
|
|
|
|
|
while (Node)
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode* NextNode = NULL;
|
|
|
|
|
for (int32 iPin = 0; iPin < Node->Pins.Num(); iPin++)
|
|
|
|
|
{
|
|
|
|
|
UEdGraphPin* TestPin = Node->Pins[iPin];
|
|
|
|
|
if (TestPin && TestPin->Direction == EGPD_Output)
|
|
|
|
|
{
|
|
|
|
|
for (int32 iLink = 0; iLink < TestPin->LinkedTo.Num(); iLink++)
|
|
|
|
|
{
|
|
|
|
|
UEdGraphPin* LinkedTo = TestPin->LinkedTo[iLink];
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* LinkedTest = LinkedTo ? Cast<UEnvironmentQueryGraphNode_Test>(LinkedTo->GetOwningNode()) : NULL;
|
|
|
|
|
if (LinkedTest)
|
|
|
|
|
{
|
|
|
|
|
LinkedTest->ParentNode = OptionNode;
|
2015-02-23 10:30:16 -05:00
|
|
|
OptionNode->SubNodes.Add(LinkedTest);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
NextNode = LinkedTest;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Node = NextNode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = Nodes.Num() - 1; Idx >= 0; Idx--)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
UEnvironmentQueryGraphNode_Test* TestNode = Cast<UEnvironmentQueryGraphNode_Test>(Nodes[Idx]);
|
2014-03-14 14:13:41 -04:00
|
|
|
if (TestNode)
|
|
|
|
|
{
|
|
|
|
|
TestNode->Pins.Empty();
|
2015-02-23 10:30:16 -05:00
|
|
|
Nodes.RemoveAt(Idx);
|
2014-03-14 14:13:41 -04:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(Nodes[Idx]);
|
2014-03-14 14:13:41 -04:00
|
|
|
if (OptionNode && OptionNode->Pins.IsValidIndex(1))
|
|
|
|
|
{
|
|
|
|
|
OptionNode->Pins.RemoveAt(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-23 19:29:53 -04:00
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::UpdateVersion_FixupOuters()
|
|
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
|
2014-04-23 19:29:53 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(Nodes[Idx]);
|
2014-04-23 19:29:53 -04:00
|
|
|
if (MyNode)
|
|
|
|
|
{
|
|
|
|
|
MyNode->PostEditImport();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
void UEnvironmentQueryGraph::UpdateVersion_CollectClassData()
|
2014-04-23 19:29:53 -04:00
|
|
|
{
|
2015-03-17 07:30:01 -04:00
|
|
|
UpdateClassData();
|
2014-04-23 19:29:53 -04:00
|
|
|
}
|
|
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
void UEnvironmentQueryGraph::CollectAllNodeInstances(TSet<UObject*>& NodeInstances)
|
2014-04-23 19:29:53 -04:00
|
|
|
{
|
2015-02-23 10:30:16 -05:00
|
|
|
Super::CollectAllNodeInstances(NodeInstances);
|
2014-04-23 19:29:53 -04:00
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(Nodes[Idx]);
|
|
|
|
|
UEnvQueryOption* OptionInstance = MyNode ? Cast<UEnvQueryOption>(MyNode->NodeInstance) : nullptr;
|
|
|
|
|
if (OptionInstance && OptionInstance->Generator)
|
|
|
|
|
{
|
|
|
|
|
NodeInstances.Add(OptionInstance->Generator);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-23 19:29:53 -04:00
|
|
|
}
|
2015-03-09 05:40:56 -04:00
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::UpdateDeprecatedGeneratorClasses()
|
|
|
|
|
{
|
|
|
|
|
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(Nodes[Idx]);
|
|
|
|
|
UEnvQueryOption* OptionInstance = MyNode ? Cast<UEnvQueryOption>(MyNode->NodeInstance) : nullptr;
|
|
|
|
|
if (OptionInstance && OptionInstance->Generator)
|
|
|
|
|
{
|
|
|
|
|
MyNode->ErrorMessage = FGraphNodeClassHelper::GetDeprecationMessage(OptionInstance->Generator->GetClass());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::SpawnMissingNodes()
|
|
|
|
|
{
|
2015-03-10 09:38:12 -04:00
|
|
|
UEnvQuery* QueryOwner = Cast<UEnvQuery>(GetOuter());
|
|
|
|
|
if (QueryOwner == nullptr)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2015-03-09 05:40:56 -04:00
|
|
|
|
2015-03-10 09:38:12 -04:00
|
|
|
TSet<UEnvQueryTest*> ExistingTests;
|
|
|
|
|
TSet<UEnvQueryOption*> ExistingNodes;
|
Copying //UE4/Dev-Frame to //UE4/Main
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2775736 on 2015/11/20 by Richard.Hinckley
Fix for Paper2D issue with repeated imports in one edutor session. Paper2D import process now creates a new importer at the end. This prevents the sprite sheet import process from leaving frame data around, causing subsequent imports (including imports of different sprite sheets) to include this data inappropriately.
#codereview michael.noland
Change 2776352 on 2015/11/20 by Zak.Middleton
#ue4 - Avoid useless DetachFromParent() for the same pending AttachParent during registration. Added missing UpdateOverlaps() when detaching from object simulating physics.
#rb Marc.Audy, Ori.Cohen
#codereview James.Golding
Change 2776401 on 2015/11/20 by Mieszko.Zielinski
Implemented a way to do batched points projection to navmesh, where every point can declare a custom projection box #UE4
The biggest advantage here is that projection box is independent from projected point - no more manual offsetting of projected point to achieve "100uu up and 500uu down"-like functionality
#jira UE-23705
#rb Lukasz.Furman
Change 2777450 on 2015/11/23 by Martin.Wilson
Bake additive data into animations during cooking to avoid doing additive calculations and extra pose extraction and blending at runtime
#rb Thomas.Sarkanen
Change 2777698 on 2015/11/23 by Mieszko.Zielinski
Gameplay debugging tools fixes #UE4
Fixes:
- made newly added logs respect Log Visualizer's filters
- added handling of invalid data when trying to draw EGameplayDebuggerShapeElement::Cylinder in AGameplayDebuggingHUDComponent::DrawPerception. This is a patch, root cause to be found.
- fixed Log Visualizer resetting it's data while trying to serialize invalid objects. This is a patch, root cause to be addressed.
In addition
- while at it removed bunch of 'auto' and 'class' keywords from the files I've touched
#rb Lukasz.Furman
Change 2777762 on 2015/11/23 by Mieszko.Zielinski
Removed BlackboardComponent's functionality deprecated since 4.7 #UE4
#rb Lukasz.Furman
Change 2777839 on 2015/11/23 by Zak.Middleton
#ue4 - Wrap all vector library calls to math functions through our FMath versions, so they benefit from fixes or improvements therein. Added Exp2() function.
#rb Laurent.Delayen
Change 2777840 on 2015/11/23 by Zak.Middleton
#ue4 - Fix up uses of library math functions to go through our FMath namespace.
#rb Laurent.Delayen
Change 2778287 on 2015/11/23 by Stan.Melax
deprecation of FCollisionQueryParams(bool)
See 2774707 description for the whole story
#OR-9936
#codereview marc.audy
Changes to kite will have to be in a separate check-in
I couldn't submit to all files from the framework branch addition fixes have their files are shelved in cl 2778299
Change 2778507 on 2015/11/23 by Marc.Audy
Eliminate spurious cook warnings for known missing packages
#rb Michael.Noland
Change 2778546 on 2015/11/23 by Aaron.McLeran
Moving occlusion feature settings from audio component to sound attenuation settings struct.
- Sound attenuation setting struct is used for all sounds that do 3d spatialization so it make sense for the occlusion feature settings to be there.
- Kept old low-pass frequency filter setting values on audio component (where HighFrequencyAttenuation used to be)
#rb Zak.Middleton
Change 2778664 on 2015/11/23 by Zak.Middleton
#ue4 - Clarify some comparison functions (IsZero, IsNearlyZero, Equals) in FRotator to explain that they compare as orientations, not other interpretations such as rotational speed, winding, etc.
#rb Aaron.Mcleran
#codereview Frank.Gigliotti
Change 2779335 on 2015/11/24 by Mieszko.Zielinski
Another VisualLog patch to avoid crashing due to a core bug that remains to be investigated #UE4
Again, the core bug here is related visual log trying to serialize invalid objects on a regular basis.
#rb Lukasz.Furman
Change 2779338 on 2015/11/24 by Benn.Gallagher
Fixed crash in Persona when focus is taken from a different window
#jira UE-22516
#rb Ben.Cosh
Change 2779375 on 2015/11/24 by Benn.Gallagher
Fix for deadlock in destructibles. Aquiring actor buffer without releasing causes an infinite wait on next aquire.
#rb Ori.Cohen
Change 2779753 on 2015/11/24 by Zak.Middleton
#ue4 - FMath::Atan2() no longer calls atan2f() because of some compiler or library bugs causing it to randomly return NaN for valid input. It now uses a high-precision minimax approximation instead, measured to be 2x faster than the stock C version.
#rb Brian.Karis
Change 2779853 on 2015/11/24 by Marc.Audy
2015-12-02 16:42:06 -05:00
|
|
|
TArray<UEnvQueryOption*> OptionsCopy = QueryOwner->GetOptions();
|
2015-03-10 09:38:12 -04:00
|
|
|
|
|
|
|
|
UAIGraphNode* MyRootNode = nullptr;
|
2015-03-09 05:40:56 -04:00
|
|
|
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(Nodes[Idx]);
|
|
|
|
|
UEnvQueryOption* OptionInstance = MyNode ? Cast<UEnvQueryOption>(MyNode->NodeInstance) : nullptr;
|
|
|
|
|
if (OptionInstance && OptionInstance->Generator)
|
|
|
|
|
{
|
|
|
|
|
ExistingNodes.Add(OptionInstance);
|
|
|
|
|
|
2015-03-10 09:38:12 -04:00
|
|
|
ExistingTests.Empty(ExistingTests.Num());
|
2015-03-09 05:40:56 -04:00
|
|
|
for (int32 SubIdx = 0; SubIdx < MyNode->SubNodes.Num(); SubIdx++)
|
|
|
|
|
{
|
|
|
|
|
UEnvironmentQueryGraphNode* MySubNode = Cast<UEnvironmentQueryGraphNode>(MyNode->SubNodes[SubIdx]);
|
|
|
|
|
UEnvQueryTest* TestInstance = MySubNode ? Cast<UEnvQueryTest>(MySubNode->NodeInstance) : nullptr;
|
|
|
|
|
if (TestInstance)
|
|
|
|
|
{
|
|
|
|
|
ExistingTests.Add(TestInstance);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MyNode->RemoveSubNode(MySubNode);
|
|
|
|
|
SubIdx--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-10 09:38:12 -04:00
|
|
|
SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode);
|
|
|
|
|
}
|
2015-03-09 05:40:56 -04:00
|
|
|
|
2015-03-10 09:38:12 -04:00
|
|
|
UEnvironmentQueryGraphNode_Root* RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]);
|
|
|
|
|
if (RootNode)
|
|
|
|
|
{
|
|
|
|
|
MyRootNode = RootNode;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-03-09 05:40:56 -04:00
|
|
|
|
2015-03-10 09:38:12 -04:00
|
|
|
UEdGraphPin* RootOutPin = MyRootNode ? FindGraphNodePin(MyRootNode, EGPD_Output) : nullptr;
|
|
|
|
|
ExistingTests.Empty(0);
|
|
|
|
|
|
|
|
|
|
for (int32 Idx = 0; Idx < OptionsCopy.Num(); Idx++)
|
|
|
|
|
{
|
|
|
|
|
UEnvQueryOption* OptionInstance = OptionsCopy[Idx];
|
|
|
|
|
if (ExistingNodes.Contains(OptionInstance) || OptionInstance == nullptr || OptionInstance->Generator == nullptr)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FGraphNodeCreator<UEnvironmentQueryGraphNode_Option> NodeBuilder(*this);
|
|
|
|
|
UEnvironmentQueryGraphNode_Option* MyNode = NodeBuilder.CreateNode();
|
2015-03-17 07:30:01 -04:00
|
|
|
UAIGraphNode::UpdateNodeClassDataFrom(OptionInstance->Generator->GetClass(), MyNode->ClassData);
|
|
|
|
|
MyNode->ErrorMessage = MyNode->ClassData.GetDeprecatedMessage();
|
2015-03-10 09:38:12 -04:00
|
|
|
NodeBuilder.Finalize();
|
|
|
|
|
|
|
|
|
|
if (MyRootNode)
|
|
|
|
|
{
|
|
|
|
|
MyNode->NodePosX = MyRootNode->NodePosX + (Idx * 300);
|
|
|
|
|
MyNode->NodePosY = MyRootNode->NodePosY + 100;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyNode->NodeInstance = OptionInstance;
|
|
|
|
|
SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode);
|
|
|
|
|
|
|
|
|
|
UEdGraphPin* SpawnedInPin = FindGraphNodePin(MyNode, EGPD_Input);
|
|
|
|
|
if (RootOutPin && SpawnedInPin)
|
|
|
|
|
{
|
|
|
|
|
RootOutPin->MakeLinkTo(SpawnedInPin);
|
2015-03-09 05:40:56 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-03-10 09:38:12 -04:00
|
|
|
|
|
|
|
|
void UEnvironmentQueryGraph::SpawnMissingSubNodes(UEnvQueryOption* Option, TSet<UEnvQueryTest*> ExistingTests, UEnvironmentQueryGraphNode* OptionNode)
|
|
|
|
|
{
|
|
|
|
|
TArray<UEnvQueryTest*> TestsCopy = Option->Tests;
|
|
|
|
|
for (int32 SubIdx = 0; SubIdx < TestsCopy.Num(); SubIdx++)
|
|
|
|
|
{
|
|
|
|
|
if (ExistingTests.Contains(TestsCopy[SubIdx]) || (TestsCopy[SubIdx] == nullptr))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UEnvironmentQueryGraphNode_Test* TestNode = NewObject<UEnvironmentQueryGraphNode_Test>(this);
|
|
|
|
|
TestNode->NodeInstance = TestsCopy[SubIdx];
|
2015-03-17 07:30:01 -04:00
|
|
|
TestNode->UpdateNodeClassData();
|
2015-03-10 09:38:12 -04:00
|
|
|
|
|
|
|
|
OptionNode->AddSubNode(TestNode, this);
|
|
|
|
|
TestNode->NodeInstance = TestsCopy[SubIdx];
|
|
|
|
|
}
|
|
|
|
|
}
|