2018-12-14 13:41:00 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
AnimationTransitionSchema.cpp
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
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 "AnimationTransitionSchema.h"
|
|
|
|
|
#include "Animation/AnimBlueprint.h"
|
|
|
|
|
#include "Kismet2/BlueprintEditorUtils.h"
|
2014-04-24 14:34:01 -04:00
|
|
|
#include "AnimStateTransitionNode.h"
|
|
|
|
|
#include "AnimationTransitionGraph.h"
|
|
|
|
|
#include "AnimGraphNode_TransitionResult.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// UAnimationTransitionSchema
|
|
|
|
|
|
2014-04-23 18:30:37 -04:00
|
|
|
#define LOCTEXT_NAMESPACE "AnimationTransitionSchema"
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UAnimationTransitionSchema::UAnimationTransitionSchema(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
: Super(ObjectInitializer)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Initialize defaults
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UAnimationTransitionSchema::CreateDefaultNodesForGraph(UEdGraph& Graph) const
|
|
|
|
|
{
|
|
|
|
|
// Create the entry/exit tunnels
|
|
|
|
|
FGraphNodeCreator<UAnimGraphNode_TransitionResult> NodeCreator(Graph);
|
|
|
|
|
UAnimGraphNode_TransitionResult* ResultSinkNode = NodeCreator.CreateNode();
|
|
|
|
|
NodeCreator.Finalize();
|
2014-09-12 18:37:04 -04:00
|
|
|
SetNodeMetaData(ResultSinkNode, FNodeMetadata::DefaultGraphNode);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
UAnimationTransitionGraph* TypedGraph = CastChecked<UAnimationTransitionGraph>(&Graph);
|
|
|
|
|
TypedGraph->MyResultNode = ResultSinkNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UAnimationTransitionSchema::GetGraphDisplayInformation(const UEdGraph& Graph, /*out*/ FGraphDisplayInfo& DisplayInfo) const
|
|
|
|
|
{
|
2014-04-23 18:30:37 -04:00
|
|
|
DisplayInfo.PlainName = FText::FromString( Graph.GetName() );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
const UAnimStateTransitionNode* TransNode = Cast<const UAnimStateTransitionNode>(Graph.GetOuter());
|
2017-08-07 15:12:17 -04:00
|
|
|
|
|
|
|
|
// If we don't have a node we can get it from our blueprint, unless the graph has been deleted
|
|
|
|
|
// in which case the outer chain will have been broken.
|
|
|
|
|
if (TransNode == NULL && !Graph.IsPendingKill())
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
//@TODO: Transition graphs should be created with the transition node as their outer as well!
|
2019-04-12 10:41:29 -04:00
|
|
|
if(UAnimBlueprint* Blueprint = Cast<UAnimBlueprint>(FBlueprintEditorUtils::FindBlueprintForGraph(&Graph)))
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-04-12 10:41:29 -04:00
|
|
|
if (UAnimBlueprintGeneratedClass* AnimBlueprintClass = Blueprint->GetAnimBlueprintSkeletonClass())
|
|
|
|
|
{
|
|
|
|
|
TransNode = GetTransitionNodeFromGraph(AnimBlueprintClass->GetAnimBlueprintDebugData(), &Graph);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (TransNode)
|
|
|
|
|
{
|
2014-04-23 18:30:37 -04:00
|
|
|
FFormatNamedArguments Args;
|
|
|
|
|
Args.Add(TEXT("NodeTitle"), TransNode->GetNodeTitle(ENodeTitleType::FullTitle));
|
|
|
|
|
DisplayInfo.PlainName = FText::Format( NSLOCTEXT("Animation", "TransitionRuleGraphTitle", "{NodeTitle} (rule)"), Args );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2014-04-23 18:30:37 -04:00
|
|
|
|
|
|
|
|
DisplayInfo.DisplayName = DisplayInfo.PlainName;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2014-04-23 18:30:37 -04:00
|
|
|
|
2014-05-29 17:11:10 -04:00
|
|
|
UAnimStateTransitionNode* UAnimationTransitionSchema::GetTransitionNodeFromGraph(const FAnimBlueprintDebugData& DebugData, const UEdGraph* Graph)
|
|
|
|
|
{
|
|
|
|
|
if (const TWeakObjectPtr<UAnimStateTransitionNode>* TransNodePtr = DebugData.TransitionGraphToNodeMap.Find(Graph))
|
|
|
|
|
{
|
|
|
|
|
return TransNodePtr->Get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (const TWeakObjectPtr<UAnimStateTransitionNode>* TransNodePtr = DebugData.TransitionBlendGraphToNodeMap.Find(Graph))
|
|
|
|
|
{
|
|
|
|
|
return TransNodePtr->Get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UAnimStateNode* UAnimationTransitionSchema::GetStateNodeFromGraph(const FAnimBlueprintDebugData& DebugData, const UEdGraph* Graph)
|
|
|
|
|
{
|
|
|
|
|
if (const TWeakObjectPtr<UAnimStateNode>* StateNodePtr = DebugData.StateGraphToNodeMap.Find(Graph))
|
|
|
|
|
{
|
|
|
|
|
return StateNodePtr->Get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
Copying //UE4/Dev-Framework to Dev-Main (//UE4/Dev-Main) @ 2868852
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2821607 on 2016/01/08 by Mieszko.Zielinski
Added a way to limit amount of information logged by vlog by discarding logs from classes from outside of class whitelist #UE4
This feature was followed by refactoring of functions taking FVisualLogEntry pointers to use references instead.
#rb Lukasz.Furman
#codereview John.Abercrombie
Change 2828384 on 2016/01/14 by Mieszko.Zielinski
Back out of visual log refactor done as part of CL#2821607 #UE4
Change 2855722 on 2016/02/04 by Zak.Middleton
#ue4 - Expose PrimitiveComponent GetCollisionEnabled(), IsCollisionEnabled(), IsQueryCollisionEnabled(), IsPhysicsCollisionEnabled() functions to blueprints.
#rb Daniel.Broder, Ori.Cohen
#codereview Bob.Tellez
#jira UE-26411
Change 2855737 on 2016/02/04 by James.Golding
Add test AssetUserData C++ class to QAGame
Change 2855739 on 2016/02/04 by James.Golding
PR #1858 : Add abstract and editinlinenew to AssetUserData class, so derived classes can be added to assets via details panel
https://github.com/EpicGames/UnrealEngine/pull/1858
#github 1858
#jira UE-24494
#rb thomas.sarkanen
Change 2855842 on 2016/02/04 by James.Golding
UE-23968 : Add clamping to Friction, Restitution, Density and RaiseMassToPower properties of PhysicalMaterial
#codereview ori.cohen
#rb thomas.sarkanen
Change 2855843 on 2016/02/04 by James.Golding
PR #1984 : Add 'AssetUserData' support to AnimationAsset/Texture
https://github.com/EpicGames/UnrealEngine/pull/1984
#github 1984
#jira UE-25913
#rb thomas.sarkanen
Change 2855844 on 2016/02/04 by James.Golding
UE-23176 Fix incorrect clamping in GenerateKDopAsSimpleCollision() which could cause degenerate hulls
Also don't 'nudge' kdops if there are other primitives present, will offset from mesh we were fitting around
#rb thomas.sarkanen
Change 2855850 on 2016/02/04 by Benn.Gallagher
Update required LOD bones when associating a cloth chunk that uses bones that aren't weighted to that LOD
#rb Martin.Wilson
Change 2856409 on 2016/02/04 by Zak.Middleton
#ue4 - Change LogSpawn warnings to normal logs for cases that are common and valid during gameplay (failed due to collision at the target location, or failed because it is destroyed in the process of spawning, ie projectile spawned in a target).
#codereview Jeff.Farris
Change 2857018 on 2016/02/05 by Benn.Gallagher
Fixes for various anim graph related subgraph issues/crashes
#rb Ben.Cosh
Change 2857193 on 2016/02/05 by Lukasz.Furman
extended crowd agent interface to handle avoidance groups
#ue4 UE-24823
#1896
Change 2857200 on 2016/02/05 by Lukasz.Furman
fixed memory leak in CrowdManager
#ue UE-26516
#2026
#codereview Mieszko.Zielinski
Change 2857417 on 2016/02/05 by Lina.Halper
Add keyword for animation functions
Change 2858854 on 2016/02/08 by Benn.Gallagher
Fixed pose evaluator customizations being processed at the wrong time which caused properties to always be re-added even if removed from the details panel, causing duplicated entries.
#jira UE-8421
#rb Lina.Halper
Change 2858855 on 2016/02/08 by Benn.Gallagher
Fixed blendspace players only reporting normalized time when using a time getter in an anim graph transition.
#rb Lina.Halper
Change 2859159 on 2016/02/08 by Aaron.McLeran
UE-25586 Fix for reporting audio memory usage
- Realtime decompressed sounds that have CachedRealtimeFirstBuffers need to report the compressed asset size
Change 2859192 on 2016/02/08 by Laurent.Delayen
Removed check disallowing cooked additive animations from using AnimationRelative and AnimationScale retargeting modes (on the root bone or editor).
Skip AnimationRelative retargeting for baked additive animations since it gets cancelled out during the additive creation process.
#rb martin.wilson
#codereview lina.halper
Change 2859238 on 2016/02/08 by Lina.Halper
Git pull request #1895
Change 2859239 on 2016/02/08 by Lina.Halper
Git pull request #1813
Change 2859453 on 2016/02/08 by Aaron.McLeran
[CL 2868856 by Marc Audy in Main branch]
2016-02-16 13:35:21 -05:00
|
|
|
void UAnimationTransitionSchema::HandleGraphBeingDeleted(UEdGraph& GraphBeingRemoved) const
|
|
|
|
|
{
|
|
|
|
|
Super::HandleGraphBeingDeleted(GraphBeingRemoved);
|
|
|
|
|
|
|
|
|
|
if(UBlueprint* Blueprint = FBlueprintEditorUtils::FindBlueprintForGraph(&GraphBeingRemoved))
|
|
|
|
|
{
|
|
|
|
|
// Handle composite anim graph nodes
|
|
|
|
|
TArray<UAnimStateNodeBase*> StateNodes;
|
|
|
|
|
FBlueprintEditorUtils::GetAllNodesOfClassEx<UAnimStateTransitionNode>(Blueprint, StateNodes);
|
|
|
|
|
|
|
|
|
|
TSet<UAnimStateNodeBase*> NodesToDelete;
|
|
|
|
|
for(int32 i = 0; i < StateNodes.Num(); ++i)
|
|
|
|
|
{
|
|
|
|
|
UAnimStateNodeBase* StateNode = StateNodes[i];
|
|
|
|
|
if(StateNode->GetBoundGraph() == &GraphBeingRemoved)
|
|
|
|
|
{
|
|
|
|
|
NodesToDelete.Add(StateNode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Delete the node that owns us
|
|
|
|
|
ensure(NodesToDelete.Num() <= 1);
|
|
|
|
|
for(TSet<UAnimStateNodeBase*>::TIterator It(NodesToDelete); It; ++It)
|
|
|
|
|
{
|
|
|
|
|
UAnimStateNodeBase* NodeToDelete = *It;
|
|
|
|
|
|
|
|
|
|
FBlueprintEditorUtils::RemoveNode(Blueprint, NodeToDelete, true);
|
|
|
|
|
|
|
|
|
|
// Prevent re-entrancy here
|
|
|
|
|
NodeToDelete->ClearBoundGraph();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
#undef LOCTEXT_NAMESPACE
|