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 "BlueprintGraphPrivatePCH.h"
# include "ParticleDefinitions.h"
# include "CompilerResultsLog.h"
# include "CallFunctionHandler.h"
2014-05-29 17:02:05 -04:00
# include "Particles/ParticleSystemComponent.h"
2014-08-21 18:50:33 -04:00
# include "BlueprintEditorUtils.h"
2014-03-14 14:13:41 -04:00
# define LOCTEXT_NAMESPACE "K2Node_AddComponent"
//////////////////////////////////////////////////////////////////////////
// FKCHandler_AddComponent
2014-10-14 10:29:11 -04:00
UK2Node_AddComponent : : UK2Node_AddComponent ( const FObjectInitializer & ObjectInitializer )
: Super ( ObjectInitializer )
2014-03-14 14:13:41 -04:00
{
bIsPureFunc = false ;
}
void UK2Node_AddComponent : : AllocateDefaultPins ( )
{
AllocateDefaultPinsWithoutExposedVariables ( ) ;
AllocatePinsForExposedVariables ( ) ;
UEdGraphPin * ManualAttachmentPin = GetManualAttachmentPin ( ) ;
UEdGraphSchema const * Schema = GetSchema ( ) ;
check ( Schema ! = NULL ) ;
2014-09-05 13:06:18 -04:00
Schema - > ConstructBasicPinTooltip ( * ManualAttachmentPin , LOCTEXT ( " ManualAttachmentPinTooltip " , " Defines whether the component should attach to the root automatically, or be left unattached for the user to manually attach later. " ) , ManualAttachmentPin - > PinToolTip ) ;
2014-03-14 14:13:41 -04:00
UEdGraphPin * TransformPin = GetRelativeTransformPin ( ) ;
2014-09-05 13:06:18 -04:00
Schema - > ConstructBasicPinTooltip ( * TransformPin , LOCTEXT ( " TransformPinTooltip " , " Defines where to position the component (relative to its parent). If the component is left unattached, then the transform is relative to the world. " ) , TransformPin - > PinToolTip ) ;
2014-03-14 14:13:41 -04:00
}
void UK2Node_AddComponent : : AllocatePinsForExposedVariables ( )
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
const UActorComponent * TemplateComponent = GetTemplateFromNode ( ) ;
2015-02-09 10:30:03 -05:00
const UClass * ComponentClass = TemplateComponent ? TemplateComponent - > GetClass ( ) : nullptr ;
2014-07-23 12:35:37 -04:00
2015-02-09 10:30:03 -05:00
if ( ComponentClass ! = nullptr )
2014-03-14 14:13:41 -04:00
{
2015-02-09 10:30:03 -05:00
const UObject * ClassDefaultObject = ComponentClass ? ComponentClass - > ClassDefaultObject : nullptr ;
2014-07-23 12:35:37 -04:00
2014-03-14 14:13:41 -04:00
for ( TFieldIterator < UProperty > PropertyIt ( ComponentClass , EFieldIteratorFlags : : IncludeSuper ) ; PropertyIt ; + + PropertyIt )
{
UProperty * Property = * PropertyIt ;
const bool bNotDelegate = ! Property - > IsA ( UMulticastDelegateProperty : : StaticClass ( ) ) ;
2014-04-02 18:09:23 -04:00
const bool bIsExposedToSpawn = UEdGraphSchema_K2 : : IsPropertyExposedOnSpawn ( Property ) ;
2014-03-14 14:13:41 -04:00
const bool bIsVisible = Property - > HasAllPropertyFlags ( CPF_BlueprintVisible ) ;
const bool bNotParam = ! Property - > HasAllPropertyFlags ( CPF_Parm ) ;
if ( bNotDelegate & & bIsExposedToSpawn & & bIsVisible & & bNotParam )
{
FEdGraphPinType PinType ;
K2Schema - > ConvertPropertyToPinType ( Property , /*out*/ PinType ) ;
const bool bIsUnique = ( NULL = = FindPin ( Property - > GetName ( ) ) ) ;
2015-02-09 10:30:03 -05:00
if ( K2Schema - > FindSetVariableByNameFunction ( PinType ) & & bIsUnique )
2014-03-14 14:13:41 -04:00
{
UEdGraphPin * Pin = CreatePin ( EGPD_Input , TEXT ( " " ) , TEXT ( " " ) , NULL , false , false , Property - > GetName ( ) ) ;
Pin - > PinType = PinType ;
bHasExposedVariable = true ;
2014-07-14 17:15:42 -04:00
2015-02-09 10:30:03 -05:00
if ( ( ClassDefaultObject ! = nullptr ) & & K2Schema - > PinDefaultValueIsEditable ( * Pin ) )
2014-07-14 17:15:42 -04:00
{
FString DefaultValueAsString ;
2014-07-23 12:35:37 -04:00
const bool bDefaultValueSet = FBlueprintEditorUtils : : PropertyValueToString ( Property , reinterpret_cast < const uint8 * > ( ClassDefaultObject ) , DefaultValueAsString ) ;
2014-07-14 17:15:42 -04:00
check ( bDefaultValueSet ) ;
K2Schema - > TrySetDefaultValue ( * Pin , DefaultValueAsString ) ;
}
2014-11-03 20:02:18 -05:00
// Copy tooltip from the property.
K2Schema - > ConstructBasicPinTooltip ( * Pin , Property - > GetToolTipText ( ) , Pin - > PinToolTip ) ;
2014-03-14 14:13:41 -04:00
}
}
}
}
2015-02-09 10:30:03 -05:00
// Hide transform and attachment pins if it is not a scene component
const bool bHideTransformPins = ( ComponentClass ! = nullptr ) ? ! ComponentClass - > IsChildOf ( USceneComponent : : StaticClass ( ) ) : false ;
UEdGraphPin * ManualAttachmentPin = GetManualAttachmentPin ( ) ;
ManualAttachmentPin - > bHidden = bHideTransformPins ;
UEdGraphPin * TransformPin = GetRelativeTransformPin ( ) ;
TransformPin - > bHidden = bHideTransformPins ;
2014-03-14 14:13:41 -04:00
}
2014-07-14 17:15:42 -04:00
const UClass * UK2Node_AddComponent : : GetSpawnedType ( ) const
{
const UActorComponent * TemplateComponent = GetTemplateFromNode ( ) ;
return TemplateComponent ? TemplateComponent - > GetClass ( ) : NULL ;
}
2014-03-14 14:13:41 -04:00
void UK2Node_AddComponent : : AllocateDefaultPinsWithoutExposedVariables ( )
{
Super : : AllocateDefaultPins ( ) ;
// set properties on template pin
UEdGraphPin * TemplateNamePin = GetTemplateNamePinChecked ( ) ;
TemplateNamePin - > bDefaultValueIsReadOnly = true ;
TemplateNamePin - > bNotConnectable = true ;
TemplateNamePin - > bHidden = true ;
// set properties on relative transform pin
UEdGraphPin * RelativeTransformPin = GetRelativeTransformPin ( ) ;
RelativeTransformPin - > bDefaultValueIsIgnored = true ;
// Override this as a non-ref param, because the identity transform is hooked up in the compiler under the hood
RelativeTransformPin - > PinType . bIsReference = false ;
}
void UK2Node_AddComponent : : ReallocatePinsDuringReconstruction ( TArray < UEdGraphPin * > & OldPins )
{
Super : : ReallocatePinsDuringReconstruction ( OldPins ) ;
UEdGraphPin * TemplateNamePin = GetTemplateNamePinChecked ( ) ;
//UEdGraphPin* ReturnValuePin = GetReturnValuePin();
for ( int32 OldPinIdx = 0 ; TemplateNamePin & & OldPinIdx < OldPins . Num ( ) ; + + OldPinIdx )
{
if ( TemplateNamePin & & ( TemplateNamePin - > PinName = = OldPins [ OldPinIdx ] - > PinName ) )
{
TemplateNamePin - > DefaultValue = OldPins [ OldPinIdx ] - > DefaultValue ;
}
}
AllocatePinsForExposedVariables ( ) ;
}
void UK2Node_AddComponent : : ValidateNodeDuringCompilation ( FCompilerResultsLog & MessageLog ) const
{
Super : : ValidateNodeDuringCompilation ( MessageLog ) ;
UActorComponent * Template = GetTemplateFromNode ( ) ;
if ( Template )
{
UClass * TemplateClass = Template - > GetClass ( ) ;
if ( ! TemplateClass - > IsChildOf ( UActorComponent : : StaticClass ( ) ) | | TemplateClass - > HasAnyClassFlags ( CLASS_Abstract ) | | ! TemplateClass - > HasMetaData ( FBlueprintMetadata : : MD_BlueprintSpawnableComponent ) )
{
2014-04-23 18:30:37 -04:00
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " TemplateClass " ) , FText : : FromString ( TemplateClass - > GetName ( ) ) ) ;
Args . Add ( TEXT ( " NodeTitle " ) , GetNodeTitle ( ENodeTitleType : : FullTitle ) ) ;
MessageLog . Error ( * FText : : Format ( NSLOCTEXT ( " KismetCompiler " , " InvalidComponentTemplate_Error " , " Invalid class '{TemplateClass}' used as template by '{NodeTitle}' for @@ " ) , Args ) . ToString ( ) , this ) ;
2014-03-14 14:13:41 -04:00
}
2014-04-23 17:48:43 -04:00
if ( UChildActorComponent const * ChildActorComponent = Cast < UChildActorComponent const > ( Template ) )
{
UBlueprint const * Blueprint = GetBlueprint ( ) ;
2015-02-18 16:20:49 -05:00
UClass const * ChildActorClass = ChildActorComponent - > GetChildActorClass ( ) ;
2014-04-23 17:48:43 -04:00
if ( ChildActorClass = = Blueprint - > GeneratedClass )
{
UEdGraph const * ParentGraph = GetGraph ( ) ;
UEdGraphSchema_K2 const * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
if ( K2Schema - > IsConstructionScript ( ParentGraph ) )
{
2014-04-23 18:30:37 -04:00
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " ChildActorClass " ) , FText : : FromString ( ChildActorClass - > GetName ( ) ) ) ;
MessageLog . Error ( * FText : : Format ( NSLOCTEXT ( " KismetCompiler " , " AddSelfComponent_Error " , " @@ cannot add a '{ChildActorClass}' component in the construction script (could cause infinite recursion). " ) , Args ) . ToString ( ) , this ) ;
2014-04-23 17:48:43 -04:00
}
}
2014-07-25 03:18:49 -04:00
else if ( ChildActorClass ! = nullptr )
{
AActor const * ChildActor = Cast < AActor > ( ChildActorClass - > ClassDefaultObject ) ;
check ( ChildActor ! = nullptr ) ;
2014-07-31 13:31:45 -04:00
USceneComponent * RootComponent = ChildActor - > GetRootComponent ( ) ;
if ( ( RootComponent ! = nullptr ) & & ( RootComponent - > Mobility = = EComponentMobility : : Static ) & & ( ChildActorComponent - > Mobility ! = EComponentMobility : : Static ) )
2014-07-25 03:18:49 -04:00
{
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " ChildActorClass " ) , FText : : FromString ( ChildActorClass - > GetName ( ) ) ) ;
MessageLog . Error ( * FText : : Format ( NSLOCTEXT ( " KismetCompiler " , " AddStaticChildActorComponent_Error " , " @@ cannot add a '{ChildActorClass}' component as it has static mobility, and the ChildActorComponent does not. " ) , Args ) . ToString ( ) , this ) ;
}
}
2014-04-23 17:48:43 -04:00
}
2014-03-14 14:13:41 -04:00
}
else
{
2014-04-23 18:30:37 -04:00
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " NodeTitle " ) , GetNodeTitle ( ENodeTitleType : : FullTitle ) ) ;
MessageLog . Error ( * FText : : Format ( NSLOCTEXT ( " KismetCompiler " , " MissingComponentTemplate_Error " , " Unknown template referenced by '{NodeTitle}' for @@ " ) , Args ) . ToString ( ) , this ) ;
2014-03-14 14:13:41 -04:00
}
}
UActorComponent * UK2Node_AddComponent : : GetTemplateFromNode ( ) const
{
UBlueprint * BlueprintObj = GetBlueprint ( ) ;
// Find the template name input pin, to get the name from
UEdGraphPin * TemplateNamePin = GetTemplateNamePin ( ) ;
if ( TemplateNamePin )
{
const FString & TemplateName = TemplateNamePin - > DefaultValue ;
return BlueprintObj - > FindTemplateByName ( FName ( * TemplateName ) ) ;
}
return NULL ;
}
void UK2Node_AddComponent : : DestroyNode ( )
{
// See if this node has a template
UActorComponent * Template = GetTemplateFromNode ( ) ;
if ( Template ! = NULL )
{
// Get the blueprint so we can remove it from it
UBlueprint * BlueprintObj = GetBlueprint ( ) ;
// remove it
BlueprintObj - > Modify ( ) ;
BlueprintObj - > ComponentTemplates . Remove ( Template ) ;
}
Super : : DestroyNode ( ) ;
}
void UK2Node_AddComponent : : PrepareForCopying ( )
{
TemplateBlueprint = GetBlueprint ( ) - > GetPathName ( ) ;
}
void UK2Node_AddComponent : : PostPasteNode ( )
{
Super : : PostPasteNode ( ) ;
// There is a template associated with this node that should be unique, but after a node is pasted, it either points to a
// template shared by the copied node, or to nothing (when pasting into a different blueprint)
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
UBlueprint * Blueprint = GetBlueprint ( ) ;
// Find the template name and return type pins
UEdGraphPin * TemplateNamePin = GetTemplateNamePin ( ) ;
UEdGraphPin * ReturnPin = GetReturnValuePin ( ) ;
if ( ( TemplateNamePin ! = NULL ) & & ( ReturnPin ! = NULL ) )
{
// Find the current template if it exists
FString TemplateName = TemplateNamePin - > DefaultValue ;
UActorComponent * SourceTemplate = Blueprint - > FindTemplateByName ( FName ( * TemplateName ) ) ;
// Determine the type of the component needed
UClass * ComponentClass = Cast < UClass > ( ReturnPin - > PinType . PinSubCategoryObject . Get ( ) ) ;
if ( ComponentClass )
{
ensure ( NULL ! = Cast < UBlueprintGeneratedClass > ( Blueprint - > GeneratedClass ) ) ;
// Create a new template object and update the template pin to point to it
2015-02-09 08:13:10 -05:00
UActorComponent * NewTemplate = NewObject < UActorComponent > ( Blueprint - > GeneratedClass , ComponentClass , NAME_None , RF_ArchetypeObject | RF_Public ) ;
2014-03-14 14:13:41 -04:00
Blueprint - > ComponentTemplates . Add ( NewTemplate ) ;
TemplateNamePin - > DefaultValue = NewTemplate - > GetName ( ) ;
// Copy the old template data over to the new template if it's compatible
if ( ( SourceTemplate ! = NULL ) & & ( SourceTemplate - > GetClass ( ) - > IsChildOf ( ComponentClass ) ) )
{
TArray < uint8 > SavedProperties ;
FObjectWriter Writer ( SourceTemplate , SavedProperties ) ;
FObjectReader ( NewTemplate , SavedProperties ) ;
}
else if ( TemplateBlueprint . Len ( ) > 0 )
{
// try to find/load our blueprint to copy the template
UBlueprint * SourceBlueprint = FindObject < UBlueprint > ( NULL , * TemplateBlueprint ) ;
if ( SourceBlueprint ! = NULL )
{
SourceTemplate = SourceBlueprint - > FindTemplateByName ( FName ( * TemplateName ) ) ;
if ( ( SourceTemplate ! = NULL ) & & ( SourceTemplate - > GetClass ( ) - > IsChildOf ( ComponentClass ) ) )
{
TArray < uint8 > SavedProperties ;
FObjectWriter Writer ( SourceTemplate , SavedProperties ) ;
FObjectReader ( NewTemplate , SavedProperties ) ;
}
}
TemplateBlueprint . Empty ( ) ;
}
}
else
{
// Clear the template connection; can't resolve the type of the component to create
ensure ( false ) ;
TemplateNamePin - > DefaultValue = TEXT ( " " ) ;
}
}
}
2014-04-23 18:30:37 -04:00
FText UK2Node_AddComponent : : GetNodeTitle ( ENodeTitleType : : Type TitleType ) const
2014-03-14 14:13:41 -04:00
{
2015-02-16 10:37:24 -05:00
FText CachedAssetTitle ;
FText CachedNodeTitle ;
2014-03-14 14:13:41 -04:00
UEdGraphPin * TemplateNamePin = GetTemplateNamePin ( ) ;
2015-02-16 10:37:24 -05:00
if ( TemplateNamePin ! = nullptr )
2014-03-14 14:13:41 -04:00
{
FString TemplateName = TemplateNamePin - > DefaultValue ;
UBlueprint * Blueprint = GetBlueprint ( ) ;
2015-02-16 10:37:24 -05:00
if ( UActorComponent * SourceTemplate = Blueprint - > FindTemplateByName ( FName ( * TemplateName ) ) )
2014-03-14 14:13:41 -04:00
{
2015-03-03 17:20:43 -05:00
{
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " ComponentType " ) , SourceTemplate - > GetClass ( ) - > GetDisplayNameText ( ) ) ;
CachedNodeTitle = FText : : Format ( LOCTEXT ( " AddClass " , " Add {ComponentType} " ) , Args ) ;
}
2015-02-16 10:37:24 -05:00
2014-04-23 18:18:30 -04:00
UChildActorComponent * SubActorComp = Cast < UChildActorComponent > ( SourceTemplate ) ;
2014-03-14 14:13:41 -04:00
2015-02-16 10:37:24 -05:00
if ( const UObject * AssociatedAsset = SourceTemplate - > AdditionalStatObject ( ) )
2014-03-14 14:13:41 -04:00
{
2014-04-23 18:30:37 -04:00
FFormatNamedArguments Args ;
2015-02-16 10:37:24 -05:00
Args . Add ( TEXT ( " AssetType " ) , AssociatedAsset - > GetClass ( ) - > GetDisplayNameText ( ) ) ;
Args . Add ( TEXT ( " AssetName " ) , FText : : FromString ( AssociatedAsset - > GetName ( ) ) ) ;
CachedAssetTitle = FText : : Format ( LOCTEXT ( " AddComponentAssetDescription " , " {AssetType} {AssetName} " ) , Args ) ;
2014-03-14 14:13:41 -04:00
}
2015-02-18 16:20:49 -05:00
else if ( ( SubActorComp ! = nullptr ) & & ( SubActorComp - > GetChildActorClass ( ) ! = nullptr ) )
2014-03-14 14:13:41 -04:00
{
2014-04-23 18:30:37 -04:00
FFormatNamedArguments Args ;
2015-02-18 16:20:49 -05:00
Args . Add ( TEXT ( " ComponentClassName " ) , SubActorComp - > GetChildActorClass ( ) - > GetDisplayNameText ( ) ) ;
2015-02-16 10:37:24 -05:00
CachedAssetTitle = FText : : Format ( LOCTEXT ( " AddChildActorComponent " , " Actor Class {ComponentClassName} " ) , Args ) ;
2014-04-23 18:18:30 -04:00
}
2014-03-14 14:13:41 -04:00
else
{
2015-02-16 10:37:24 -05:00
CachedAssetTitle = FText : : GetEmpty ( ) ;
2014-03-14 14:13:41 -04:00
}
}
}
2015-02-16 10:37:24 -05:00
if ( ! CachedNodeTitle . IsEmpty ( ) )
2014-09-02 19:08:09 -04:00
{
2015-02-16 10:37:24 -05:00
if ( TitleType = = ENodeTitleType : : FullTitle )
{
return FText : : Format ( LOCTEXT ( " FullAddComponentTitle " , " {0} \n {1} " ) , CachedNodeTitle , CachedAssetTitle ) ;
}
else if ( ! CachedAssetTitle . IsEmpty ( ) )
{
return FText : : Format ( LOCTEXT ( " ShortAddComponentTitle " , " {0} [{1}] " ) , CachedNodeTitle , CachedAssetTitle ) ;
}
else
{
return CachedNodeTitle ;
}
2014-09-02 19:08:09 -04:00
}
2014-03-14 14:13:41 -04:00
return Super : : GetNodeTitle ( TitleType ) ;
}
FString UK2Node_AddComponent : : GetDocumentationLink ( ) const
{
return TEXT ( " Shared/GraphNodes/Blueprint/UK2Node_AddComponent " ) ;
}
FString UK2Node_AddComponent : : GetDocumentationExcerptName ( ) const
{
UEdGraphPin * TemplateNamePin = GetTemplateNamePin ( ) ;
UBlueprint * Blueprint = GetBlueprint ( ) ;
if ( ( TemplateNamePin ! = NULL ) & & ( Blueprint ! = NULL ) )
{
FString TemplateName = TemplateNamePin - > DefaultValue ;
UActorComponent * SourceTemplate = Blueprint - > FindTemplateByName ( FName ( * TemplateName ) ) ;
if ( SourceTemplate ! = NULL )
{
return SourceTemplate - > GetClass ( ) - > GetName ( ) ;
}
}
return Super : : GetDocumentationExcerptName ( ) ;
}
2014-08-21 18:50:33 -04:00
bool UK2Node_AddComponent : : IsCompatibleWithGraph ( UEdGraph const * Graph ) const
{
UBlueprint * Blueprint = FBlueprintEditorUtils : : FindBlueprintForGraph ( Graph ) ;
return ( Blueprint ! = nullptr ) & & FBlueprintEditorUtils : : IsActorBased ( Blueprint ) & & Super : : IsCompatibleWithGraph ( Graph ) ;
}
2014-03-14 14:13:41 -04:00
void UK2Node_AddComponent : : ExpandNode ( class FKismetCompilerContext & CompilerContext , UEdGraph * SourceGraph )
{
Super : : ExpandNode ( CompilerContext , SourceGraph ) ;
2014-10-17 06:37:11 -04:00
auto TransformPin = GetRelativeTransformPin ( ) ;
if ( TransformPin & & ! TransformPin - > LinkedTo . Num ( ) )
2014-10-09 06:06:10 -04:00
{
2014-10-17 06:37:11 -04:00
FString DefaultValue ;
// Try and find the template and get relative transform from it
UEdGraphPin * TemplateNamePin = GetTemplateNamePinChecked ( ) ;
const FString TemplateName = TemplateNamePin - > DefaultValue ;
check ( CompilerContext . Blueprint ) ;
USceneComponent * SceneCompTemplate = Cast < USceneComponent > ( CompilerContext . Blueprint - > FindTemplateByName ( FName ( * TemplateName ) ) ) ;
if ( SceneCompTemplate )
2014-10-09 06:06:10 -04:00
{
2014-10-17 06:37:11 -04:00
FTransform TemplateTransform = FTransform ( SceneCompTemplate - > RelativeRotation , SceneCompTemplate - > RelativeLocation , SceneCompTemplate - > RelativeScale3D ) ;
DefaultValue = TemplateTransform . ToString ( ) ;
}
2014-10-09 06:06:10 -04:00
2014-10-17 06:37:11 -04:00
auto ValuePin = InnerHandleAutoCreateRef ( this , TransformPin , CompilerContext , SourceGraph , ! DefaultValue . IsEmpty ( ) ) ;
if ( ValuePin )
{
ValuePin - > DefaultValue = DefaultValue ;
2014-10-09 06:06:10 -04:00
}
}
2014-10-17 06:37:11 -04:00
if ( bHasExposedVariable )
2014-03-14 14:13:41 -04:00
{
static FString ObjectParamName = FString ( TEXT ( " Object " ) ) ;
static FString ValueParamName = FString ( TEXT ( " Value " ) ) ;
static FString PropertyNameParamName = FString ( TEXT ( " PropertyName " ) ) ;
UK2Node_AddComponent * NewNode = CompilerContext . SpawnIntermediateNode < UK2Node_AddComponent > ( this , SourceGraph ) ;
NewNode - > SetFromFunction ( GetTargetFunction ( ) ) ;
NewNode - > AllocateDefaultPinsWithoutExposedVariables ( ) ;
// function parameters
2014-04-23 17:45:37 -04:00
CompilerContext . MovePinLinksToIntermediate ( * GetTemplateNamePinChecked ( ) , * NewNode - > GetTemplateNamePinChecked ( ) ) ;
CompilerContext . MovePinLinksToIntermediate ( * GetRelativeTransformPin ( ) , * NewNode - > GetRelativeTransformPin ( ) ) ;
CompilerContext . MovePinLinksToIntermediate ( * GetManualAttachmentPin ( ) , * NewNode - > GetManualAttachmentPin ( ) ) ;
2014-03-14 14:13:41 -04:00
UEdGraphPin * ReturnPin = NewNode - > GetReturnValuePin ( ) ;
UEdGraphPin * OriginalReturnPin = GetReturnValuePin ( ) ;
check ( ( NULL ! = ReturnPin ) & & ( NULL ! = OriginalReturnPin ) ) ;
ReturnPin - > PinType = OriginalReturnPin - > PinType ;
2014-04-23 17:45:37 -04:00
CompilerContext . MovePinLinksToIntermediate ( * OriginalReturnPin , * ReturnPin ) ;
2014-03-14 14:13:41 -04:00
// exec in
2014-04-23 17:45:37 -04:00
CompilerContext . MovePinLinksToIntermediate ( * GetExecPin ( ) , * NewNode - > GetExecPin ( ) ) ;
2014-03-14 14:13:41 -04:00
2014-07-14 17:15:42 -04:00
UEdGraphPin * LastThen = FKismetCompilerUtilities : : GenerateAssignmentNodes ( CompilerContext , SourceGraph , NewNode , this , ReturnPin , GetSpawnedType ( ) ) ;
2014-06-30 16:06:49 -04:00
2014-04-23 17:45:37 -04:00
CompilerContext . MovePinLinksToIntermediate ( * GetThenPin ( ) , * LastThen ) ;
2014-03-14 14:13:41 -04:00
BreakAllNodeLinks ( ) ;
}
}
# undef LOCTEXT_NAMESPACE