2016-01-07 08:17:16 -05:00
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
# include "BlueprintGraphPrivatePCH.h"
# include "CompilerResultsLog.h"
# include "CallFunctionHandler.h"
2014-06-09 11:11:12 -04:00
# include "K2Node_SwitchEnum.h"
2014-09-17 05:39:56 -04:00
# include "Kismet/KismetMathLibrary.h"
# include "Kismet/KismetArrayLibrary.h"
2015-09-10 21:20:27 -04:00
# include "Kismet2/KismetDebugUtilities.h"
2014-10-09 06:06:10 -04:00
# include "K2Node_PureAssignmentStatement.h"
2014-11-12 04:18:54 -05:00
# include "GraphEditorSettings.h"
2014-12-04 15:47:03 -05:00
# include "BlueprintActionFilter.h"
2015-06-01 14:36:32 -04:00
# include "Editor/Kismet/Public/FindInBlueprintManager.h"
2015-07-22 10:03:50 -04:00
2014-03-14 14:13:41 -04:00
# define LOCTEXT_NAMESPACE "K2Node"
2014-10-09 12:04:45 -04:00
/*******************************************************************************
* FCustomStructureParamHelper
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2014-04-23 20:18:55 -04:00
struct FCustomStructureParamHelper
{
static FName GetCustomStructureParamName ( )
{
static FName Name ( TEXT ( " CustomStructureParam " ) ) ;
return Name ;
}
static void FillCustomStructureParameterNames ( const UFunction * Function , TArray < FString > & OutNames )
{
OutNames . Empty ( ) ;
if ( Function )
{
FString MetaDataValue = Function - > GetMetaData ( GetCustomStructureParamName ( ) ) ;
if ( ! MetaDataValue . IsEmpty ( ) )
{
2015-03-02 15:51:37 -05:00
MetaDataValue . ParseIntoArray ( OutNames , TEXT ( " , " ) , true ) ;
2014-04-23 20:18:55 -04:00
}
}
}
static void HandleSinglePin ( UEdGraphPin * Pin )
{
if ( Pin )
{
if ( Pin - > LinkedTo . Num ( ) > 0 )
{
UEdGraphPin * LinkedTo = Pin - > LinkedTo [ 0 ] ;
check ( LinkedTo ) ;
ensure ( ! LinkedTo - > PinType . bIsArray ) ;
Pin - > PinType = LinkedTo - > PinType ;
}
else
{
const UEdGraphSchema_K2 * Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
Pin - > PinType . PinCategory = Schema - > PC_Wildcard ;
Pin - > PinType . PinSubCategory = TEXT ( " " ) ;
Pin - > PinType . PinSubCategoryObject = NULL ;
}
}
}
static void UpdateCustomStructurePins ( const UFunction * Function , UK2Node * Node , UEdGraphPin * SinglePin = NULL )
{
if ( Function & & Node )
{
TArray < FString > Names ;
FCustomStructureParamHelper : : FillCustomStructureParameterNames ( Function , Names ) ;
if ( SinglePin )
{
if ( Names . Contains ( SinglePin - > PinName ) )
{
HandleSinglePin ( SinglePin ) ;
}
}
else
{
for ( auto & Name : Names )
{
if ( auto Pin = Node - > FindPin ( Name ) )
{
HandleSinglePin ( Pin ) ;
}
}
}
}
}
} ;
2014-10-09 12:04:45 -04:00
/*******************************************************************************
* FDynamicOutputUtils
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
struct FDynamicOutputHelper
{
public :
FDynamicOutputHelper ( UEdGraphPin * InAlteredPin )
: MutatingPin ( InAlteredPin )
{ }
/**
* Attempts to change the output pin ' s type so that it reflects the class
* specified by the input class pin .
*/
void ConformOutputType ( ) const ;
/**
* Retrieves the class pin that is used to determine the function ' s output type .
*
* @ return Null if the " DeterminesOutputType " metadata targets an invalid
* param ( or if the metadata isn ' t present ) , otherwise a class picker pin .
*/
static UEdGraphPin * GetTypePickerPin ( const UK2Node_CallFunction * FuncNode ) ;
/**
* Attempts to pull out class info from the supplied pin . Starts with the
* pin ' s default , and then falls back onto the pin ' s native type . Will poll
* any connections that the pin may have .
*
* @ param Pin The pin you want a class from .
* @ return A class that the pin represents ( could be null if the pin isn ' t a class pin ) .
*/
static UClass * GetPinClass ( UEdGraphPin * Pin ) ;
/**
* Intended to be used by ValidateNodeDuringCompilation ( ) . Will check to
* make sure the dynamic output ' s connections are still valid ( they could
* become invalid as the the pin ' s type changes ) .
*
* @ param FuncNode The node you wish to validate .
* @ param MessageLog The log to post errors / warnings to .
*/
static void VerifyNode ( const UK2Node_CallFunction * FuncNode , FCompilerResultsLog & MessageLog ) ;
private :
/**
*
*
* @ return
*/
UK2Node_CallFunction * GetFunctionNode ( ) const ;
/**
*
*
* @ return
*/
UFunction * GetTargetFunction ( ) const ;
/**
* Checks if the supplied pin is the class picker that governs the
* function ' s output type .
*
* @ param Pin The pin to test .
* @ return True if the pin corresponds to the param that was flagged by the " DeterminesOutputType " metadata .
*/
bool IsTypePickerPin ( UEdGraphPin * Pin ) const ;
/**
* Retrieves the object output pin that is altered as the class input is
* changed ( favors params flagged by " DynamicOutputParam " metadata ) .
*
* @ return Null if the output param cannot be altered from the class input ,
* otherwise a output pin that will mutate type as the class input is changed .
*/
static UEdGraphPin * GetDynamicOutPin ( const UK2Node_CallFunction * FuncNode ) ;
/**
* Checks if the specified type is an object type that reflects the picker
* pin ' s class .
*
* @ param TypeToTest The type you want to check .
* @ return True if the type is likely the output governed by the class picker pin , otherwise false .
*/
static bool CanConformPinType ( const UK2Node_CallFunction * FuncNode , const FEdGraphPinType & TypeToTest ) ;
private :
UEdGraphPin * MutatingPin ;
} ;
void FDynamicOutputHelper : : ConformOutputType ( ) const
{
if ( IsTypePickerPin ( MutatingPin ) )
{
UClass * PickedClass = GetPinClass ( MutatingPin ) ;
UK2Node_CallFunction * FuncNode = GetFunctionNode ( ) ;
if ( UEdGraphPin * DynamicOutPin = GetDynamicOutPin ( FuncNode ) )
{
DynamicOutPin - > PinType . PinSubCategoryObject = PickedClass ;
// leave the connection, and instead bring the user's attention to
// it via a ValidateNodeDuringCompilation() error
// const UEdGraphSchema* Schema = FuncNode->GetSchema();
// for (int32 LinkIndex = 0; LinkIndex < DynamicOutPin->LinkedTo.Num();)
// {
// UEdGraphPin* Link = DynamicOutPin->LinkedTo[LinkIndex];
// // if this can no longer be linked to the other pin, then we
// // should disconnect it (because the pin's type just changed)
// if (Schema->CanCreateConnection(DynamicOutPin, Link).Response == CONNECT_RESPONSE_DISALLOW)
// {
// DynamicOutPin->BreakLinkTo(Link);
// // @TODO: warn/notify somehow
// }
// else
// {
// ++LinkIndex;
// }
// }
}
}
}
UEdGraphPin * FDynamicOutputHelper : : GetTypePickerPin ( const UK2Node_CallFunction * FuncNode )
{
UEdGraphPin * TypePickerPin = nullptr ;
if ( UFunction * Function = FuncNode - > GetTargetFunction ( ) )
{
FString TypeDeterminingPinName = Function - > GetMetaData ( FBlueprintMetadata : : MD_DynamicOutputType ) ;
if ( ! TypeDeterminingPinName . IsEmpty ( ) )
{
TypePickerPin = FuncNode - > FindPin ( TypeDeterminingPinName ) ;
}
}
if ( TypePickerPin & & ! ensure ( TypePickerPin - > Direction = = EGPD_Input ) )
{
TypePickerPin = nullptr ;
}
return TypePickerPin ;
}
UClass * FDynamicOutputHelper : : GetPinClass ( UEdGraphPin * Pin )
{
UClass * PinClass = UObject : : StaticClass ( ) ;
2015-06-30 12:42:39 -04:00
bool const bIsClassOrObjectPin = ( Pin - > PinType . PinCategory = = UEdGraphSchema_K2 : : PC_Class | | Pin - > PinType . PinCategory = = UEdGraphSchema_K2 : : PC_Object ) ;
if ( bIsClassOrObjectPin )
2014-10-09 12:04:45 -04:00
{
if ( UClass * DefaultClass = Cast < UClass > ( Pin - > DefaultObject ) )
{
PinClass = DefaultClass ;
}
else if ( UClass * BaseClass = Cast < UClass > ( Pin - > PinType . PinSubCategoryObject . Get ( ) ) )
{
PinClass = BaseClass ;
}
if ( Pin - > LinkedTo . Num ( ) > 0 )
{
2015-06-30 12:42:39 -04:00
UClass * CommonInputClass = nullptr ;
for ( UEdGraphPin * LinkedPin : Pin - > LinkedTo )
2014-10-09 12:04:45 -04:00
{
2015-06-30 12:42:39 -04:00
const FEdGraphPinType & LinkedPinType = LinkedPin - > PinType ;
UClass * LinkClass = Cast < UClass > ( LinkedPinType . PinSubCategoryObject . Get ( ) ) ;
if ( LinkClass = = nullptr & & LinkedPinType . PinSubCategory = = UEdGraphSchema_K2 : : PSC_Self )
2014-10-09 12:04:45 -04:00
{
2015-06-30 12:42:39 -04:00
if ( UK2Node * K2Node = Cast < UK2Node > ( LinkedPin - > GetOwningNode ( ) ) )
{
LinkClass = K2Node - > GetBlueprint ( ) - > GeneratedClass ;
}
2014-10-09 12:04:45 -04:00
}
2015-06-30 12:42:39 -04:00
if ( LinkClass ! = nullptr )
2014-10-09 12:04:45 -04:00
{
2015-06-30 12:42:39 -04:00
if ( CommonInputClass ! = nullptr )
{
while ( ! LinkClass - > IsChildOf ( CommonInputClass ) )
{
CommonInputClass = CommonInputClass - > GetSuperClass ( ) ;
}
}
else
{
CommonInputClass = LinkClass ;
}
2014-10-09 12:04:45 -04:00
}
}
PinClass = CommonInputClass ;
}
}
return PinClass ;
}
void FDynamicOutputHelper : : VerifyNode ( const UK2Node_CallFunction * FuncNode , FCompilerResultsLog & MessageLog )
{
if ( UEdGraphPin * DynamicOutPin = GetDynamicOutPin ( FuncNode ) )
{
const UEdGraphSchema * Schema = FuncNode - > GetSchema ( ) ;
for ( UEdGraphPin * Link : DynamicOutPin - > LinkedTo )
{
if ( Schema - > CanCreateConnection ( DynamicOutPin , Link ) . Response = = CONNECT_RESPONSE_DISALLOW )
{
FText const ErrorFormat = LOCTEXT ( " BadConnection " , " Invalid pin connection from '@@' to '@@'. You may have changed the type after the connections were made. " ) ;
MessageLog . Error ( * ErrorFormat . ToString ( ) , DynamicOutPin , Link ) ;
}
}
}
}
UK2Node_CallFunction * FDynamicOutputHelper : : GetFunctionNode ( ) const
{
return CastChecked < UK2Node_CallFunction > ( MutatingPin - > GetOwningNode ( ) ) ;
}
UFunction * FDynamicOutputHelper : : GetTargetFunction ( ) const
{
return GetFunctionNode ( ) - > GetTargetFunction ( ) ;
}
bool FDynamicOutputHelper : : IsTypePickerPin ( UEdGraphPin * Pin ) const
{
bool bIsTypeDeterminingPin = false ;
if ( UFunction * Function = GetTargetFunction ( ) )
{
FString TypeDeterminingPinName = Function - > GetMetaData ( FBlueprintMetadata : : MD_DynamicOutputType ) ;
if ( ! TypeDeterminingPinName . IsEmpty ( ) )
{
bIsTypeDeterminingPin = ( Pin - > PinName = = TypeDeterminingPinName ) ;
}
}
bool const bPinIsClassPicker = ( Pin - > PinType . PinCategory = = UEdGraphSchema_K2 : : PC_Class ) ;
2015-06-30 12:42:39 -04:00
bool const bPinIsObjectPicker = ( Pin - > PinType . PinCategory = = UEdGraphSchema_K2 : : PC_Object ) ;
return bIsTypeDeterminingPin & & ( bPinIsClassPicker | | bPinIsObjectPicker ) & & ( Pin - > Direction = = EGPD_Input ) ;
2014-10-09 12:04:45 -04:00
}
UEdGraphPin * FDynamicOutputHelper : : GetDynamicOutPin ( const UK2Node_CallFunction * FuncNode )
{
UProperty * TaggedOutputParam = nullptr ;
if ( UFunction * Function = FuncNode - > GetTargetFunction ( ) )
{
const FString & OutputPinName = Function - > GetMetaData ( FBlueprintMetadata : : MD_DynamicOutputParam ) ;
// we sort through properties, instead of pins, because the pin's type
// could already be modified to some other class (for when we check CanConformPinType)
for ( TFieldIterator < UProperty > ParamIt ( Function ) ; ParamIt & & ( ParamIt - > PropertyFlags & CPF_Parm ) ; + + ParamIt )
{
if ( OutputPinName . IsEmpty ( ) & & ParamIt - > HasAnyPropertyFlags ( CPF_ReturnParm ) )
{
TaggedOutputParam = * ParamIt ;
break ;
}
else if ( OutputPinName = = ParamIt - > GetName ( ) )
{
TaggedOutputParam = * ParamIt ;
break ;
}
}
if ( TaggedOutputParam ! = nullptr )
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
FEdGraphPinType PropertyPinType ;
if ( ! K2Schema - > ConvertPropertyToPinType ( TaggedOutputParam , /*out*/ PropertyPinType ) | | ! CanConformPinType ( FuncNode , PropertyPinType ) )
{
TaggedOutputParam = nullptr ;
}
}
}
UEdGraphPin * DynamicOutPin = nullptr ;
if ( TaggedOutputParam ! = nullptr )
{
DynamicOutPin = FuncNode - > FindPin ( TaggedOutputParam - > GetName ( ) ) ;
if ( DynamicOutPin & & ( DynamicOutPin - > Direction ! = EGPD_Output ) )
{
DynamicOutPin = nullptr ;
}
}
return DynamicOutPin ;
}
bool FDynamicOutputHelper : : CanConformPinType ( const UK2Node_CallFunction * FuncNode , const FEdGraphPinType & TypeToTest )
{
bool bIsProperType = false ;
if ( UEdGraphPin * TypePickerPin = GetTypePickerPin ( FuncNode ) )
{
UClass * BasePickerClass = CastChecked < UClass > ( TypePickerPin - > PinType . PinSubCategoryObject . Get ( ) ) ;
const FString & PinCategory = TypeToTest . PinCategory ;
if ( ( PinCategory = = UEdGraphSchema_K2 : : PC_Object ) | |
( PinCategory = = UEdGraphSchema_K2 : : PC_Interface ) | |
( PinCategory = = UEdGraphSchema_K2 : : PC_Class ) )
{
if ( UClass * TypeClass = Cast < UClass > ( TypeToTest . PinSubCategoryObject . Get ( ) ) )
{
bIsProperType = BasePickerClass - > IsChildOf ( TypeClass ) ;
}
}
}
return bIsProperType ;
}
/*******************************************************************************
* UK2Node_CallFunction
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2014-10-14 10:29:11 -04:00
UK2Node_CallFunction : : UK2Node_CallFunction ( const FObjectInitializer & ObjectInitializer )
: Super ( ObjectInitializer )
2015-05-27 17:51:08 -04:00
, bPinTooltipsValid ( false )
2014-03-14 14:13:41 -04:00
{
}
bool UK2Node_CallFunction : : IsDeprecated ( ) const
{
UFunction * Function = GetTargetFunction ( ) ;
return ( Function ! = NULL ) & & Function - > HasMetaData ( FBlueprintMetadata : : MD_DeprecatedFunction ) ;
}
bool UK2Node_CallFunction : : ShouldWarnOnDeprecation ( ) const
{
// TEMP: Do not warn in the case of SpawnActor, as we have a special upgrade path for those nodes
return ( FunctionReference . GetMemberName ( ) ! = FName ( TEXT ( " BeginSpawningActorFromBlueprint " ) ) ) ;
}
FString UK2Node_CallFunction : : GetDeprecationMessage ( ) const
{
UFunction * Function = GetTargetFunction ( ) ;
if ( ( Function ! = NULL ) & & Function - > HasMetaData ( FBlueprintMetadata : : MD_DeprecationMessage ) )
{
return FString : : Printf ( TEXT ( " %s %s " ) , * LOCTEXT ( " CallFunctionDeprecated_Warning " , " @@ is deprecated; " ) . ToString ( ) , * Function - > GetMetaData ( FBlueprintMetadata : : MD_DeprecationMessage ) ) ;
}
return Super : : GetDeprecationMessage ( ) ;
}
2015-04-28 11:31:15 -04:00
FText UK2Node_CallFunction : : GetFunctionContextString ( ) const
2014-03-14 14:13:41 -04:00
{
2015-04-28 11:31:15 -04:00
FText ContextString ;
2014-03-14 14:13:41 -04:00
// Don't show 'target is' if no target pin!
UEdGraphPin * SelfPin = GetDefault < UEdGraphSchema_K2 > ( ) - > FindSelfPin ( * this , EGPD_Input ) ;
if ( SelfPin ! = NULL & & ! SelfPin - > bHidden )
{
const UFunction * Function = GetTargetFunction ( ) ;
UClass * CurrentSelfClass = ( Function ! = NULL ) ? Function - > GetOwnerClass ( ) : NULL ;
2014-04-23 19:15:51 -04:00
UClass const * TrueSelfClass = CurrentSelfClass ;
if ( CurrentSelfClass & & CurrentSelfClass - > ClassGeneratedBy )
{
TrueSelfClass = CurrentSelfClass - > GetAuthoritativeClass ( ) ;
}
2014-03-14 14:13:41 -04:00
2015-02-06 04:43:02 -05:00
const FText TargetText = FBlueprintEditorUtils : : GetFriendlyClassDisplayName ( TrueSelfClass ) ;
2014-03-14 14:13:41 -04:00
2015-04-28 11:31:15 -04:00
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " TargetName " ) , TargetText ) ;
ContextString = FText : : Format ( LOCTEXT ( " CallFunctionOnDifferentContext " , " Target is {TargetName} " ) , Args ) ;
2014-03-14 14:13:41 -04:00
}
return ContextString ;
}
2014-04-23 18:30:37 -04:00
FText UK2Node_CallFunction : : GetNodeTitle ( ENodeTitleType : : Type TitleType ) const
2014-03-14 14:13:41 -04:00
{
2015-03-27 12:54:58 -04:00
FText FunctionName ;
2015-04-28 11:31:15 -04:00
FText ContextString ;
FText RPCString ;
2014-03-14 14:13:41 -04:00
if ( UFunction * Function = GetTargetFunction ( ) )
{
RPCString = UK2Node_Event : : GetLocalizedNetString ( Function - > FunctionFlags , true ) ;
2014-09-21 20:34:20 -04:00
FunctionName = GetUserFacingFunctionName ( Function ) ;
2014-03-14 14:13:41 -04:00
ContextString = GetFunctionContextString ( ) ;
}
else
2014-11-18 10:54:37 -05:00
{
2015-03-27 12:54:58 -04:00
FunctionName = FText : : FromName ( FunctionReference . GetMemberName ( ) ) ;
2014-03-14 14:13:41 -04:00
if ( ( GEditor ! = NULL ) & & ( GetDefault < UEditorStyleSettings > ( ) - > bShowFriendlyNames ) )
{
2015-03-27 12:54:58 -04:00
FunctionName = FText : : FromString ( FName : : NameToDisplayString ( FunctionName . ToString ( ) , false ) ) ;
2014-03-14 14:13:41 -04:00
}
2014-11-18 10:54:37 -05:00
}
2014-03-14 14:13:41 -04:00
2014-04-23 18:30:37 -04:00
if ( TitleType = = ENodeTitleType : : FullTitle )
{
FFormatNamedArguments Args ;
2015-03-27 12:54:58 -04:00
Args . Add ( TEXT ( " FunctionName " ) , FunctionName ) ;
2015-04-28 11:31:15 -04:00
Args . Add ( TEXT ( " ContextString " ) , ContextString ) ;
Args . Add ( TEXT ( " RPCString " ) , RPCString ) ;
if ( ContextString . IsEmpty ( ) & & RPCString . IsEmpty ( ) )
{
return FText : : Format ( LOCTEXT ( " CallFunction_FullTitle " , " {FunctionName} " ) , Args ) ;
}
else if ( ContextString . IsEmpty ( ) )
{
return FText : : Format ( LOCTEXT ( " CallFunction_FullTitle_WithRPCString " , " {FunctionName} \n {RPCString} " ) , Args ) ;
}
else if ( RPCString . IsEmpty ( ) )
{
return FText : : Format ( LOCTEXT ( " CallFunction_FullTitle_WithContextString " , " {FunctionName} \n {ContextString} " ) , Args ) ;
}
else
{
return FText : : Format ( LOCTEXT ( " CallFunction_FullTitle_WithContextRPCString " , " {FunctionName} \n {ContextString} \n {RPCString} " ) , Args ) ;
}
2014-04-23 18:30:37 -04:00
}
else
{
2015-03-27 12:54:58 -04:00
return FunctionName ;
2014-04-23 18:30:37 -04:00
}
}
2015-05-27 17:51:08 -04:00
void UK2Node_CallFunction : : GetPinHoverText ( const UEdGraphPin & Pin , FString & HoverTextOut ) const
{
if ( ! bPinTooltipsValid )
{
2015-06-03 14:47:53 -04:00
for ( auto & P : Pins )
2015-05-27 17:51:08 -04:00
{
2015-06-16 11:25:01 -04:00
P - > PinToolTip . Empty ( ) ;
2015-06-03 14:47:53 -04:00
GeneratePinTooltip ( * P ) ;
2015-05-27 17:51:08 -04:00
}
bPinTooltipsValid = true ;
}
return UK2Node : : GetPinHoverText ( Pin , HoverTextOut ) ;
}
2014-03-14 14:13:41 -04:00
void UK2Node_CallFunction : : AllocateDefaultPins ( )
{
2015-05-27 17:51:08 -04:00
InvalidatePinTooltips ( ) ;
2014-03-14 14:13:41 -04:00
UBlueprint * MyBlueprint = GetBlueprint ( ) ;
2014-09-25 13:31:55 -04:00
2014-03-14 14:13:41 -04:00
UFunction * Function = GetTargetFunction ( ) ;
2014-09-25 13:31:55 -04:00
// favor the skeleton function if possible (in case the signature has
// changed, and not yet compiled).
if ( ! FunctionReference . IsSelfContext ( ) )
{
UClass * FunctionClass = FunctionReference . GetMemberParentClass ( MyBlueprint - > GeneratedClass ) ;
if ( UBlueprintGeneratedClass * BpClassOwner = Cast < UBlueprintGeneratedClass > ( FunctionClass ) )
{
// this function could currently only be a part of some skeleton
// class (the blueprint has not be compiled with it yet), so let's
// check the skeleton class as well, see if we can pull pin data
// from there...
2014-12-15 16:51:37 -05:00
UBlueprint * FunctionBlueprint = CastChecked < UBlueprint > ( BpClassOwner - > ClassGeneratedBy , ECastCheckedType : : NullAllowed ) ;
if ( FunctionBlueprint )
2014-09-25 13:31:55 -04:00
{
2014-12-15 16:51:37 -05:00
if ( UFunction * SkelFunction = FindField < UFunction > ( FunctionBlueprint - > SkeletonGeneratedClass , FunctionReference . GetMemberName ( ) ) )
{
Function = SkelFunction ;
}
2014-09-25 13:31:55 -04:00
}
}
}
2014-03-14 14:13:41 -04:00
// First try remap table
if ( Function = = NULL )
{
2015-03-12 14:17:48 -04:00
UClass * ParentClass = FunctionReference . GetMemberParentClass ( GetBlueprintClassFromNode ( ) ) ;
2014-03-14 14:13:41 -04:00
if ( ParentClass ! = NULL )
{
2015-03-12 14:17:48 -04:00
if ( UFunction * NewFunction = Cast < UFunction > ( FMemberReference : : FindRemappedField ( ParentClass , FunctionReference . GetMemberName ( ) ) ) )
2014-03-14 14:13:41 -04:00
{
// Found a remapped property, update the node
Function = NewFunction ;
SetFromFunction ( NewFunction ) ;
}
}
}
if ( Function = = NULL )
{
// The function no longer exists in the stored scope
// Try searching inside all function libraries, in case the function got refactored into one of them.
for ( TObjectIterator < UClass > ClassIt ; ClassIt ; + + ClassIt )
{
UClass * TestClass = * ClassIt ;
if ( TestClass - > IsChildOf ( UBlueprintFunctionLibrary : : StaticClass ( ) ) )
{
Function = FindField < UFunction > ( TestClass , FunctionReference . GetMemberName ( ) ) ;
if ( Function ! = NULL )
{
2015-03-12 14:17:48 -04:00
UClass * OldClass = FunctionReference . GetMemberParentClass ( GetBlueprintClassFromNode ( ) ) ;
2014-03-14 14:13:41 -04:00
Message_Note ( FString : : Printf ( * LOCTEXT ( " FixedUpFunctionInLibrary " , " UK2Node_CallFunction: Fixed up function '%s', originally in '%s', now in library '%s'. " ) . ToString ( ) ,
* FunctionReference . GetMemberName ( ) . ToString ( ) ,
( OldClass ! = NULL ) ? * OldClass - > GetName ( ) : TEXT ( " (null) " ) , * TestClass - > GetName ( ) ) ) ;
SetFromFunction ( Function ) ;
break ;
}
}
}
}
// Now create the pins if we ended up with a valid function to call
if ( Function ! = NULL )
{
CreatePinsForFunctionCall ( Function ) ;
}
2014-04-23 20:18:55 -04:00
FCustomStructureParamHelper : : UpdateCustomStructurePins ( Function , this ) ;
2014-03-14 14:13:41 -04:00
Super : : AllocateDefaultPins ( ) ;
}
/** Util to find self pin in an array */
UEdGraphPin * FindSelfPin ( TArray < UEdGraphPin * > & Pins )
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
for ( int32 PinIdx = 0 ; PinIdx < Pins . Num ( ) ; PinIdx + + )
{
if ( Pins [ PinIdx ] - > PinName = = K2Schema - > PN_Self )
{
return Pins [ PinIdx ] ;
}
}
return NULL ;
}
void UK2Node_CallFunction : : ReallocatePinsDuringReconstruction ( TArray < UEdGraphPin * > & OldPins )
{
// BEGIN TEMP
// We had a bug where the class was being messed up by copy/paste, but the self pin class was still ok. This code fixes up those cases.
UFunction * Function = GetTargetFunction ( ) ;
if ( Function = = NULL )
{
if ( UEdGraphPin * SelfPin = FindSelfPin ( OldPins ) )
{
if ( UClass * SelfPinClass = Cast < UClass > ( SelfPin - > PinType . PinSubCategoryObject . Get ( ) ) )
{
if ( UFunction * NewFunction = FindField < UFunction > ( SelfPinClass , FunctionReference . GetMemberName ( ) ) )
{
SetFromFunction ( NewFunction ) ;
}
}
}
}
// END TEMP
Super : : ReallocatePinsDuringReconstruction ( OldPins ) ;
2015-01-15 12:10:46 -05:00
// Connect Execute and Then pins for functions, which became pure.
ReconnectPureExecPins ( OldPins ) ;
2014-03-14 14:13:41 -04:00
}
UEdGraphPin * UK2Node_CallFunction : : CreateSelfPin ( const UFunction * Function )
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
// Chase up the function's Super chain, the function can be called on any object that is at least that specific
const UFunction * FirstDeclaredFunction = Function ;
while ( FirstDeclaredFunction - > GetSuperFunction ( ) ! = NULL )
{
FirstDeclaredFunction = FirstDeclaredFunction - > GetSuperFunction ( ) ;
}
// Create the self pin
UClass * FunctionClass = CastChecked < UClass > ( FirstDeclaredFunction - > GetOuter ( ) ) ;
2014-09-24 14:15:01 -04:00
// we don't want blueprint-function target pins to be formed from the
// skeleton class (otherwise, they could be incompatible with other pins
// that represent the same type)... this here could lead to a compiler
// warning (the GeneratedClass could not have the function yet), but in
// that, the user would be reminded to compile the other blueprint
2014-12-15 16:51:37 -05:00
if ( FunctionClass - > ClassGeneratedBy )
{
FunctionClass = FunctionClass - > GetAuthoritativeClass ( ) ;
}
2014-03-14 14:13:41 -04:00
UEdGraphPin * SelfPin = NULL ;
2014-09-24 14:15:01 -04:00
if ( FunctionClass = = GetBlueprint ( ) - > GeneratedClass )
2014-03-14 14:13:41 -04:00
{
// This means the function is defined within the blueprint, so the pin should be a true "self" pin
SelfPin = CreatePin ( EGPD_Input , K2Schema - > PC_Object , K2Schema - > PSC_Self , NULL , false , false , K2Schema - > PN_Self ) ;
}
2014-04-23 17:58:27 -04:00
else if ( FunctionClass - > IsChildOf ( UInterface : : StaticClass ( ) ) )
{
SelfPin = CreatePin ( EGPD_Input , K2Schema - > PC_Interface , TEXT ( " " ) , FunctionClass , false , false , K2Schema - > PN_Self ) ;
}
2014-03-14 14:13:41 -04:00
else
{
// This means that the function is declared in an external class, and should reference that class
SelfPin = CreatePin ( EGPD_Input , K2Schema - > PC_Object , TEXT ( " " ) , FunctionClass , false , false , K2Schema - > PN_Self ) ;
}
check ( SelfPin ! = NULL ) ;
return SelfPin ;
}
void UK2Node_CallFunction : : CreateExecPinsForFunctionCall ( const UFunction * Function )
{
2014-06-09 11:11:12 -04:00
bool bCreateSingleExecInputPin = true ;
bool bCreateThenPin = true ;
2014-03-14 14:13:41 -04:00
// If not pure, create exec pins
if ( ! bIsPureFunc )
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
// If we want enum->exec expansion, and it is not disabled, do it now
if ( bWantsEnumToExecExpansion )
{
const FString & EnumParamName = Function - > GetMetaData ( FBlueprintMetadata : : MD_ExpandEnumAsExecs ) ;
UByteProperty * EnumProp = FindField < UByteProperty > ( Function , FName ( * EnumParamName ) ) ;
if ( EnumProp ! = NULL & & EnumProp - > Enum ! = NULL )
{
2014-06-09 11:11:12 -04:00
const bool bIsFunctionInput = ! EnumProp - > HasAnyPropertyFlags ( CPF_ReturnParm ) & &
( ! EnumProp - > HasAnyPropertyFlags ( CPF_OutParm ) | |
EnumProp - > HasAnyPropertyFlags ( CPF_ReferenceParm ) ) ;
const EEdGraphPinDirection Direction = bIsFunctionInput ? EGPD_Input : EGPD_Output ;
2014-03-14 14:13:41 -04:00
// yay, found it! Now create exec pin for each
2014-06-09 11:11:12 -04:00
int32 NumExecs = ( EnumProp - > Enum - > NumEnums ( ) - 1 ) ;
for ( int32 ExecIdx = 0 ; ExecIdx < NumExecs ; ExecIdx + + )
2014-03-14 14:13:41 -04:00
{
Copying //UE4/Release-Staging-4.12 to //UE4/Dev-Main (Source: //UE4/Release-4.12 @ 2955635)
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2955635 on 2016/04/26 by Max.Chen
Sequencer: Fix filtering so that folders that contain filtered nodes will also appear.
#jira UE-28213
Change 2955617 on 2016/04/25 by Dmitriy.Dyomin
Better fix for: Post processing rendering artifacts Nexus 6
this device on Android 5.0.1 does not support BGRA8888 texture as a color attachment
#jira: UE-24067
Change 2955522 on 2016/04/25 by Max.Chen
Sequencer: Fix crash when resolving object guid and context is null.
#jira UE-29916
Change 2955504 on 2016/04/25 by Alexis.Matte
#jira UE-29926
Fix build error for SplineComponent. I just move variable under #if !UE_BUILD_SHIPPING instead #if WITH_EDITORONLY_DATA to fix all build flavor, please feel free to adjust according to what the initial fix was suppose to do.
Change 2955500 on 2016/04/25 by Dan.Oconnor
Integration of 2955445 from Dev-BP
#jira UE-29012
Change 2955234 on 2016/04/25 by Lina.Halper
Fixed tool tip of twist node
#jira : UE-29907
Change 2955211 on 2016/04/25 by Ben.Marsh
Exclude all plugins which aren't required for a project (ie. don't have any content or modules for the current target) from its target receipt. Prevents dependencies on .uplugin files whose dependencies are otherwise compiled out. Re-enable PS4Media plugin by default.
#jira UE-29842
Change 2955155 on 2016/04/25 by Jamie.Dale
Fixed an issue where text committed via a focus loss might not display the correct text if it was changed during commit
#jira UE-28756
Change 2955144 on 2016/04/25 by Jamie.Dale
Fixed a case where editable text controls would fail to select their text when focused
There was an order of operations issue between the options to select all text and move the cursor to the end of the document, which caused the cursor move to happen after the select all, and undo the selection. The order of these operations has now been flipped.
#jira UE-29818
#jira UE-29772
Change 2955136 on 2016/04/25 by Chad.Taylor
Merging to 4.12:
Morpheus latency fix. Late update tracking frame was getting unnecessarily buffered an extra frame on the RHI thread. Removed buffering and the issue is fixed.
#jira UE-22581
Change 2955134 on 2016/04/25 by Lina.Halper
Removed code that blocks moving actor when they don't have physics asset
#jira : UE-29796
#code review: Benn.Gallagher
Change 2955130 on 2016/04/25 by Zak.Middleton
#ue4 - (4.12) Don't reject low distance MTD, it could cause us to not process some valid overlaps.
(copy of 2955001 in Main)
#jira UE-29531
#lockdown Nick.Penwarden
Change 2955098 on 2016/04/25 by Marc.Audy
Don't spawn a child actor on the client if the server is going to have created one and be replicating it to the client
#jira UE-7539
Change 2955049 on 2016/04/25 by Richard.TalbotWatkin
Changes to how SplineComponents debug render. Added a SetDrawDebug method to control whether a spline is rendered. Also extended the facility to non-editor builds.
#jira UE-29753 - Add ability to display a SplineComponent in-game
Change 2955040 on 2016/04/25 by Chris.Gagnon
Fixed Initializer Order Warning in hot reload ctor.
#jira UE-28811, UE-28960
Change 2954995 on 2016/04/25 by Marc.Audy
Make USceneComponent::Pre/PostNetReceive and PostRepNotifies protected instead of private so that subclasses can implement replication behaviors
#jira UE-29909
Change 2954970 on 2016/04/25 by Peter.Sauerbrei
fix for openwrite with O_APPEND flag
#jira UE-28417
Change 2954917 on 2016/04/25 by Chris.Gagnon
Moved a desired change from Main to 4.12
Added input settings to:
- control if the viewport locks the mouse on acquire capture.
- control if the viewport acquires capture on the application launch (first window activate).
#jira UE-28811, UE-28960
parity with 4.11 (UE-28811, UE-28960 would be reintroduced without this)
Change 2954908 on 2016/04/25 by Alexis.Matte
#jira UE-29478
Prevent modal dialog to use 100% of a core
Change 2954888 on 2016/04/25 by Marcus.Wassmer
Fix compile issue with chinese locale
#jira UE-29708
Change 2954813 on 2016/04/25 by Lina.Halper
Fix when not re-validating the correct asset
#jira : UE-29789
#code review: Martin.Wilson
Change 2954810 on 2016/04/25 by mason.seay
Updated map to improve coverage
#jira UE-29618
Change 2954785 on 2016/04/25 by Max.Chen
Sequencer: Always spawn sequencer spawnables. Disregard collision settings.
#jira UE-29825
Change 2954781 on 2016/04/25 by mason.seay
Test map for Audio Occlusion trace channels
#jira UE-29618
Change 2954684 on 2016/04/25 by Marc.Audy
Add GetIsReplicated accessor to AActor
Deprecate specific GameplayAbility class implementations that was exposing bReplicates
#jira UE-29897
Change 2954675 on 2016/04/25 by Alexis.Matte
#jira UE-25430
Light Intensity value in FBX is a ratio. So I just multiply the default intensity value by the ratio to have something closer to the look in the DCCs
Change 2954669 on 2016/04/25 by Alexis.Matte
#jira UE-29507
Import of rigid mesh animation is broken
Change 2954579 on 2016/04/25 by Ben.Marsh
Temporarily stop the PS4Media plugin being enabled by default, so the UE4Game built for the binary release doesn't depend on it. Will implement whitelist/blacklist for platforms later.
#jira UE-29842
Change 2954556 on 2016/04/25 by Taizyd.Korambayil
#jira UE-29877 Setup ThirdPersonCharacter based on correct Code Class
Change 2954552 on 2016/04/25 by Taizyd.Korambayil
#jira UE-29877 Deleting BP class
Change 2954498 on 2016/04/25 by Ryan.Gerleve
Fix for remote player controllers reporting that they're actually local player controllers after a seamless travel on the server.
Transition actors to the new level in a second pass after non-transitioning actors are handled.
#jira UE-29213
Change 2954446 on 2016/04/25 by Max.Chen
Sequencer: Fixed spawning actors with instance or multiple owned components
- Also fixed issue where recorded actors were sometimes set as transient, meaning they didn't get saved
#jira UE-29774, UE-29859
Change 2954430 on 2016/04/25 by Marc.Audy
Don't schedule a tick function with a tick interval that was disabled while it was pending rescheduling
#jira UE-29118
#jira UE-29747
Change 2954292 on 2016/04/25 by Richard.TalbotWatkin
Replicated from //UE4/Dev-Editor CL 2946363 (by Frank.Fella)
CurveEditorViewportClient - Bounds check when box selecting. Prevents crashing when the box is outside the viewport.
#jira UE-29265 - Crash when drag selecting curve keys in matinee
Change 2954262 on 2016/04/25 by Graeme.Thornton
Fixed a editor crash when destroying linkers half way through a package EndLoad
#jira UE-29437
Change 2954239 on 2016/04/25 by Marc.Audy
Fix error message
#jira UE-00000
Change 2954177 on 2016/04/25 by Dmitriy.Dyomin
Fixed: Hidden surface removal is not enabled on PowerVR Android devices
#jira UE-29871
Change 2954026 on 2016/04/24 by Josh.Adams
[Somehow most files got unchecked in my previous checkin, grr]
- ProtoStar content/config updates (enabled TAA in the levels, disabled es2 shaders, hides the Unbuilt lighting warning on Android)
#lockdown nick.penwarden
#jira UE-29863
Change 2954025 on 2016/04/24 by Josh.Adams
- ProtoStar content/config updates (enabled TAA in the levels, disabled es2 shaders, hides the Unbuilt lighting warning on Android)
#lockdown nick.penwarden
#jira UE-29863
Change 2953946 on 2016/04/24 by Max.Chen
Sequencer: Fix crash on undo of a sub section.
#jira UE-29856
Change 2953898 on 2016/04/23 by mitchell.wilson
#jira UE-29618 Adding subscene_001 sequence for nonlinear workflow testing
Change 2953859 on 2016/04/23 by Maciej.Mroz
Merged from Dev-Blueprints 2953858
#jira UE-29790 Editor crashes when opening KiteDemo
Change 2953764 on 2016/04/23 by Max.Chen
Sequencer: Remove "Experimental" tag on the Level Sequence Actor
#jira UETOOl-625
Change 2953763 on 2016/04/23 by Max.Chen
Cinematics: Change text to "Edit Existing Cinematics"
#jira UE-29102
Change 2953762 on 2016/04/23 by Max.Chen
Sequencer: Follow up time slider hit testing fix. Don't hit test the selection range if it's empty. This was causing false positives when hovering close to the ranges.
#jira UE-29658
Change 2953652 on 2016/04/22 by Rolando.Caloca
UE4.12 - vk - Workaround driver bugs wrt texture format caps
#jira UE-28140
Change 2953596 on 2016/04/22 by Marcus.Wassmer
#jira UE-20276
Merging dual normal clearcoat shading model.
2863683
2871229
2876362
2876573
2884007
2901595
Change 2953594 on 2016/04/22 by Chris.Babcock
Disable crash handler for VulkanRHI on Android to prevent sig11 on loading driver
#jira UE-29851
#ue4
#android
Change 2953520 on 2016/04/22 by Rolando.Caloca
UE4.12 - vk - Enable deferred resource deletion
- Added one resource heap per memory type
- Improved DumpMemory()
- Added ensures for missing format features
#jira UE-28140
Change 2953459 on 2016/04/22 by Taizyd.Korambayil
#jira UE-29748 Resaved Maps to Fix EC Build Warnings
#jira UE-29744
Change 2953448 on 2016/04/22 by Ryan.Gerleve
Fix Mac/Linux compile.
#jira UE-29545
Change 2953311 on 2016/04/22 by Ryan.Gerleve
Fix for infinite hang when loading a replay from within an actor tick while demo.AsyncLoadWorld is false. LoadMap for the replay is now deferred using the existing PendingNetGame mechanism.
Added virtual UPendingNetGame::LoadMapCompleted function so that the base PendingNetGame and DemoPendingNetGame can have different behavior.
To keep things simpler, also parse all replay metadata and streaming levels after the LoadMap call.
#jira UE-29545
Change 2953219 on 2016/04/22 by mason.seay
Test map for show collision features
#jira UE-29618
Change 2953199 on 2016/04/22 by Phillip.Kavan
[UE-29449] Fix InitProperties() optimization for Blueprint class instances when array property values differ in size.
change summary:
- improved UBlueprintGeneratedClass::BuildCustomArrayPropertyListForPostConstruction() by continuing to emit only delta entries for array values that exceed the default array value's size; previously we emitted a NULL in this case to signal a need to initialize all remaining array values in InitProperties(), even if they didn't differ from the default value of the inner property (which in most cases would already have been set at construction time, and thus potentially incurred a redundant copy iteration for each entry)
- modified FObjectInitializer::InitArrayPropertyFromCustomList() to no longer reset the array value on the instance prior to initialization
- added code to properly resize the array on the instance prior to initialization (if it differs in size from the default array value)
- removed code that handled a NULL property value in the custom property list stream (this is no longer necessary, see above)
- modified FObjectInitializer::InitProperties() to restore the post-construction optimization for Blueprint class instances (back to being enabled by default)
#jira UE-29449
Change 2953195 on 2016/04/22 by Max.Chen
Sequencer: Fix crash in actor reference track in the cached guid to actor map.
#jira UE-27523
Change 2953124 on 2016/04/22 by Rolando.Caloca
UE4.12 - vk - Increase temp frame buffer
#jira UE-28140
Change 2953121 on 2016/04/22 by Chris.Babcock
Rebuilt lighting for all levels
#jira UE-29809
Change 2953073 on 2016/04/22 by mason.seay
Test assets for notifies in animation composites and montages
#jira UE-29618
Change 2952960 on 2016/04/22 by Richard.TalbotWatkin
Changed eye dropper operation so that LMB click selects a color, and pressing Esc cancels the selection and restores the old color.
#jira UE-28410 - Eye dropper selects color without clicking
Change 2952934 on 2016/04/22 by Allan.Bentham
Ensure pool's refractive index >= 1
#jira UE-29777
Change 2952881 on 2016/04/22 by Jamie.Dale
Better fix for UE-28560 that doesn't regress thumbnail rendering
We now just silence the warning if dealing with an inactive world.
#jira UE-28560
Change 2952867 on 2016/04/22 by Thomas.Sarkanen
Fix issues with matinee-controlled anim instances
Regression caused by us no longer saving off the anim sequence between updates.
#jira UE-29812 - Protostar Neutrino spawns but does not Animate or move.
Change 2952826 on 2016/04/22 by Maciej.Mroz
Merged from Dev-Blueprints 2952820
#jira UE-28895 Nativizing a blueprint project causes the next non-nativizing package attempt to fail
Change 2952819 on 2016/04/22 by Josh.Adams
- Fixed crash in a Vulkan shader printout
#lockdown nick.penwarden
#jira UE-29820
Change 2952817 on 2016/04/22 by Rolando.Caloca
UE4.12 - vk - Revert back to simple layouts
#jira UE-28140
Change 2952792 on 2016/04/22 by Jamie.Dale
Removed some code that caused worlds loaded by the Content Browser to be initialized before they were ready
Supposedly this code existed for world thumbnail rendering, however only the active editor world generates a thumbnail, so initializing other worlds wasn't having any effect and thumbnails look identical to before.
#jira UE-28560
Change 2952783 on 2016/04/22 by Taizyd.Korambayil
#jira UE-28477 Resaved Flying Template Map
Change 2952767 on 2016/04/22 by Taizyd.Korambayil
#jira UE-29736 Resaved Map to Fix EC Warnings
Change 2952762 on 2016/04/22 by Allan.Bentham
Update reflection capture to contain only room5 content.
#jira UE-29777
Change 2952749 on 2016/04/22 by Taizyd.Korambayil
#jira UE-29740 Resaved Material and Map to Fix Empty Engine Version Error
Change 2952688 on 2016/04/22 by Martin.Wilson
Fix for BP notifies not displaying when they derive from an abstract base class
#jira UE-28556
Change 2952685 on 2016/04/22 by Thomas.Sarkanen
Fix CIS for non-editor builds
#jira UE-29308 - Fix crash from GC-ed animation asset
Change 2952664 on 2016/04/22 by Thomas.Sarkanen
Made up/down behaviour for console history consistent and reverted to old ordering by default
Pressing up or down now brings up history.
Sorting can now be optionally bottom-to-top or top-to-bottom. Default behaviour is preserved to what it was before the recent changes.
#jira UE-29595 - Console autocomplete behavior is non-intuitive / frustrating
Change 2952655 on 2016/04/22 by Jamie.Dale
Changed the class filter to use an expression evaluator
This makes it consistent with the other filters in the editor
#jira UE-29811
Change 2952647 on 2016/04/22 by Allan.Bentham
Back out changelist 2951539
#jira UE-29777
Change 2952618 on 2016/04/22 by Benn.Gallagher
Fixed naming error in rotation multiplier node
#jira UE-29583
Change 2952612 on 2016/04/22 by Thomas.Sarkanen
Fix garbage collection and undo/redo issues with anim instance proxy
UObject-based properties are now cached each update on the proxy and nulled-out outside of evaluate/update phases.
Moved some initialization code for CurrentAsset/CurrentVertexAnim from the proxy back to the instance (as its is encapsulated there now).
#jira UE-29308 - Fix crash from GC-ed animation asset
Change 2952608 on 2016/04/22 by Richard.TalbotWatkin
Changed 'Recently Used Levels' and 'Favorite Levels' to hold long package names instead of absolute paths. This means they are now project-relative and will remain valid even if the project location changes.
#jira UE-29731 - Editor map recent files are not project relative, leading to missing links when moving projects.
Change 2952599 on 2016/04/22 by Dmitriy.Dyomin
Disabled vulkan pipeline cache as it causes rendering artifacts right now
#jira UE-29807
Change 2952540 on 2016/04/22 by Maciej.Mroz
#jira UE-29787 Obsolete nativized files are never removed
merged from Dev-Blueprints 2952531
Change 2952372 on 2016/04/21 by Josh.Adams
- Fixed Vk memory allocations when reusing free pages
#lockdown nick.penwarden
#jira ue-29802
Change 2952350 on 2016/04/21 by Eric.Newman
Added support for UEReleaseTesting backends to Orion and Ocean
#jira op-3640
Change 2952140 on 2016/04/21 by Dan.Oconnor
Demoted back to warning to fix regressions in content examples, in main we've added the ability to elevate warnings to errors, but no reason to rush that feature into 4.12
#jira UE-28971
Change 2952135 on 2016/04/21 by Jeff.Farris
Fixed issue in PlayerCameraManager where the priority-based sorting of CameraModifiers wasn't sorting properly.
Manual re-implementation of CL 2948123 in 4.12 branch.
#jira UE-29634
Change 2952121 on 2016/04/21 by Lee.Clark
PS4 - 4.12 - Fix staging and deploying of system prxs
#jira UE-29801
Change 2952120 on 2016/04/21 by Rolando.Caloca
UE4.12 - vk - Move descriptor allocation to BSS
#jira UE-21840
Change 2952027 on 2016/04/21 by Rolando.Caloca
UE4.12 - vk - Fix descriptor sets lifetimes
- Fix crash with null texture
#jira UE-28140
Change 2951890 on 2016/04/21 by Eric.Newman
Updating locked common dependencies for OrionService
#jira OP-3640
Change 2951863 on 2016/04/21 by Eric.Newman
Updating locked dependencies for UE 4.12 OrionService
#jira OP-3640
Change 2951852 on 2016/04/21 by Owen.Stupka
Fixed meteors destruct location
#jira UE-29714
Change 2951739 on 2016/04/21 by Max.Chen
Sequencer: Follow up for integral keys.
#jira UE-29791
Change 2951717 on 2016/04/21 by Rolando.Caloca
UE4.12 - Fix shader platform names
#jira UE-28140
Change 2951714 on 2016/04/21 by Max.Chen
Sequencer: Fix setting a key if it already exists at the current time.
#jira UE-29791
Change 2951708 on 2016/04/21 by Rolando.Caloca
UE4.12 - vk - Separate upload cmd buffer
#jira UE-28140
Change 2951653 on 2016/04/21 by Marc.Audy
If a child actor component is destroyed during garbage collection, do not rename, instead clear the caching mechanisms so that a new name is chosen if a new child is created in the future
Remove now unused bRenameRequired parameter
#jira UE-29612
Change 2951619 on 2016/04/21 by Chris.Babcock
Move bCreateRenderStateForHiddenComponents out of WITH_EDITOR
#jira UE-29786
#ue4
Change 2951603 on 2016/04/21 by Cody.Albert
#jira UE-29785
Revert Github readme page back to original
Change 2951599 on 2016/04/21 by Ryan.Gerleve
Fix assert when attempting to record a replay when the map has a placed actor that writes replay external data (such as ACharacter)
#jira UE-29778
Change 2951558 on 2016/04/21 by Chris.Babcock
Always rename destroyed child actor
#jira UE-29709
#ue4
Change 2951552 on 2016/04/21 by James.Golding
Remove old code for handling 'show collision' in game, uses same method as editor now, fixes hidden meshes showing up in game when doing 'show collision'
#jira UE-29303
Change 2951539 on 2016/04/21 by Allan.Bentham
Use screenuv for distortion with ES2/31.
#jira UE-29777
Change 2951535 on 2016/04/21 by Max.Chen
We need to test if the hmd is enabled if it exists. Otherwise, this will return true even if we aren't rendering in stereo if there's an hmd plugin loaded.
#jira UE-29711
Change 2951521 on 2016/04/21 by Taizyd.Korambayil
#jira UE-29746 Replaced Deprecated Time Handler node in GameLevel_GM
Change 2951492 on 2016/04/21 by Jeremiah.Waldron
Fix for Android IAP information reporting back incorrectly.
#jira UE-29776
Change 2951486 on 2016/04/21 by Taizyd.Korambayil
#jira UE-29741 Updated Infiltrator Demo Project to open with the correct Map
Change 2951450 on 2016/04/21 by Gareth.Martin
Fix non-editor build
#jira UE-16525
Change 2951380 on 2016/04/21 by Gareth.Martin
Fix Landscape layer blend nodes not updating connections correctly when an input is changed from weight/alpha (one input) to height blend (two inputs) or vice-versa
#jira UE-16525
Change 2951357 on 2016/04/21 by Richard.TalbotWatkin
Fixed a crash when pushing a new menu leads to a window activation change which would result in the old root menu being dismissed.
#jira UE-27981 - [CrashReport] Crash When Attempting to Select Variable Type After Clearing the Name Field
Change 2951352 on 2016/04/21 by Richard.TalbotWatkin
Added slider bar thickness as a new property in FSliderStyle.
#jira UE-19173 - SSlider is not fully stylable
Change 2951344 on 2016/04/21 by Gareth.Martin
Fix bounds calculation for landscape splines that was causing the first landscape spline point to be invisible and later points to flicker.
- Also fixes landscape spline lines not showing up on a flat landscape
#jira UE-25114
Change 2951326 on 2016/04/21 by Taizyd.Korambayil
#jira UE-28477 Resaving Maps
Change 2951271 on 2016/04/21 by Jamie.Dale
Fixed a crash when pasting a path containing a class into the asset view of the Content Browser
#jira UE-29616
Change 2951237 on 2016/04/21 by Jack.Porter
Fix black screen on PC due to planar reflections
#jira UE-29664
Change 2951184 on 2016/04/21 by Jamie.Dale
Fixed crash in FCurveStructCustomization when no objects were selected for editing
#jira UE-29638
Change 2951177 on 2016/04/21 by Ben.Marsh
Fix hot reload from IDE failing when project is up to date. UBT returns an exit code of 2, and any non-zero exit code is treated as an error by Visual Studio. Build.bat was not correctly forwarding on the exit code at all prior to CL 2790858.
#jira UE-29757
Change 2951171 on 2016/04/21 by Matthew.Griffin
Fixed issue with Rebuild not working when installed in Program Files (x86)
The brackets seem to cause lots of problems in combination with the if/else ones
#jira UE-29648
Change 2951163 on 2016/04/21 by Jamie.Dale
Changed the text customization to use the property handle functions to get/set the text value
That ensures that it both transacts and notifies correctly.
Added new functions to deal with multiple objects selection efficiently with the existing IEditableTextProperty API:
- FPropertyHandleBase::SetPerObjectValue
- FPropertyHandleBase::GetPerObjectValue
- FPropertyHandleBase::GetNumPerObjectValues
These replace the need to cache the raw pointers.
#jira UE-20223
Change 2951103 on 2016/04/21 by Thomas.Sarkanen
Un-deprecated blueprint functions for attachment/detachment
Renamed functions to <FuncName> (Deprecated).
Hid functions in the BP context menu so new ones cant be added.
#jira UE-23216 - "Snap to Target, Keep World Scale" when attaching doesn't work properly if parent is scaled.
Change 2951101 on 2016/04/21 by Allan.Bentham
Enable mobile HQ DoF
#jira UE-29765
Change 2951097 on 2016/04/21 by Thomas.Sarkanen
Standalone games now benefit from parallel anim update if possible
We now simply use the fact we want root motion to determine if we need to run immediately.
#jira UE-29431 - Parallel anim update does not work in non-multiplayer games
Change 2951036 on 2016/04/21 by Lee.Clark
PS4 - Fix WinDualShock working with VS2015
#jira UE-29088
Change 2951034 on 2016/04/21 by Jack.Porter
ProtoStar: Removed content not needed by remaining maps, resaved all content to fix version 0 issues
#jira UE-29666
Change 2950995 on 2016/04/21 by Jack.Porter
ProtoStar - delete unneeded maps
#jira UE-29665
Change 2950787 on 2016/04/20 by Nick.Darnell
SuperSearch - Moving the settings object into a seperate plugin to avoid there needing to be a circular dependency between SuperSearch and UnrealEd.
#jira UE-29749
#codeview Ben.Marsh
Change 2950786 on 2016/04/20 by Nick.Darnell
Back out changelist 2950769 - Going to re-enable super search - about to move the settings into a plugin to prevent the circular reference.
#jira UE-29749
Change 2950769 on 2016/04/20 by Ben.Marsh
Comment out editor integration for super search to fix problems with the circular dependencies breaking hot reload and compiling QAGame in binary release.
Change 2950724 on 2016/04/20 by Lina.Halper
Support for negative scaling for mirroring
- Merging CL 2950718 using //UE4/Dev-Framework_to_//UE4/Release-4.12
#jira: UE-27453
Change 2950293 on 2016/04/20 by andrew.porter
Correcting sequencer test content
#jira UE-29618
Change 2950283 on 2016/04/20 by Marc.Audy
Don't route FlushPressedKeys on PIE shut down
#jira UE-28734
Change 2950071 on 2016/04/20 by mason.seay
Adjusted translation retargeting on head bone of UE4_Mannequin
-Needed for anim bp test. Tested animations and did not see any fallout from change. If there is, it can be reverted.
#jira UE-29618
Change 2950049 on 2016/04/20 by Mark.Satterthwaite
Undo CL #2949690 and instead on Mac where we want to be able to capture videos of gameplay we just insert an intermediate texture as the back-buffer and use a manual blit to the drawable prior to present. This also changes the code to enforce that the back-buffer render-target should never be nil as the code & Metal API itself assumes that this situation cannot occur but it would appear from continued crashes inside PrepareToDraw that it actually can in the field. This will address another potential cause of UE-29006.
#jira UE-29006
#jira UE-29140
Change 2949977 on 2016/04/20 by Max.Chen
Sequencer: Add FieldOfView to default tracks for CameraActor. Add FieldOfView to exclusion list for CineCameraActor.
#jira UE-29660
Change 2949836 on 2016/04/20 by Gareth.Martin
Fix landscape components flickering when perfectly flat (bounds size is 0)
- This often happens for newly created landscapes
#jira UE-29262
Change 2949768 on 2016/04/20 by Thomas.Sarkanen
Moving parent & grouped child actors now does not result in deltas being applied twice
Grouping and attachment now interact correctly.
Also fixed up according to coding standard.
Discovered and proposed by David.Bliss2 (Rocksteady).
#jira UE-29233 - Delta applied twice when moving parent and grouped child actors
From UDN: https://udn.unrealengine.com/questions/286537/moving-parent-grouped-child-actors-results-in-delt.html
Change 2949759 on 2016/04/20 by Thomas.Sarkanen
Fix split pins not working as anim graph node inputs
Limit surface area of this change by only modifying the anim BP compiler. A better version might be to move the call in the general blueprint compiler but it is riskier.
#jira UE-12326 - Splitting a struct in an Anim Blueprint does not work
Change 2949739 on 2016/04/20 by Thomas.Sarkanen
Fix layered bone per blend accessed from a struct in the fast-path
Made sure that the fallback event is always built (logic was still split so if PatchFunctionNamesAndCopyRecordsInto aborted because of some unhandled case if might not have an event to call).
Covered struct source->array dest case.
Indicator icon is now built from the copy record itself, ensuring it is accurate to actual runtime data.
#jira UE-29389 - Fast-Path: Layered Blend per Bone node failing to grab updated values from struct.
Change 2949715 on 2016/04/20 by Max.Chen
Sequencer: Fix mouse wheel zoom so it defaults to zooming in on the current time/frame. This is a toggleable option in the Editor Preferences (Zoom Position = Current Time or Mouse Position)
#jira UE-29661
Change 2949712 on 2016/04/20 by Taizyd.Korambayil
#jira UE-28544 adjusted Player crosshair to be centered
Change 2949710 on 2016/04/20 by Alexis.Matte
#jira UE-29477
Pixel Inspector, UI get polish and adding "scene color" inspect property
Change 2949706 on 2016/04/20 by Alexis.Matte
#jira UE-29475
#jira UE-29476
Favorite allow all UProperty to be favorite (the FStruct is now supported)
Favorite scrollig is auto adjust to avoid scrolling when adding/removing a favorite
Change 2949691 on 2016/04/20 by Mark.Satterthwaite
Fix typo from previous commit - retain not release...
#jira UE-29140
Change 2949690 on 2016/04/20 by Mark.Satterthwaite
Double-buffer the Metal viewport's back-buffer so that we can access the contents of the back-buffer after EndDrawingViewport is called until BeginDrawingViewport is called again on this viewport, this makes it possible to capture movies on Metal.
#jira UE-29140
Change 2949616 on 2016/04/20 by Marc.Audy
'Merge' latest version of Vulkan from Dev-Rendering to Release-4.12
#jira UE-00000
Change 2949572 on 2016/04/20 by Jamie.Dale
Fixed crash undoing a text property changed caused by a null entry in the array
#jira UE-20223
Change 2949562 on 2016/04/20 by Alexis.Matte
#jira UE-29447
Fix the batch fbx import "not show options" dialog where some option can be different.
Change 2949560 on 2016/04/20 by Alexis.Matte
#jira UE-28898
Avoid importing multiple static mesh in the same package
Change 2949547 on 2016/04/20 by Mark.Satterthwaite
You must use STENCIL_COMPONENT_SWIZZLE to access the stencil component of a texture - not all APIs can swizzle it into .g automatically.
#jira UE-29672
Change 2949443 on 2016/04/20 by Allan.Bentham
Disable sRGB textures when ES31 feature level is set.
Only use vk's sRGB formats when feature level > ES3_1
#jira UE-29623
Change 2949428 on 2016/04/20 by Allan.Bentham
Back out changelist 2949405
#jira UE-29623
Change 2949405 on 2016/04/20 by Allan.Bentham
Disable sRGB textures when ES31 feature level is set.
Only use vk's sRGB formats when feature level > ES3_1
#jira UE-29623
Merging using Dev-Mobile_->_Release-4.12
Change 2949391 on 2016/04/20 by Richard.TalbotWatkin
PIE with multiple windows now starts focused on Client 1, or the server if not a dedicated server. Added a new virtual call UEditorEngine::OnLoginPIEAllComplete, called when all clients have been successfully logged in when starting PIE. The default behavior is to set focus to the first client.
#jira UE-26037 - Cumbersome workflow when running PIE with 2 clients
#jira UE-26905 - First client window does not gain focus or mouse control when launching two clients
Change 2949389 on 2016/04/20 by Richard.TalbotWatkin
Fixed regression which was saving the viewport config settings incorrectly. Viewports are keyed by their layout on the same key as the config key, hence we do not need to prepend the SpecificLayoutString when saving out the config data when iterating through a layout's viewports.
#jira UE-29058 - Viewport settings are not saved after shutting down editor
Change 2949388 on 2016/04/20 by Richard.TalbotWatkin
Change auto-reimport settings so that "Detect Changes on Startup" defaults to true. Also removed the warning of potential unwanted behaviour when working in conjunction with source control; this is no longer necessary now that there is a prompt prior to auto-reimport.
#jira UE-29257 - Auto import does not import assets
Change 2949203 on 2016/04/19 by Max.Chen
Sequencer: Fix spawnables not getting default tracks.
#jira UE-29644
Change 2949202 on 2016/04/19 by Max.Chen
Sequencer: Fix particles not firing on loop.
#jira UE-27881
Change 2949201 on 2016/04/19 by Max.Chen
Sequencer: Fix multiple labels support
#jira UE-26812
Change 2949200 on 2016/04/19 by Max.Chen
Sequencer: Expose settings sequencer settings in the Editor Preferences page. Note, UMG and Niagara have separate sequencer settings pages.
#jira UE-29516
Change 2949197 on 2016/04/19 by Max.Chen
Sequencer: Fix unwind rotation when keying rotation so that rotations are always set to the nearest.
#jira UE-22228
Change 2949196 on 2016/04/19 by Max.Chen
Sequencer: Disable selection range drawing if it's empty so that playback range dragging can take precedence when they overlap. This fixes a bug where you can't drag the starting playback range when sequencer starts up.
#jira UE-29657
Change 2949195 on 2016/04/19 by Max.Chen
MovieSceneCapture: Default image compression quality to 100 (rather than 75).
#jira UE-29657
Change 2949194 on 2016/04/19 by Max.Chen
Sequencer: Matinee to Level Sequence fix for mapping properties correctly. This fixes focus distance not getting set properly on the conversion.
#jira UETOOL-467
Change 2949193 on 2016/04/19 by Max.Chen
Sequencer - Fix issues with level visibility.
+ Don't mark sub-levels as dirty when the track evaluates.
+ Fix an issue where sequencer gets into a refresh loop because drawing thumbnails causes levels to be added which was rebuilding the tree, which was redrawing thumbnails.
+ Null check for when an objects world is null but the track is still evaluating.
+ Remove UnrealEd references.
#jira UE-25668
Change 2948990 on 2016/04/19 by Aaron.McLeran
#jira UE-29654 FadeIn invalidates Audio Components in 4.11
Change 2948890 on 2016/04/19 by Jamie.Dale
Downgraded an assert in SPathView::LoadSettings to avoid a common crash when a saved path no longer exists
#jira UE-28858
Change 2948860 on 2016/04/19 by Mike.Beach
Mirroring CL 2940334 (from Dev-Blueprints):
Bettering CreateEvent node errors, so users are able to recover from API changes (not clearing the function name field, calling out the function by name in the error, etc.)
#jira UE-28911
Change 2948857 on 2016/04/19 by Jamie.Dale
Added an Asset Localization context menu to the Content Browser
This allows you to create, edit, and view localized assets from any source asset, as well as edit and view source assets from any localized asset.
#jira UE-29493
Change 2948854 on 2016/04/19 by Jamie.Dale
UAT now stages all project translation targets
#jira UE-20248
Change 2948831 on 2016/04/19 by Mike.Beach
Mirroring CL 2945994 (from Dev-Blueprints):
Pasting EdGraphNodes will no longer query sub-nodes for compatibility if the root cannot be pasted (for things like collapsed graphs, and anim state-machine nodes).
#jira UE-29035
Change 2948825 on 2016/04/19 by Jamie.Dale
Fixed shadow warning
#jira UE-29212
Change 2948812 on 2016/04/19 by Marc.Audy
Gracefully handle failure to load configurable engine classes
#jira UE-26527
Change 2948791 on 2016/04/19 by Jamie.Dale
Fixed regression in SEditableText bIsCaretMovedWhenGainFocus when using auto-complete
Fixed regression in FSlateEditableTextLayout::SetText that caused it to call OnTextChanged when nothing had changed
#jira UE-29494
#jira UE-28886
Change 2948761 on 2016/04/19 by Jamie.Dale
Sub-fonts are now only used when they contain the character to be rendered
#jira UE-29212
Change 2948718 on 2016/04/19 by Jamie.Dale
Fixed an issue where FEnginePackageLocalizationCache could be initialized before CoreUObject was ready
This is now done lazily, either when the first CDO tries to load an asset (which is after CoreUObject is ready), or after the first call to ProcessNewlyLoadedUObjects (if no CDO loads an asset).
#jira UE-29649
Change 2948717 on 2016/04/19 by Jamie.Dale
Removed the AssetRegistry's dependency on MessageLog
It was only there to add a category that was only ever used by the AssetTools module.
#jira UE-29649
Change 2948683 on 2016/04/19 by Phillip.Kavan
[UE-18419] Fix GetClassDefaults nodes to update properly in response to structural BP class changes.
change summary:
- modified UK2Node_GetClassDefaults::CreateOutputPins() to bind/unbind delegate handlers for the OnChanged() & OnCompile() events for BP class types.
#jira UE-18419
Change 2948681 on 2016/04/19 by Phillip.Kavan
[UE-17794] The "Delete Unused Variable" feature now considers the GetClassDefaults node as well.
change summary:
- added external linkage to UK2Node_GetClassDefaults::FindClassPin().
- added an include for the K2Node_GetClassDefaults header file to BlueprintGraphDefinitions.h.
- added UK2Node_GetClassDefaults::GetInputClass() as a public API w/ external linkage; moved default 'nullptr' param logic into this impl.
- modified FBlueprintEditorUtils::IsVariableUsed() to add an extra check for a GetClassDefaults node with a visible output pin for the variable that's also connected.
- modified UK2Node_GetClassDefaults::GetInputClass() to return the generated skeleton class for Blueprint class types.
#jira UE-17794
Change 2948638 on 2016/04/19 by Lee.Clark
PS4 - Fix SDK compile warnings
#jira UE-29647
Change 2948401 on 2016/04/19 by Taizyd.Korambayil
#jira UE-29250 Revuilt Lighting for Landscapes Map
Change 2948398 on 2016/04/19 by Mark.Satterthwaite
Add a Mac Metal ES2 shader platform to allow the various ES2 emulation modes to work in the Editor. Fix various issues with the shader code to ensure that Metal can run with ES2 shader code at least in my limited test cases in QAGame.
#jira UE-29170
Change 2948366 on 2016/04/19 by Taizyd.Korambayil
#jira UE-29109 Replaced Box Mesh with BSP Floor
Change 2948360 on 2016/04/19 by Maciej.Mroz
merged from Dev-Blueprints 2947488
#jira UE-29115 Nativized BulletTrain - cannot shoot targets in intro tutorial
#jira UE-28965 Packaging Project with Nativize Blueprint Assets Prevents Overlap Events from Firing
#jira UE-29559
- fixed private enum access
- fixed private bitfield access
- removed forced PostLoad
- add BodyInstance.FixupData call to fix ResponseChannels
- ignored RelativeLocation and RelativeRotation in converted root component
- fixed AttachToComponent (UE-29559)
Change 2948358 on 2016/04/19 by Maciej.Mroz
merged from Dev-Blueprints 2947953
#jira UE-29605 Wrong bullet trails in nativized ShowUp
Fixed USimpleConstructionScript::GetSceneRootComponentTemplate.
Change 2948357 on 2016/04/19 by Maciej.Mroz
merged from Dev-Blueprints 2947984
#jira UE-29374 Crash when hovering over Create Widget node in blueprints
Safe UK2Node_ConstructObjectFromClass::GetPinHoverText.
Change 2948353 on 2016/04/19 by Maciej.Mroz
merged from Dev-Blueprints 2948095
#jira UE-29246 ExpandEnumAsExecs + UMETA(Hidden) Crashes Blueprint Compile
"Hidden" and "Spacer" elementa from an enum does not generated exec pins for "ExpandEnumAsExecs"
Change 2948332 on 2016/04/19 by Benn.Gallagher
Fixed old pins being left as non-transactional
#jira UE-13801
Change 2948203 on 2016/04/19 by Lee.Clark
PS4 - Use SDK 3.508.031
#jira UEPLAT-1225
Change 2948168 on 2016/04/19 by mason.seay
Updating test content:
-Added Husk AI to level to test placed AI
-Updated Spawn Husk BP to destroy itself to prevent spawn spamming
#jira UE-29618
Change 2948153 on 2016/04/19 by Benn.Gallagher
Missed mesh update for Owen IK fix.
#jira UE-22540
Change 2948130 on 2016/04/19 by Benn.Gallagher
Fixed old Owen punch IK setup so it no longer jitters when placing the hands on the surface.
#jira UE-22540
Change 2948117 on 2016/04/19 by Taizyd.Korambayil
#jira UE-28477 Resaved Template Map's to fix Warning Toast on Templates
Change 2948063 on 2016/04/19 by Lina.Halper
- Anim composite notify change for better
- Fixed all nested anim notify
- Merging CL 2944396 using //UE4/Dev-Framework_to_//UE4/Release-4.12
#jira : UE-29101
Change 2948060 on 2016/04/19 by Lina.Halper
Fix for composite section metadata saving for montage
Merging CL 2944397 using //UE4/Dev-Framework_to_//UE4/Release-4.12
#jira : UE-29228
Change 2948029 on 2016/04/19 by Ben.Marsh
EC: Prevent automatically pushing CIS builds to the launcher; the changelist might be run more than once.
Change 2947986 on 2016/04/19 by Benn.Gallagher
Fixed BP callable functions that affect skeletal mesh component transforms not working when simulating physics.
#jira UE-27783
Change 2947976 on 2016/04/19 by Mark.Satterthwaite
Duplicate CL #2943702 from 4.11.2: Change the way Metal validates the render-target state so that in FMetalContext::PrepareToDraw it can issue a last-ditch attempt to restore the render-targets. This won't fix the cause of the Mac Metal crashes but it might mitigate some of them and provide more information about why they are occurring.
#jira UE-29006
Change 2947975 on 2016/04/19 by Mark.Satterthwaite
Duplicate CL #2945061 from UE4-UT: Address UT issue UE-29150 directly in the UT branch: users without a sufficiently up-to-date Xcode won't have the 'metal' offline shader compiler so will have to use the slower online compiled text shader format.
#jira UE-29150
Change 2947679 on 2016/04/19 by Jack.Porter
Fixed 4.12 branch not compiling with the 1.0.8 Vulkan SDK
#jira UE-29601
Change 2947657 on 2016/04/18 by Jack.Porter
Update protostar reflection capture contents
#jira UE-29600
Change 2947301 on 2016/04/18 by Ben.Marsh
EC: Fix trigger ready emails failing to send due to recipient list being a space-separated list of addresses rather than an array reference.
Change 2947263 on 2016/04/18 by Marc.Audy
Merging CL# 2945921 //UE4/Release-4.11 to //UE4/Release-4.12
Ensure that all OwnedComponents in an Actor are duplicated for PIE even if not referenced by a property, unless that component is explicitly transient
#jira UE-29209
Change 2946984 on 2016/04/18 by Ben.Marsh
GUBP: Allow Ocean cooks in the release branch (fixes build startup failures)
Change 2946870 on 2016/04/18 by Ben.Marsh
Remaking CL 2946810 to fix compile error in ShooterGame editor.
Change 2946859 on 2016/04/18 by Ben.Marsh
GUBP: Don't exclude Ocean from builds in the release branch.
Change 2946847 on 2016/04/18 by Ben.Marsh
GUBP: Fix warning on every build step due to OrionGame_Win32_Mono no longer existing.
Change 2946771 on 2016/04/18 by Ben.Marsh
EC: Correct initial agent type for release branches. Causing full branch syncs on all agents.
Change 2946641 on 2016/04/18 by Ben.Marsh
EC: Remove rogue comma causing branch definition parsing to fail.
Change 2946592 on 2016/04/18 by Ben.Marsh
EC: Adding branch definition for 4.12 release
#lockdown Nick.Penwarden
[CL 2962354 by Ben Marsh in Main branch]
2016-05-01 17:37:41 -04:00
bool const bShouldBeHidden = EnumProp - > Enum - > HasMetaData ( TEXT ( " Hidden " ) , ExecIdx ) | | EnumProp - > Enum - > HasMetaData ( TEXT ( " Spacer " ) , ExecIdx ) ;
if ( ! bShouldBeHidden )
{
FString ExecName = EnumProp - > Enum - > GetEnumName ( ExecIdx ) ;
CreatePin ( Direction , K2Schema - > PC_Exec , TEXT ( " " ) , NULL , false , false , ExecName ) ;
}
2014-06-09 11:11:12 -04:00
}
if ( bIsFunctionInput )
{
// If using ExpandEnumAsExec for input, don't want to add a input exec pin
bCreateSingleExecInputPin = false ;
}
else
{
// If using ExpandEnumAsExec for output, don't want to add a "then" pin
bCreateThenPin = false ;
2014-03-14 14:13:41 -04:00
}
}
}
2014-06-09 11:11:12 -04:00
if ( bCreateSingleExecInputPin )
2014-03-14 14:13:41 -04:00
{
// Single input exec pin
CreatePin ( EGPD_Input , K2Schema - > PC_Exec , TEXT ( " " ) , NULL , false , false , K2Schema - > PN_Execute ) ;
}
2014-06-09 11:11:12 -04:00
if ( bCreateThenPin )
2014-03-14 14:13:41 -04:00
{
2014-06-09 11:11:12 -04:00
UEdGraphPin * OutputExecPin = CreatePin ( EGPD_Output , K2Schema - > PC_Exec , TEXT ( " " ) , NULL , false , false , K2Schema - > PN_Then ) ;
2015-06-30 22:12:07 -04:00
// Use 'completed' name for output pins on latent functions
if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_Latent ) )
{
2014-06-09 11:11:12 -04:00
OutputExecPin - > PinFriendlyName = FText : : FromString ( K2Schema - > PN_Completed ) ;
}
2014-03-14 14:13:41 -04:00
}
}
}
void UK2Node_CallFunction : : DetermineWantsEnumToExecExpansion ( const UFunction * Function )
{
bWantsEnumToExecExpansion = false ;
if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_ExpandEnumAsExecs ) )
{
const FString & EnumParamName = Function - > GetMetaData ( FBlueprintMetadata : : MD_ExpandEnumAsExecs ) ;
UByteProperty * EnumProp = FindField < UByteProperty > ( Function , FName ( * EnumParamName ) ) ;
if ( EnumProp ! = NULL & & EnumProp - > Enum ! = NULL )
{
bWantsEnumToExecExpansion = true ;
}
else
{
if ( ! bHasCompilerMessage )
{
//put in warning state
bHasCompilerMessage = true ;
ErrorType = EMessageSeverity : : Warning ;
ErrorMsg = FString : : Printf ( * LOCTEXT ( " EnumToExecExpansionFailed " , " Unable to find enum parameter with name '%s' to expand for @@ " ) . ToString ( ) , * EnumParamName ) ;
}
}
}
}
2014-09-21 20:34:20 -04:00
void UK2Node_CallFunction : : GeneratePinTooltip ( UEdGraphPin & Pin ) const
2014-03-14 14:13:41 -04:00
{
ensure ( Pin . GetOwningNode ( ) = = this ) ;
UEdGraphSchema const * Schema = GetSchema ( ) ;
check ( Schema ! = NULL ) ;
UEdGraphSchema_K2 const * const K2Schema = Cast < const UEdGraphSchema_K2 > ( Schema ) ;
if ( K2Schema = = NULL )
{
2014-09-21 20:34:20 -04:00
Schema - > ConstructBasicPinTooltip ( Pin , FText : : GetEmpty ( ) , Pin . PinToolTip ) ;
2014-03-14 14:13:41 -04:00
return ;
}
// get the class function object associated with this node
UFunction * Function = GetTargetFunction ( ) ;
if ( Function = = NULL )
{
2014-09-21 20:34:20 -04:00
Schema - > ConstructBasicPinTooltip ( Pin , FText : : GetEmpty ( ) , Pin . PinToolTip ) ;
2014-03-14 14:13:41 -04:00
return ;
}
2014-09-21 20:34:32 -04:00
2014-03-14 14:13:41 -04:00
2014-09-21 20:34:20 -04:00
GeneratePinTooltipFromFunction ( Pin , Function ) ;
2014-03-14 14:13:41 -04:00
}
bool UK2Node_CallFunction : : CreatePinsForFunctionCall ( const UFunction * Function )
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
UClass * FunctionOwnerClass = Function - > GetOuterUClass ( ) ;
bIsInterfaceCall = FunctionOwnerClass - > HasAnyClassFlags ( CLASS_Interface ) ;
bIsPureFunc = ( Function - > HasAnyFunctionFlags ( FUNC_BlueprintPure ) ! = false ) ;
bIsConstFunc = ( Function - > HasAnyFunctionFlags ( FUNC_Const ) ! = false ) ;
DetermineWantsEnumToExecExpansion ( Function ) ;
// Create input pins
CreateExecPinsForFunctionCall ( Function ) ;
UEdGraphPin * SelfPin = CreateSelfPin ( Function ) ;
2015-06-30 22:12:07 -04:00
// Renamed self pin to target
SelfPin - > PinFriendlyName = LOCTEXT ( " Target " , " Target " ) ;
2014-03-14 14:13:41 -04:00
const bool bIsProtectedFunc = Function - > GetBoolMetaData ( FBlueprintMetadata : : MD_Protected ) ;
const bool bIsStaticFunc = Function - > HasAllFunctionFlags ( FUNC_Static ) ;
[UE-2345] BP - enforce const-correctness in native const class method overrides
this change introduces enforcement of 'const-correctness' into implemented function graphs.
summary:
if you have a function declared in C++ like this:
UFUNCTION(BlueprintImplementableEvent)
int32 MyFunctionThatReturnsSomeValue() const;
if you implement that (BPIE) function in a Blueprint that's parented to that native class, it will now be flagged as 'const'. this makes any properties of 'self' read-only within the context of that graph, which means the compiler will emit an error if you try to set a property or otherwise call a non-const, non-static function with 'self' as the target.
if there happens to already be an implemented const function in a Blueprint that was in place prior to this change, the compiler will emit a warning instead of an error, in order to allow existing Blueprints that may currently be "violating" const within the context of a const BPIE function to still compile, while still alerting to issues that should probably be addressed.
notes:
1) this also applies to BlueprintNativeEvent (BPNE) implementations, and also when implementing BPIE/BPNE interface methods that are also declared as const
2) a const BPIE/BPNE function with no return value and no output parameters will be implemented as a "normal" impure function, and not as an event as in the non-const case
3) a const BPIE/BPNE function with a return value and/or output parameters will currently be implemented as a pure function, regardless of whether or not BlueprintCallable is specified
4) this CL also retains some consolidation of static function validation code that i had previously done, mostly to allow static functions to more easily be whitelisted for const function graphs
#codereview Nick.Whiting, Michael.Noland
[CL 2368059 by Phillip Kavan in Main branch]
2014-11-21 17:47:17 -05:00
UEdGraph const * const Graph = GetGraph ( ) ;
UBlueprint * BP = FBlueprintEditorUtils : : FindBlueprintForGraph ( Graph ) ;
2014-07-07 10:56:20 -04:00
ensure ( BP ) ;
2014-09-22 21:51:18 -04:00
if ( BP ! = nullptr )
2014-03-14 14:13:41 -04:00
{
2015-03-06 18:05:42 -05:00
const bool bIsFunctionCompatibleWithSelf = BP - > SkeletonGeneratedClass - > IsChildOf ( FunctionOwnerClass ) ;
2014-09-22 21:51:18 -04:00
if ( bIsStaticFunc )
2014-03-14 14:13:41 -04:00
{
2014-09-22 21:51:18 -04:00
// For static methods, wire up the self to the CDO of the class if it's not us
if ( ! bIsFunctionCompatibleWithSelf )
{
2015-07-09 10:25:29 -04:00
UClass * AuthoritativeClass = FunctionOwnerClass - > GetAuthoritativeClass ( ) ;
2014-10-15 14:48:21 -04:00
SelfPin - > DefaultObject = AuthoritativeClass - > GetDefaultObject ( ) ;
2014-09-22 21:51:18 -04:00
}
// Purity doesn't matter with a static function, we can always hide the self pin since we know how to call the method
SelfPin - > bHidden = true ;
}
else
{
2015-07-09 10:25:29 -04:00
if ( Function - > GetBoolMetaData ( FBlueprintMetadata : : MD_HideSelfPin ) )
{
SelfPin - > bHidden = true ;
SelfPin - > bNotConnectable = true ;
}
else
{
// Hide the self pin if the function is compatible with the blueprint class and pure (the !bIsConstFunc portion should be going away soon too hopefully)
SelfPin - > bHidden = ( bIsFunctionCompatibleWithSelf & & bIsPureFunc & & ! bIsConstFunc ) ;
}
2014-03-14 14:13:41 -04:00
}
}
// Build a list of the pins that should be hidden for this function (ones that are automagically filled in by the K2 compiler)
TSet < FString > PinsToHide ;
2015-06-30 14:42:07 -04:00
TSet < FString > InternalPins ;
FBlueprintEditorUtils : : GetHiddenPinsForFunction ( Graph , Function , PinsToHide , & InternalPins ) ;
2014-03-14 14:13:41 -04:00
2014-09-10 15:23:52 -04:00
const bool bShowWorldContextPin = ( ( PinsToHide . Num ( ) > 0 ) & & BP & & BP - > ParentClass & & BP - > ParentClass - > HasMetaData ( FBlueprintMetadata : : MD_ShowWorldContextPin ) ) ;
2014-03-14 14:13:41 -04:00
// Create the inputs and outputs
bool bAllPinsGood = true ;
for ( TFieldIterator < UProperty > PropIt ( Function ) ; PropIt & & ( PropIt - > PropertyFlags & CPF_Parm ) ; + + PropIt )
{
UProperty * Param = * PropIt ;
const bool bIsFunctionInput = ! Param - > HasAnyPropertyFlags ( CPF_ReturnParm ) & & ( ! Param - > HasAnyPropertyFlags ( CPF_OutParm ) | | Param - > HasAnyPropertyFlags ( CPF_ReferenceParm ) ) ;
const bool bIsRefParam = Param - > HasAnyPropertyFlags ( CPF_ReferenceParm ) & & bIsFunctionInput ;
const EEdGraphPinDirection Direction = bIsFunctionInput ? EGPD_Input : EGPD_Output ;
UEdGraphPin * Pin = CreatePin ( Direction , TEXT ( " " ) , TEXT ( " " ) , NULL , false , bIsRefParam , Param - > GetName ( ) ) ;
const bool bPinGood = ( Pin ! = NULL ) & & K2Schema - > ConvertPropertyToPinType ( Param , /*out*/ Pin - > PinType ) ;
if ( bPinGood )
{
2015-07-08 17:03:53 -04:00
// Check for a display name override
const FString PinDisplayName = Param - > GetMetaData ( FBlueprintMetadata : : MD_DisplayName ) ;
if ( ! PinDisplayName . IsEmpty ( ) )
{
Pin - > PinFriendlyName = FText : : FromString ( PinDisplayName ) ;
}
2014-03-14 14:13:41 -04:00
//Flag pin as read only for const reference property
2014-06-16 17:32:31 -04:00
Pin - > bDefaultValueIsIgnored = Param - > HasAllPropertyFlags ( CPF_ConstParm | CPF_ReferenceParm ) & & ( ! Function - > HasMetaData ( FBlueprintMetadata : : MD_AutoCreateRefTerm ) | | Pin - > PinType . bIsArray ) ;
2014-03-14 14:13:41 -04:00
const bool bAdvancedPin = Param - > HasAllPropertyFlags ( CPF_AdvancedDisplay ) ;
Pin - > bAdvancedView = bAdvancedPin ;
if ( bAdvancedPin & & ( ENodeAdvancedPins : : NoPins = = AdvancedPinDisplay ) )
{
AdvancedPinDisplay = ENodeAdvancedPins : : Hidden ;
}
2014-06-16 10:30:41 -04:00
K2Schema - > SetPinDefaultValue ( Pin , Function , Param ) ;
2014-03-14 14:13:41 -04:00
if ( PinsToHide . Contains ( Pin - > PinName ) )
{
FString const DefaultToSelfMetaValue = Function - > GetMetaData ( FBlueprintMetadata : : MD_DefaultToSelf ) ;
FString const WorldContextMetaValue = Function - > GetMetaData ( FBlueprintMetadata : : MD_WorldContext ) ;
bool bIsSelfPin = ( ( Pin - > PinName = = DefaultToSelfMetaValue ) | | ( Pin - > PinName = = WorldContextMetaValue ) ) ;
2014-09-10 15:23:52 -04:00
if ( ! bShowWorldContextPin | | ! bIsSelfPin )
2014-03-14 14:13:41 -04:00
{
Pin - > bHidden = true ;
2015-06-30 14:42:07 -04:00
Pin - > bNotConnectable = InternalPins . Contains ( Pin - > PinName ) ;
2014-03-14 14:13:41 -04:00
}
}
PostParameterPinCreated ( Pin ) ;
}
bAllPinsGood = bAllPinsGood & & bPinGood ;
}
// If we have an 'enum to exec' parameter, set its default value to something valid so we don't get warnings
if ( bWantsEnumToExecExpansion )
{
FString EnumParamName = Function - > GetMetaData ( FBlueprintMetadata : : MD_ExpandEnumAsExecs ) ;
UEdGraphPin * EnumParamPin = FindPin ( EnumParamName ) ;
if ( UEnum * PinEnum = ( EnumParamPin ? Cast < UEnum > ( EnumParamPin - > PinType . PinSubCategoryObject . Get ( ) ) : NULL ) )
{
EnumParamPin - > DefaultValue = PinEnum - > GetEnumName ( 0 ) ;
}
}
return bAllPinsGood ;
}
void UK2Node_CallFunction : : PostReconstructNode ( )
{
Super : : PostReconstructNode ( ) ;
2015-05-27 17:51:08 -04:00
InvalidatePinTooltips ( ) ;
2014-03-14 14:13:41 -04:00
2015-03-14 20:27:46 -04:00
FCustomStructureParamHelper : : UpdateCustomStructurePins ( GetTargetFunction ( ) , this ) ;
2014-03-14 14:13:41 -04:00
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
// Fixup self node, may have been overridden from old self node
UFunction * Function = GetTargetFunction ( ) ;
const bool bIsStaticFunc = Function ? Function - > HasAllFunctionFlags ( FUNC_Static ) : false ;
UEdGraphPin * SelfPin = FindPin ( K2Schema - > PN_Self ) ;
if ( bIsStaticFunc & & SelfPin )
{
// Wire up the self to the CDO of the class if it's not us
if ( UBlueprint * BP = GetBlueprint ( ) )
{
UClass * FunctionOwnerClass = Function - > GetOuterUClass ( ) ;
if ( ! BP - > SkeletonGeneratedClass - > IsChildOf ( FunctionOwnerClass ) )
{
SelfPin - > DefaultObject = FunctionOwnerClass - > GetDefaultObject ( ) ;
}
2015-03-06 18:05:42 -05:00
else
{
// In case a non-NULL reference was previously serialized on load, ensure that it's set to NULL here to match what a new node's self pin would be initialized as (see CreatePinsForFunctionCall).
SelfPin - > DefaultObject = nullptr ;
}
2014-03-14 14:13:41 -04:00
}
}
// Set the return type to the right class of component
UActorComponent * TemplateComp = GetTemplateFromNode ( ) ;
UEdGraphPin * ReturnPin = GetReturnValuePin ( ) ;
if ( TemplateComp & & ReturnPin )
{
ReturnPin - > PinType . PinSubCategoryObject = TemplateComp - > GetClass ( ) ;
}
2014-10-09 12:04:45 -04:00
if ( UEdGraphPin * TypePickerPin = FDynamicOutputHelper : : GetTypePickerPin ( this ) )
{
FDynamicOutputHelper ( TypePickerPin ) . ConformOutputType ( ) ;
}
2015-09-10 11:50:14 -04:00
if ( IsNodePure ( ) )
{
// Remove any pre-existing breakpoint on this node since pure nodes cannot have breakpoints
if ( UBreakpoint * ExistingBreakpoint = FKismetDebugUtilities : : FindBreakpointForNode ( GetBlueprint ( ) , this ) )
{
// Remove the breakpoint
FKismetDebugUtilities : : StartDeletingBreakpoint ( ExistingBreakpoint , GetBlueprint ( ) ) ;
}
}
2014-03-14 14:13:41 -04:00
}
void UK2Node_CallFunction : : 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 - > ComponentTemplates . Remove ( Template ) ;
}
Super : : DestroyNode ( ) ;
}
void UK2Node_CallFunction : : NotifyPinConnectionListChanged ( UEdGraphPin * Pin )
{
Super : : NotifyPinConnectionListChanged ( Pin ) ;
2014-04-23 20:18:55 -04:00
if ( Pin )
{
FCustomStructureParamHelper : : UpdateCustomStructurePins ( GetTargetFunction ( ) , this , Pin ) ;
2015-06-30 14:42:07 -04:00
// Refresh the node to hide internal-only pins once the [invalid] connection has been broken
if ( Pin - > bHidden & & Pin - > bNotConnectable & & Pin - > LinkedTo . Num ( ) = = 0 )
{
GetGraph ( ) - > NotifyGraphChanged ( ) ;
}
2014-04-23 20:18:55 -04:00
}
2014-03-14 14:13:41 -04:00
if ( bIsBeadFunction )
{
if ( Pin - > LinkedTo . Num ( ) = = 0 )
{
// Commit suicide; bead functions must always have an input and output connection
DestroyNode ( ) ;
}
}
2014-10-09 12:04:45 -04:00
2015-05-27 17:51:08 -04:00
InvalidatePinTooltips ( ) ;
2014-10-09 12:04:45 -04:00
FDynamicOutputHelper ( Pin ) . ConformOutputType ( ) ;
}
void UK2Node_CallFunction : : PinDefaultValueChanged ( UEdGraphPin * Pin )
{
Super : : PinDefaultValueChanged ( Pin ) ;
2015-05-27 17:51:08 -04:00
InvalidatePinTooltips ( ) ;
2014-10-09 12:04:45 -04:00
FDynamicOutputHelper ( Pin ) . ConformOutputType ( ) ;
2014-03-14 14:13:41 -04:00
}
UFunction * UK2Node_CallFunction : : GetTargetFunction ( ) const
{
2015-03-12 14:17:48 -04:00
UFunction * Function = FunctionReference . ResolveMember < UFunction > ( GetBlueprintClassFromNode ( ) ) ;
2014-03-14 14:13:41 -04:00
return Function ;
}
2015-02-17 08:53:15 -05:00
UFunction * UK2Node_CallFunction : : GetTargetFunctionFromSkeletonClass ( ) const
{
UFunction * TargetFunction = nullptr ;
2015-03-12 14:17:48 -04:00
UClass * ParentClass = FunctionReference . GetMemberParentClass ( GetBlueprintClassFromNode ( ) ) ;
2015-02-17 08:53:15 -05:00
UBlueprint * OwningBP = ParentClass ? Cast < UBlueprint > ( ParentClass - > ClassGeneratedBy ) : nullptr ;
if ( UClass * SkeletonClass = OwningBP ? OwningBP - > SkeletonGeneratedClass : nullptr )
{
TargetFunction = SkeletonClass - > FindFunctionByName ( FunctionReference . GetMemberName ( ) ) ;
}
return TargetFunction ;
}
2014-03-14 14:13:41 -04:00
UEdGraphPin * UK2Node_CallFunction : : GetThenPin ( ) const
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
UEdGraphPin * Pin = FindPin ( K2Schema - > PN_Then ) ;
check ( Pin = = NULL | | Pin - > Direction = = EGPD_Output ) ; // If pin exists, it must be output
return Pin ;
}
UEdGraphPin * UK2Node_CallFunction : : GetReturnValuePin ( ) const
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
UEdGraphPin * Pin = FindPin ( K2Schema - > PN_ReturnValue ) ;
check ( Pin = = NULL | | Pin - > Direction = = EGPD_Output ) ; // If pin exists, it must be output
return Pin ;
}
bool UK2Node_CallFunction : : IsLatentFunction ( ) const
{
if ( UFunction * Function = GetTargetFunction ( ) )
{
if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_Latent ) )
{
return true ;
}
}
return false ;
}
bool UK2Node_CallFunction : : AllowMultipleSelfs ( bool bInputAsArray ) const
{
if ( UFunction * Function = GetTargetFunction ( ) )
{
2014-08-26 16:25:42 -04:00
return CanFunctionSupportMultipleTargets ( Function ) ;
2014-03-14 14:13:41 -04:00
}
return Super : : AllowMultipleSelfs ( bInputAsArray ) ;
}
2014-08-26 16:25:42 -04:00
bool UK2Node_CallFunction : : CanFunctionSupportMultipleTargets ( UFunction const * Function )
{
bool const bIsImpure = ! Function - > HasAnyFunctionFlags ( FUNC_BlueprintPure ) ;
bool const bIsLatent = Function - > HasMetaData ( FBlueprintMetadata : : MD_Latent ) ;
bool const bHasReturnParam = ( Function - > GetReturnProperty ( ) ! = nullptr ) ;
return ! bHasReturnParam & & bIsImpure & & ! bIsLatent ;
}
2014-10-07 00:54:59 -04:00
bool UK2Node_CallFunction : : CanPasteHere ( const UEdGraph * TargetGraph ) const
{
2014-12-05 17:43:08 -05:00
// Basic check for graph compatibility, etc.
2014-10-07 00:54:59 -04:00
bool bCanPaste = Super : : CanPasteHere ( TargetGraph ) ;
2014-12-05 17:43:08 -05:00
// We check function context for placability only in the base class case; derived classes are typically bound to
// specific functions that should always be placeable, but may not always be explicitly callable (e.g. InternalUseOnly).
if ( bCanPaste & & GetClass ( ) = = StaticClass ( ) )
2014-10-07 00:54:59 -04:00
{
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
uint32 AllowedFunctionTypes = UEdGraphSchema_K2 : : EFunctionType : : FT_Pure | UEdGraphSchema_K2 : : EFunctionType : : FT_Const | UEdGraphSchema_K2 : : EFunctionType : : FT_Protected ;
if ( K2Schema - > DoesGraphSupportImpureFunctions ( TargetGraph ) )
{
AllowedFunctionTypes | = UEdGraphSchema_K2 : : EFunctionType : : FT_Imperative ;
}
2015-02-17 08:53:15 -05:00
UFunction * TargetFunction = GetTargetFunction ( ) ;
if ( ! TargetFunction )
{
TargetFunction = GetTargetFunctionFromSkeletonClass ( ) ;
}
2015-04-16 11:47:54 -04:00
bCanPaste = K2Schema - > CanFunctionBeUsedInGraph ( FBlueprintEditorUtils : : FindBlueprintForGraphChecked ( TargetGraph ) - > GeneratedClass , TargetFunction , TargetGraph , AllowedFunctionTypes , false ) ;
2014-10-07 00:54:59 -04:00
}
return bCanPaste ;
}
2014-12-03 17:05:59 -05:00
bool UK2Node_CallFunction : : IsActionFilteredOut ( FBlueprintActionFilter const & Filter )
{
bool bIsFilteredOut = false ;
for ( UEdGraph * TargetGraph : Filter . Context . Graphs )
{
bIsFilteredOut | = ! CanPasteHere ( TargetGraph ) ;
}
return bIsFilteredOut ;
}
2014-09-12 12:56:24 -04:00
static FLinearColor GetPalletteIconColor ( UFunction const * Function )
2014-03-14 14:13:41 -04:00
{
2014-09-12 12:56:24 -04:00
bool const bIsPure = ( Function ! = nullptr ) & & Function - > HasAnyFunctionFlags ( FUNC_BlueprintPure ) ;
if ( bIsPure )
2014-03-14 14:13:41 -04:00
{
2014-05-20 19:00:53 -04:00
return GetDefault < UGraphEditorSettings > ( ) - > PureFunctionCallNodeTitleColor ;
2014-03-14 14:13:41 -04:00
}
2014-09-12 12:56:24 -04:00
return GetDefault < UGraphEditorSettings > ( ) - > FunctionCallNodeTitleColor ;
}
2014-05-20 19:00:53 -04:00
2014-09-12 12:56:24 -04:00
FName UK2Node_CallFunction : : GetPaletteIconForFunction ( UFunction const * Function , FLinearColor & OutColor )
{
static const FName NativeMakeFunc ( TEXT ( " NativeMakeFunc " ) ) ;
static const FName NativeBrakeFunc ( TEXT ( " NativeBreakFunc " ) ) ;
if ( Function & & Function - > HasMetaData ( NativeMakeFunc ) )
{
return TEXT ( " GraphEditor.MakeStruct_16x " ) ;
}
else if ( Function & & Function - > HasMetaData ( NativeBrakeFunc ) )
{
return TEXT ( " GraphEditor.BreakStruct_16x " ) ;
}
// Check to see if the function is calling an function that could be an event, display the event icon instead.
else if ( Function & & UEdGraphSchema_K2 : : FunctionCanBePlacedAsEvent ( Function ) )
{
return TEXT ( " GraphEditor.Event_16x " ) ;
}
else
{
OutColor = GetPalletteIconColor ( Function ) ;
return TEXT ( " Kismet.AllClasses.FunctionIcon " ) ;
}
}
FLinearColor UK2Node_CallFunction : : GetNodeTitleColor ( ) const
{
return GetPalletteIconColor ( GetTargetFunction ( ) ) ;
2014-09-03 18:17:44 -04:00
}
2014-03-14 14:13:41 -04:00
2014-09-03 18:14:09 -04:00
FText UK2Node_CallFunction : : GetTooltipText ( ) const
2014-03-14 14:13:41 -04:00
{
2014-09-03 18:14:09 -04:00
FText Tooltip ;
2014-03-14 14:13:41 -04:00
2014-09-03 18:17:44 -04:00
UFunction * Function = GetTargetFunction ( ) ;
if ( Function = = nullptr )
2014-03-14 14:13:41 -04:00
{
2014-09-03 18:17:44 -04:00
return FText : : Format ( LOCTEXT ( " CallUnknownFunction " , " Call unknown function {0} " ) , FText : : FromName ( FunctionReference . GetMemberName ( ) ) ) ;
}
2015-04-02 11:16:23 -04:00
else if ( CachedTooltip . IsOutOfDate ( this ) )
2014-09-03 18:17:44 -04:00
{
FText BaseTooltip = FText : : FromString ( GetDefaultTooltipForFunction ( Function ) ) ;
2014-03-14 14:13:41 -04:00
2014-09-03 18:14:09 -04:00
FFormatNamedArguments Args ;
2014-09-03 18:17:44 -04:00
Args . Add ( TEXT ( " DefaultTooltip " ) , BaseTooltip ) ;
2014-03-14 14:13:41 -04:00
if ( Function - > HasAllFunctionFlags ( FUNC_BlueprintAuthorityOnly ) )
{
2014-09-03 18:14:09 -04:00
Args . Add (
TEXT ( " ClientString " ) ,
NSLOCTEXT ( " K2Node " , " ServerFunction " , " Authority Only. This function will only execute on the server. " )
) ;
2014-09-03 18:17:44 -04:00
// FText::Format() is slow, so we cache this to save on performance
2015-04-02 11:16:23 -04:00
CachedTooltip . SetCachedText ( FText : : Format ( LOCTEXT ( " CallFunction_SubtitledTooltip " , " {DefaultTooltip} \n \n {ClientString} " ) , Args ) , this ) ;
2014-03-14 14:13:41 -04:00
}
else if ( Function - > HasAllFunctionFlags ( FUNC_BlueprintCosmetic ) )
{
2014-09-03 18:14:09 -04:00
Args . Add (
TEXT ( " ClientString " ) ,
2016-01-07 11:21:22 -05:00
NSLOCTEXT ( " K2Node " , " ClientFunction " , " Cosmetic. This event is only for cosmetic, non-gameplay actions. " )
2014-09-03 18:14:09 -04:00
) ;
2014-09-03 18:17:44 -04:00
// FText::Format() is slow, so we cache this to save on performance
2015-04-02 11:16:23 -04:00
CachedTooltip . SetCachedText ( FText : : Format ( LOCTEXT ( " CallFunction_SubtitledTooltip " , " {DefaultTooltip} \n \n {ClientString} " ) , Args ) , this ) ;
2014-03-14 14:13:41 -04:00
}
2014-09-03 18:17:44 -04:00
else
{
2015-04-02 11:16:23 -04:00
CachedTooltip . SetCachedText ( BaseTooltip , this ) ;
2014-09-03 18:17:44 -04:00
}
2014-03-14 14:13:41 -04:00
}
2014-09-03 18:17:44 -04:00
return CachedTooltip ;
2014-03-14 14:13:41 -04:00
}
2014-09-21 20:34:20 -04:00
void UK2Node_CallFunction : : GeneratePinTooltipFromFunction ( UEdGraphPin & Pin , const UFunction * Function )
{
2015-06-24 21:45:09 -04:00
if ( Pin . HasAnyFlags ( RF_Transient ) )
{
return ;
}
2014-09-21 20:34:20 -04:00
// figure what tag we should be parsing for (is this a return-val pin, or a parameter?)
FString ParamName ;
FString TagStr = TEXT ( " @param " ) ;
2015-04-09 15:30:49 -04:00
const bool bReturnPin = Pin . PinName = = UEdGraphSchema_K2 : : PN_ReturnValue ;
if ( bReturnPin )
2014-09-21 20:34:20 -04:00
{
TagStr = TEXT ( " @return " ) ;
}
else
{
ParamName = Pin . PinName . ToLower ( ) ;
}
// grab the the function's comment block for us to parse
FString FunctionToolTipText = Function - > GetToolTipText ( ) . ToString ( ) ;
int32 CurStrPos = INDEX_NONE ;
int32 FullToolTipLen = FunctionToolTipText . Len ( ) ;
// parse the full function tooltip text, looking for tag lines
do
{
CurStrPos = FunctionToolTipText . Find ( TagStr , ESearchCase : : IgnoreCase , ESearchDir : : FromStart , CurStrPos ) ;
if ( CurStrPos = = INDEX_NONE ) // if the tag wasn't found
{
break ;
}
// advance past the tag
CurStrPos + = TagStr . Len ( ) ;
2015-04-09 15:30:49 -04:00
// handle people having done @returns instead of @return
if ( bReturnPin & & CurStrPos < FullToolTipLen & & FunctionToolTipText [ CurStrPos ] = = TEXT ( ' s ' ) )
{
+ + CurStrPos ;
}
2014-09-21 20:34:20 -04:00
// advance past whitespace
while ( CurStrPos < FullToolTipLen & & FChar : : IsWhitespace ( FunctionToolTipText [ CurStrPos ] ) )
{
+ + CurStrPos ;
}
// if this is a parameter pin
if ( ! ParamName . IsEmpty ( ) )
{
FString TagParamName ;
// copy the parameter name
while ( CurStrPos < FullToolTipLen & & ! FChar : : IsWhitespace ( FunctionToolTipText [ CurStrPos ] ) )
{
TagParamName . AppendChar ( FunctionToolTipText [ CurStrPos + + ] ) ;
}
// if this @param tag doesn't match the param we're looking for
if ( TagParamName ! = ParamName )
{
continue ;
}
}
// advance past whitespace (get to the meat of the comment)
2014-09-21 20:34:32 -04:00
// since many doxygen style @param use the format "@param <param name> - <comment>" we also strip - if it is before we get to any other non-whitespace
while ( CurStrPos < FullToolTipLen & & ( FChar : : IsWhitespace ( FunctionToolTipText [ CurStrPos ] ) | | FunctionToolTipText [ CurStrPos ] = = ' - ' ) )
2014-09-21 20:34:20 -04:00
{
+ + CurStrPos ;
}
FString ParamDesc ;
// collect the param/return-val description
while ( CurStrPos < FullToolTipLen & & FunctionToolTipText [ CurStrPos ] ! = TEXT ( ' @ ' ) )
{
// advance past newline
while ( CurStrPos < FullToolTipLen & & FChar : : IsLinebreak ( FunctionToolTipText [ CurStrPos ] ) )
{
+ + CurStrPos ;
// advance past whitespace at the start of a new line
while ( CurStrPos < FullToolTipLen & & FChar : : IsWhitespace ( FunctionToolTipText [ CurStrPos ] ) )
{
+ + CurStrPos ;
}
// replace the newline with a single space
if ( ! FChar : : IsLinebreak ( FunctionToolTipText [ CurStrPos ] ) )
{
ParamDesc . AppendChar ( TEXT ( ' ' ) ) ;
}
}
if ( FunctionToolTipText [ CurStrPos ] ! = TEXT ( ' @ ' ) )
{
ParamDesc . AppendChar ( FunctionToolTipText [ CurStrPos + + ] ) ;
}
}
// trim any trailing whitespace from the descriptive text
ParamDesc . TrimTrailing ( ) ;
// if we came up with a valid description for the param/return-val
if ( ! ParamDesc . IsEmpty ( ) )
{
Pin . PinToolTip + = ParamDesc ;
break ; // we found a match, so there's no need to continue
}
} while ( CurStrPos < FullToolTipLen ) ;
GetDefault < UEdGraphSchema_K2 > ( ) - > ConstructBasicPinTooltip ( Pin , FText : : FromString ( Pin . PinToolTip ) , Pin . PinToolTip ) ;
}
2015-03-27 12:54:58 -04:00
FText UK2Node_CallFunction : : GetUserFacingFunctionName ( const UFunction * Function )
2014-03-14 14:13:41 -04:00
{
2015-06-01 14:36:32 -04:00
FText ReturnDisplayName ;
if ( GEditor & & GetDefault < UEditorStyleSettings > ( ) - > bShowFriendlyNames )
{
ReturnDisplayName = Function - > GetDisplayNameText ( ) ;
}
else
{
static const FString Namespace = TEXT ( " UObjectDisplayNames " ) ;
const FString Key = Function - > GetFullGroupName ( false ) ;
ReturnDisplayName = Function - > GetMetaDataText ( TEXT ( " DisplayName " ) , Namespace , Key ) ;
}
return ReturnDisplayName ;
2014-03-14 14:13:41 -04:00
}
FString UK2Node_CallFunction : : GetDefaultTooltipForFunction ( const UFunction * Function )
{
2015-03-31 20:12:31 -04:00
FString Tooltip ;
if ( Function ! = NULL )
{
Tooltip = Function - > GetToolTipText ( ) . ToString ( ) ;
}
2014-03-14 14:13:41 -04:00
if ( ! Tooltip . IsEmpty ( ) )
{
2014-09-18 18:44:50 -04:00
// Strip off the doxygen nastiness
static const FString DoxygenParam ( TEXT ( " @param " ) ) ;
static const FString DoxygenReturn ( TEXT ( " @return " ) ) ;
static const FString DoxygenSee ( TEXT ( " @see " ) ) ;
2015-07-21 15:41:15 -04:00
static const FString TooltipSee ( TEXT ( " See: " ) ) ;
2015-07-23 09:27:43 -04:00
static const FString DoxygenNote ( TEXT ( " @note " ) ) ;
static const FString TooltipNote ( TEXT ( " Note: " ) ) ;
2014-09-18 18:44:50 -04:00
Tooltip . Split ( DoxygenParam , & Tooltip , nullptr , ESearchCase : : IgnoreCase , ESearchDir : : FromStart ) ;
Tooltip . Split ( DoxygenReturn , & Tooltip , nullptr , ESearchCase : : IgnoreCase , ESearchDir : : FromStart ) ;
2015-07-21 15:41:15 -04:00
Tooltip . ReplaceInline ( * DoxygenSee , * TooltipSee ) ;
2015-07-23 09:27:43 -04:00
Tooltip . ReplaceInline ( * DoxygenNote , * TooltipNote ) ;
2015-07-21 15:41:15 -04:00
2014-08-26 15:45:27 -04:00
Tooltip . Trim ( ) ;
2014-09-18 18:44:50 -04:00
Tooltip . TrimTrailing ( ) ;
2014-08-26 15:45:27 -04:00
2014-11-18 10:54:37 -05:00
UClass * CurrentSelfClass = ( Function ! = NULL ) ? Function - > GetOwnerClass ( ) : NULL ;
UClass const * TrueSelfClass = CurrentSelfClass ;
if ( CurrentSelfClass & & CurrentSelfClass - > ClassGeneratedBy )
{
TrueSelfClass = CurrentSelfClass - > GetAuthoritativeClass ( ) ;
}
FText TargetDisplayText = ( TrueSelfClass ! = NULL ) ? TrueSelfClass - > GetDisplayNameText ( ) : LOCTEXT ( " None " , " None " ) ;
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " TargetName " ) , TargetDisplayText ) ;
Args . Add ( TEXT ( " Tooltip " ) , FText : : FromString ( Tooltip ) ) ;
return FText : : Format ( LOCTEXT ( " CallFunction_Tooltip " , " {Tooltip} \n \n Target is {TargetName} " ) , Args ) . ToString ( ) ;
2014-03-14 14:13:41 -04:00
}
else
{
2015-03-27 12:54:58 -04:00
return GetUserFacingFunctionName ( Function ) . ToString ( ) ;
2014-03-14 14:13:41 -04:00
}
}
2015-05-08 10:46:42 -04:00
FText UK2Node_CallFunction : : GetDefaultCategoryForFunction ( const UFunction * Function , const FText & BaseCategory )
2014-03-14 14:13:41 -04:00
{
2015-05-08 10:46:42 -04:00
FText NodeCategory = BaseCategory ;
2014-03-14 14:13:41 -04:00
if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_FunctionCategory ) )
{
2015-05-08 10:46:42 -04:00
FText FuncCategory ;
// If we are not showing friendly names, return the metadata stored, without localization
if ( GEditor & & ! GetDefault < UEditorStyleSettings > ( ) - > bShowFriendlyNames )
2014-03-14 14:13:41 -04:00
{
2015-05-08 10:46:42 -04:00
FuncCategory = FText : : FromString ( Function - > GetMetaData ( FBlueprintMetadata : : MD_FunctionCategory ) ) ;
}
else
{
// Look for localized metadata
FuncCategory = Function - > GetMetaDataText ( FBlueprintMetadata : : MD_FunctionCategory , TEXT ( " UObjectCategory " ) , Function - > GetFullGroupName ( false ) ) ;
// If the result is culture invariant, force it into a display string
if ( FuncCategory . IsCultureInvariant ( ) )
{
FuncCategory = FText : : FromString ( FName : : NameToDisplayString ( FuncCategory . ToString ( ) , false ) ) ;
}
2014-03-14 14:13:41 -04:00
}
2015-05-08 10:46:42 -04:00
// Combine with the BaseCategory to form the full category, delimited by "|"
if ( ! FuncCategory . IsEmpty ( ) & & ! NodeCategory . IsEmpty ( ) )
2014-03-14 14:13:41 -04:00
{
2015-05-08 10:46:42 -04:00
NodeCategory = FText : : Format ( FText : : FromString ( TEXT ( " {0}|{1} " ) ) , NodeCategory , FuncCategory ) ;
2014-03-14 14:13:41 -04:00
}
2015-05-15 17:26:19 -04:00
else if ( NodeCategory . IsEmpty ( ) )
{
NodeCategory = FuncCategory ;
}
2014-03-14 14:13:41 -04:00
}
return NodeCategory ;
}
2015-04-20 12:25:37 -04:00
FText UK2Node_CallFunction : : GetKeywordsForFunction ( const UFunction * Function )
2014-03-14 14:13:41 -04:00
{
// If the friendly name and real function name do not match add the real function name friendly name as a keyword.
FString Keywords ;
2015-03-27 12:54:58 -04:00
if ( Function - > GetName ( ) ! = GetUserFacingFunctionName ( Function ) . ToString ( ) )
2014-03-14 14:13:41 -04:00
{
Keywords = Function - > GetName ( ) ;
}
if ( ShouldDrawCompact ( Function ) )
{
Keywords . AppendChar ( TEXT ( ' ' ) ) ;
Keywords + = GetCompactNodeTitle ( Function ) ;
}
2015-04-20 12:25:37 -04:00
FText MetadataKeywords = Function - > GetMetaDataText ( FBlueprintMetadata : : MD_FunctionKeywords , TEXT ( " UObjectKeywords " ) , Function - > GetFullGroupName ( false ) ) ;
FText ResultKeywords ;
2014-03-14 14:13:41 -04:00
2015-04-20 12:25:37 -04:00
if ( ! MetadataKeywords . IsEmpty ( ) )
2014-03-14 14:13:41 -04:00
{
2015-04-20 12:25:37 -04:00
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " Name " ) , FText : : FromString ( Keywords ) ) ;
Args . Add ( TEXT ( " MetadataKeywords " ) , MetadataKeywords ) ;
ResultKeywords = FText : : Format ( FText : : FromString ( " {Name} {MetadataKeywords} " ) , Args ) ;
2014-03-14 14:13:41 -04:00
}
2015-06-16 11:53:17 -04:00
else
{
ResultKeywords = FText : : FromString ( Keywords ) ;
}
2014-03-14 14:13:41 -04:00
2015-04-20 12:25:37 -04:00
return ResultKeywords ;
2014-03-14 14:13:41 -04:00
}
void UK2Node_CallFunction : : SetFromFunction ( const UFunction * Function )
{
if ( Function ! = NULL )
{
bIsPureFunc = Function - > HasAnyFunctionFlags ( FUNC_BlueprintPure ) ;
bIsConstFunc = Function - > HasAnyFunctionFlags ( FUNC_Const ) ;
DetermineWantsEnumToExecExpansion ( Function ) ;
2015-03-12 14:17:48 -04:00
FunctionReference . SetFromField < UFunction > ( Function , GetBlueprintClassFromNode ( ) ) ;
2014-03-14 14:13:41 -04:00
}
}
FString UK2Node_CallFunction : : GetDocumentationLink ( ) const
{
UClass * ParentClass = NULL ;
if ( FunctionReference . IsSelfContext ( ) )
{
if ( HasValidBlueprint ( ) )
{
UFunction * Function = FindField < UFunction > ( GetBlueprint ( ) - > GeneratedClass , FunctionReference . GetMemberName ( ) ) ;
if ( Function ! = NULL )
{
ParentClass = Function - > GetOwnerClass ( ) ;
}
}
}
else
{
2015-03-12 14:17:48 -04:00
ParentClass = FunctionReference . GetMemberParentClass ( GetBlueprintClassFromNode ( ) ) ;
2014-03-14 14:13:41 -04:00
}
if ( ParentClass ! = NULL )
{
return FString : : Printf ( TEXT ( " Shared/GraphNodes/Blueprint/%s%s " ) , ParentClass - > GetPrefixCPP ( ) , * ParentClass - > GetName ( ) ) ;
}
return FString ( " Shared/GraphNodes/Blueprint/UK2Node_CallFunction " ) ;
}
FString UK2Node_CallFunction : : GetDocumentationExcerptName ( ) const
{
return FunctionReference . GetMemberName ( ) . ToString ( ) ;
}
FString UK2Node_CallFunction : : GetDescriptiveCompiledName ( ) const
{
return FString ( TEXT ( " CallFunc_ " ) ) + FunctionReference . GetMemberName ( ) . ToString ( ) ;
}
bool UK2Node_CallFunction : : ShouldDrawCompact ( const UFunction * Function )
{
return ( Function ! = NULL ) & & Function - > HasMetaData ( FBlueprintMetadata : : MD_CompactNodeTitle ) ;
}
bool UK2Node_CallFunction : : ShouldDrawCompact ( ) const
{
UFunction * Function = GetTargetFunction ( ) ;
return ShouldDrawCompact ( Function ) ;
}
bool UK2Node_CallFunction : : ShouldDrawAsBead ( ) const
{
return bIsBeadFunction ;
}
bool UK2Node_CallFunction : : ShouldShowNodeProperties ( ) const
{
// Show node properties if this corresponds to a function graph
if ( FunctionReference . GetMemberName ( ) ! = NAME_None )
{
return FindObject < UEdGraph > ( GetBlueprint ( ) , * ( FunctionReference . GetMemberName ( ) . ToString ( ) ) ) ! = NULL ;
}
return false ;
}
FString UK2Node_CallFunction : : GetCompactNodeTitle ( const UFunction * Function )
{
static const FString ProgrammerMultiplicationSymbol = TEXT ( " * " ) ;
static const FString CommonMultiplicationSymbol = TEXT ( " \xD7 " ) ;
static const FString ProgrammerDivisionSymbol = TEXT ( " / " ) ;
static const FString CommonDivisionSymbol = TEXT ( " \xF7 " ) ;
static const FString ProgrammerConversionSymbol = TEXT ( " -> " ) ;
static const FString CommonConversionSymbol = TEXT ( " \x2022 " ) ;
const FString OperatorTitle = Function - > GetMetaData ( FBlueprintMetadata : : MD_CompactNodeTitle ) ;
if ( ! OperatorTitle . IsEmpty ( ) )
{
if ( OperatorTitle = = ProgrammerMultiplicationSymbol )
{
return CommonMultiplicationSymbol ;
}
else if ( OperatorTitle = = ProgrammerDivisionSymbol )
{
return CommonDivisionSymbol ;
}
else if ( OperatorTitle = = ProgrammerConversionSymbol )
{
return CommonConversionSymbol ;
}
else
{
return OperatorTitle ;
}
}
return Function - > GetName ( ) ;
}
2014-04-23 18:30:37 -04:00
FText UK2Node_CallFunction : : GetCompactNodeTitle ( ) const
2014-03-14 14:13:41 -04:00
{
UFunction * Function = GetTargetFunction ( ) ;
if ( Function ! = NULL )
{
2014-04-23 18:30:37 -04:00
return FText : : FromString ( GetCompactNodeTitle ( Function ) ) ;
2014-03-14 14:13:41 -04:00
}
else
{
return Super : : GetCompactNodeTitle ( ) ;
}
}
void UK2Node_CallFunction : : GetRedirectPinNames ( const UEdGraphPin & Pin , TArray < FString > & RedirectPinNames ) const
{
Super : : GetRedirectPinNames ( Pin , RedirectPinNames ) ;
if ( RedirectPinNames . Num ( ) > 0 )
{
const FString OldPinName = RedirectPinNames [ 0 ] ;
// first add functionname.param
RedirectPinNames . Add ( FString : : Printf ( TEXT ( " %s.%s " ) , * FunctionReference . GetMemberName ( ) . ToString ( ) , * OldPinName ) ) ;
// if there is class, also add an option for class.functionname.param
2015-03-12 14:17:48 -04:00
UClass * FunctionClass = FunctionReference . GetMemberParentClass ( GetBlueprintClassFromNode ( ) ) ;
2014-03-14 14:13:41 -04:00
while ( FunctionClass )
{
RedirectPinNames . Add ( FString : : Printf ( TEXT ( " %s.%s.%s " ) , * FunctionClass - > GetName ( ) , * FunctionReference . GetMemberName ( ) . ToString ( ) , * OldPinName ) ) ;
FunctionClass = FunctionClass - > GetSuperClass ( ) ;
}
}
}
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
void UK2Node_CallFunction : : FixupSelfMemberContext ( )
2014-03-14 14:13:41 -04:00
{
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
UBlueprint * Blueprint = FBlueprintEditorUtils : : FindBlueprintForNode ( this ) ;
auto IsBlueprintOfType = [ Blueprint ] ( UClass * ClassType ) - > bool
2014-03-14 14:13:41 -04:00
{
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
bool bIsChildOf = Blueprint & & ( Blueprint - > GeneratedClass ! = nullptr ) & & Blueprint - > GeneratedClass - > IsChildOf ( ClassType ) ;
if ( ! bIsChildOf & & Blueprint & & ( Blueprint - > SkeletonGeneratedClass ) )
2014-03-14 14:13:41 -04:00
{
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
bIsChildOf = Blueprint - > SkeletonGeneratedClass - > IsChildOf ( ClassType ) ;
}
return bIsChildOf ;
} ;
2015-06-30 17:18:11 -04:00
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
UClass * MemberClass = FunctionReference . GetMemberParentClass ( ) ;
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2884592 on 2016/02/27 by Maciej.Mroz
Packages containing Dynamic Types are listed as dependencies in FAsyncPackage::LoadImports
#codereview Robert.Manuszewski
Change 2884607 on 2016/02/27 by Maciej.Mroz
CDO of DynamicClass is postponed as a regular CDO creation.
This change is risky (it still requires some tests), but it seems to be necessary for solving (cyclic) dependencies while Async Loading.
#codereview Robert.Manuszewski, Mike.Beach
Change 2885915 on 2016/02/29 by Michael.Schoell
Struct pins on exposed on spawn properties will no longer error on compile if they do not have a pin connected to them.
UKismetSystemLibrary::SetStructurePropertyByName's Value pin is now marked as a AutoCreateRefTerm so literals can be used on the auto-generated node.
Modified FKismetCompilerUtilities::GenerateAssignmentNodes to assign the literal value into the pin, which in turn allows it to expand into an auto-ref term.
#jira UE-23130 - ExposeOnSpawn struct properties are not handled correctly
Change 2887269 on 2016/03/01 by Maciej.Mroz
Fixes related to DisregardForGC:
- merged 2885687 from Dev-Core branch
- ensure CDO of newly added class is created in CloseDisregardForGC
Change 2887273 on 2016/03/01 by Maciej.Mroz
GUObjectArray.CloseDisregardForGC(); is called before GUObjectArray.DisableDisregardForGC();
Change 2892502 on 2016/03/03 by Maciej.Mroz
More descriptive ensures.
Change 2892509 on 2016/03/03 by Maciej.Mroz
Minor changes in Orion code, necessary to compile the project with nativized Blueprints
#codereview David.Ratti
Change 2892513 on 2016/03/03 by Maciej.Mroz
Blueprint C++ Conversion: there is no crash when a asset used by a nativized class wasn't loaded.
Change 2894347 on 2016/03/04 by Michael.Schoell
Fixed crash with the Array Item Get node in the disassembler.
#jira UE-27734 - Error in TeamLobby
Change 2895311 on 2016/03/04 by Michael.Schoell
Right click and using "Find References" on an event node in either the MyBlueprint window or a graph panel, will search the function's name, not the node's title (drops the Event text).
#jira UE-27335 - GitHub 2092 : Skip "Event " Prefix when Finding References for Events
PR #2092: Skip "Event " Prefix when Finding References for Events (Contributed by mollstam)
Change 2896714 on 2016/03/07 by Ben.Cosh
Fixes for a few related crash/assert issues when profiling blueprints that use event dispatchers/call event functions and latent nodes.
#UE-27090 - Crash when calling an Event Dispatcher within a Sequence node with the Blueprint Profiler on
#Proj KismetCompiler, BlueprintProfiler, BlueprintGraph, Kismet, CoreUObject
#codereview Phillip.Kavan
Change 2897335 on 2016/03/07 by Dan.Oconnor
Unshelved from pending changelist '2889006':
We now copy UObjects that are assigned to Instance properties via UObjectPropertyBase::ImportText_Internal
#jira UE-26310
Change 2899151 on 2016/03/08 by Phillip.Kavan
[UEBP-112] BP profiler - pure node timings
change summary:
- first-pass revisions for tracking/visualizing pure node execution timings while profiling
- trace path debugging support (default: off)
#codereview Ben.Cosh
Change 2901763 on 2016/03/09 by Michael.Schoell
Can undo/redo nodes added using shortcuts.
Also fixed issue with macro nodes added using shortcuts not being selected.
#jira UE-28027 - Cannot Undo Blueprint Nodes Placed Using Shortcuts
Change 2902762 on 2016/03/10 by Phillip.Kavan
[UE-28167] Fix compile-time crash caused by intermediate pure nodes when the BP profiler view is active.
change summary:
- modified FBlueprintExecutionContext::MapNodeExecution() to avoid impure nodes when mapping the pure node execution chain.
#codereview Ben.Cosh
Change 2907961 on 2016/03/14 by Maciej.Mroz
#jira UE-28249 Cooked win32 Fortnite server crash loading in to FastCook map
Manually integrated CL#2906835 from Dev-Core - Reset last non-gc index when disabling disregard for GC pool
Change 2908013 on 2016/03/14 by Maciej.Mroz
EmptyLinkFunctionForGeneratedCode function for all .generated.*.cpp files
Fixed problem when stuff from some .generated.*.cpp files for nativized Blueprints plugin were not linked at all.
#codereview Robert.Manuszewski, Steve.Robb
Change 2908033 on 2016/03/14 by Maciej.Mroz
Various fixes and improvements related to initialization sequence of converted Dynamic Classes.
[CL 2910931 by Mike Beach in Main branch]
2016-03-15 19:07:47 -04:00
const bool bIsLocalMacro = Blueprint & & Blueprint - > MacroGraphs . Contains ( GetGraph ( ) ) ;
ensureMsgf ( FunctionReference . IsSelfContext ( ) | | ( MemberClass ! = nullptr ) | | bIsLocalMacro , TEXT ( " Unknown member class in %s " ) , * GetPathName ( ) ) ;
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
if ( FunctionReference . IsSelfContext ( ) )
{
if ( MemberClass = = nullptr )
{
// the self pin may have type information stored on it
if ( UEdGraphPin * SelfPin = GetDefault < UEdGraphSchema_K2 > ( ) - > FindSelfPin ( * this , EGPD_Input ) )
2014-03-14 14:13:41 -04:00
{
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
MemberClass = Cast < UClass > ( SelfPin - > PinType . PinSubCategoryObject . Get ( ) ) ;
2014-03-14 14:13:41 -04:00
}
}
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
// if we happened to retain the ParentClass for a self reference
// (unlikely), then we know where this node came from... let's keep it
// referencing that function
if ( MemberClass ! = nullptr )
{
if ( ! IsBlueprintOfType ( MemberClass ) )
{
FunctionReference . SetExternalMember ( FunctionReference . GetMemberName ( ) , MemberClass ) ;
}
}
// else, there is nothing we can do... if there is an function matching
// the member name in this Blueprint, then it will reference that
// function (even if it came from a different Blueprint, one with an
// identically named function)... if there is no function matching this
// reference, then the node will produce an error later during compilation
}
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2884592 on 2016/02/27 by Maciej.Mroz
Packages containing Dynamic Types are listed as dependencies in FAsyncPackage::LoadImports
#codereview Robert.Manuszewski
Change 2884607 on 2016/02/27 by Maciej.Mroz
CDO of DynamicClass is postponed as a regular CDO creation.
This change is risky (it still requires some tests), but it seems to be necessary for solving (cyclic) dependencies while Async Loading.
#codereview Robert.Manuszewski, Mike.Beach
Change 2885915 on 2016/02/29 by Michael.Schoell
Struct pins on exposed on spawn properties will no longer error on compile if they do not have a pin connected to them.
UKismetSystemLibrary::SetStructurePropertyByName's Value pin is now marked as a AutoCreateRefTerm so literals can be used on the auto-generated node.
Modified FKismetCompilerUtilities::GenerateAssignmentNodes to assign the literal value into the pin, which in turn allows it to expand into an auto-ref term.
#jira UE-23130 - ExposeOnSpawn struct properties are not handled correctly
Change 2887269 on 2016/03/01 by Maciej.Mroz
Fixes related to DisregardForGC:
- merged 2885687 from Dev-Core branch
- ensure CDO of newly added class is created in CloseDisregardForGC
Change 2887273 on 2016/03/01 by Maciej.Mroz
GUObjectArray.CloseDisregardForGC(); is called before GUObjectArray.DisableDisregardForGC();
Change 2892502 on 2016/03/03 by Maciej.Mroz
More descriptive ensures.
Change 2892509 on 2016/03/03 by Maciej.Mroz
Minor changes in Orion code, necessary to compile the project with nativized Blueprints
#codereview David.Ratti
Change 2892513 on 2016/03/03 by Maciej.Mroz
Blueprint C++ Conversion: there is no crash when a asset used by a nativized class wasn't loaded.
Change 2894347 on 2016/03/04 by Michael.Schoell
Fixed crash with the Array Item Get node in the disassembler.
#jira UE-27734 - Error in TeamLobby
Change 2895311 on 2016/03/04 by Michael.Schoell
Right click and using "Find References" on an event node in either the MyBlueprint window or a graph panel, will search the function's name, not the node's title (drops the Event text).
#jira UE-27335 - GitHub 2092 : Skip "Event " Prefix when Finding References for Events
PR #2092: Skip "Event " Prefix when Finding References for Events (Contributed by mollstam)
Change 2896714 on 2016/03/07 by Ben.Cosh
Fixes for a few related crash/assert issues when profiling blueprints that use event dispatchers/call event functions and latent nodes.
#UE-27090 - Crash when calling an Event Dispatcher within a Sequence node with the Blueprint Profiler on
#Proj KismetCompiler, BlueprintProfiler, BlueprintGraph, Kismet, CoreUObject
#codereview Phillip.Kavan
Change 2897335 on 2016/03/07 by Dan.Oconnor
Unshelved from pending changelist '2889006':
We now copy UObjects that are assigned to Instance properties via UObjectPropertyBase::ImportText_Internal
#jira UE-26310
Change 2899151 on 2016/03/08 by Phillip.Kavan
[UEBP-112] BP profiler - pure node timings
change summary:
- first-pass revisions for tracking/visualizing pure node execution timings while profiling
- trace path debugging support (default: off)
#codereview Ben.Cosh
Change 2901763 on 2016/03/09 by Michael.Schoell
Can undo/redo nodes added using shortcuts.
Also fixed issue with macro nodes added using shortcuts not being selected.
#jira UE-28027 - Cannot Undo Blueprint Nodes Placed Using Shortcuts
Change 2902762 on 2016/03/10 by Phillip.Kavan
[UE-28167] Fix compile-time crash caused by intermediate pure nodes when the BP profiler view is active.
change summary:
- modified FBlueprintExecutionContext::MapNodeExecution() to avoid impure nodes when mapping the pure node execution chain.
#codereview Ben.Cosh
Change 2907961 on 2016/03/14 by Maciej.Mroz
#jira UE-28249 Cooked win32 Fortnite server crash loading in to FastCook map
Manually integrated CL#2906835 from Dev-Core - Reset last non-gc index when disabling disregard for GC pool
Change 2908013 on 2016/03/14 by Maciej.Mroz
EmptyLinkFunctionForGeneratedCode function for all .generated.*.cpp files
Fixed problem when stuff from some .generated.*.cpp files for nativized Blueprints plugin were not linked at all.
#codereview Robert.Manuszewski, Steve.Robb
Change 2908033 on 2016/03/14 by Maciej.Mroz
Various fixes and improvements related to initialization sequence of converted Dynamic Classes.
[CL 2910931 by Mike Beach in Main branch]
2016-03-15 19:07:47 -04:00
else if ( MemberClass ! = nullptr )
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
{
if ( IsBlueprintOfType ( MemberClass ) )
{
FunctionReference . SetSelfMember ( FunctionReference . GetMemberName ( ) ) ;
}
2014-03-14 14:13:41 -04:00
}
}
void UK2Node_CallFunction : : PostPasteNode ( )
{
Super : : PostPasteNode ( ) ;
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
FixupSelfMemberContext ( ) ;
2014-03-14 14:13:41 -04:00
UFunction * Function = GetTargetFunction ( ) ;
if ( Function ! = NULL )
{
// After pasting we need to go through and ensure the hidden the self pins is correct in case the source blueprint had different metadata
TSet < FString > PinsToHide ;
[UE-2345] BP - enforce const-correctness in native const class method overrides
this change introduces enforcement of 'const-correctness' into implemented function graphs.
summary:
if you have a function declared in C++ like this:
UFUNCTION(BlueprintImplementableEvent)
int32 MyFunctionThatReturnsSomeValue() const;
if you implement that (BPIE) function in a Blueprint that's parented to that native class, it will now be flagged as 'const'. this makes any properties of 'self' read-only within the context of that graph, which means the compiler will emit an error if you try to set a property or otherwise call a non-const, non-static function with 'self' as the target.
if there happens to already be an implemented const function in a Blueprint that was in place prior to this change, the compiler will emit a warning instead of an error, in order to allow existing Blueprints that may currently be "violating" const within the context of a const BPIE function to still compile, while still alerting to issues that should probably be addressed.
notes:
1) this also applies to BlueprintNativeEvent (BPNE) implementations, and also when implementing BPIE/BPNE interface methods that are also declared as const
2) a const BPIE/BPNE function with no return value and no output parameters will be implemented as a "normal" impure function, and not as an event as in the non-const case
3) a const BPIE/BPNE function with a return value and/or output parameters will currently be implemented as a pure function, regardless of whether or not BlueprintCallable is specified
4) this CL also retains some consolidation of static function validation code that i had previously done, mostly to allow static functions to more easily be whitelisted for const function graphs
#codereview Nick.Whiting, Michael.Noland
[CL 2368059 by Phillip Kavan in Main branch]
2014-11-21 17:47:17 -05:00
FBlueprintEditorUtils : : GetHiddenPinsForFunction ( GetGraph ( ) , Function , PinsToHide ) ;
2014-03-14 14:13:41 -04:00
2014-09-10 15:23:52 -04:00
const bool bShowWorldContextPin = ( ( PinsToHide . Num ( ) > 0 ) & & GetBlueprint ( ) - > ParentClass - > HasMetaData ( FBlueprintMetadata : : MD_ShowWorldContextPin ) ) ;
2014-03-14 14:13:41 -04:00
FString const DefaultToSelfMetaValue = Function - > GetMetaData ( FBlueprintMetadata : : MD_DefaultToSelf ) ;
FString const WorldContextMetaValue = Function - > GetMetaData ( FBlueprintMetadata : : MD_WorldContext ) ;
2014-04-30 13:08:46 -04:00
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
2014-03-14 14:13:41 -04:00
for ( int32 PinIndex = 0 ; PinIndex < Pins . Num ( ) ; + + PinIndex )
{
UEdGraphPin * Pin = Pins [ PinIndex ] ;
bool bIsSelfPin = ( ( Pin - > PinName = = DefaultToSelfMetaValue ) | | ( Pin - > PinName = = WorldContextMetaValue ) ) ;
2014-09-10 15:23:52 -04:00
bool bPinShouldBeHidden = PinsToHide . Contains ( Pin - > PinName ) & & ( ! bShowWorldContextPin | | ! bIsSelfPin ) ;
2014-03-14 14:13:41 -04:00
if ( bPinShouldBeHidden & & ! Pin - > bHidden )
{
Pin - > BreakAllPinLinks ( ) ;
2014-04-30 13:08:46 -04:00
K2Schema - > SetPinDefaultValueBasedOnType ( Pin ) ;
2014-03-14 14:13:41 -04:00
}
Pin - > bHidden = bPinShouldBeHidden ;
}
}
}
void UK2Node_CallFunction : : PostDuplicate ( bool bDuplicateForPIE )
{
Super : : PostDuplicate ( bDuplicateForPIE ) ;
if ( ! bDuplicateForPIE & & ( ! this - > HasAnyFlags ( RF_Transient ) ) )
{
Copying //UE4/Dev-Blueprints to Dev-Main (//UE4/Dev-Main) @ 2781164
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2716841 on 2015/10/05 by Mike.Beach
(WIP) Cleaning up how we setup script assets for replacement on cook (aligning more with the Blueprint conversion tool).
#codereview Maciej.Mroz
Change 2719089 on 2015/10/07 by Maciej.Mroz
ToValidCPPIdentifierChars handles propertly '?' char.
#codereview Dan.Oconnor
Change 2719361 on 2015/10/07 by Maciej.Mroz
Generated native code for AnimBPGC - some preliminary changes.
Refactor: UAnimBlueprintGeneratedClass is not accessed directly in runtime. It is accessed via UAnimClassInterface interface.
Properties USkeletalMeshComponent::AnimBlueprintGeneratedClass and UInterpTrackFloatAnimBPParam::AnimBlueprintClass were changed into "TSubclassOf<UAnimInstance> AnimClass"
The UDynamicClass also can deliver the IAnimClassInterface interface. See UAnimClassData, IAnimClassInterface::GetFromClass and UDynamicClass::AnimClassImplementation.
#codereview Lina.Halper, Thomas.Sarkanen
Change 2719383 on 2015/10/07 by Maciej.Mroz
Debug-only code removed
Change 2720528 on 2015/10/07 by Dan.Oconnor
Fix for determinsitc cooking of async tasks and load asset nodes
#codereview Mike.Beach, Maciej.Mroz
Change 2721273 on 2015/10/08 by Maciej.Mroz
Blueprint Compiler Cpp Backend
- Anim Blueprints can be converted
- Various fixes/improvements
Change 2721310 on 2015/10/08 by Maciej.Mroz
refactor (cl#2719361) - no "auto" keyword
Change 2721727 on 2015/10/08 by Mike.Beach
(WIP) Setup the cook commandlet so it handles converted assets, replacing them with generated classes.
- Refactored the conversion manifest (using a map over an array)
- Centralized destination paths into a helper struct (for the manifest)
- Generating an Editor module that automatically hooks into the cook process when enabled
- Loading and applying native replacments for the cook
Change 2723276 on 2015/10/09 by Michael.Schoell
Blueprints duplicated for PIE will no longer register as dependencies to other Blueprint.
#jira UE-16695 - Editor freezes then crashes while attempting to save during PIE
#jira UE-21614 - [CrashReport] Crash while saving during PIE - FKismetEditorUtilities::CompileBlueprint() kismet2.cpp:736
Change 2724345 on 2015/10/11 by Ben.Cosh
Blueprint profiler at first pass, this includes the ability to instrument specific blueprints with realtime editor stat display.
#UEBP-21 - Profiling data capture and storage
#UEBP-13 - Performance capture landing page
#Branch UE4
#Proj BlueprintProfiler, BlueprintGraph, EditorStyle, Kismet, UnrealEd, CoreUObject, Engine
Change 2724613 on 2015/10/12 by Ben.Cosh
Incremental update for blueprint profiler to fix the way some of the reported stats cascade through events and branches and additionally some missed bits of code are refactored/removed.
#Branch UE4
#Proj BlueprintProfiler
#info Whilst looking into this I spotted the reason why the stats seem so erratic, There appears to be an issue with FText's use of EXPERIMENTAL_TEXT_FAST_DECIMAL_FORMAT which I have reported, but ideally disable this locally until a fix is integrated.
Change 2724723 on 2015/10/12 by Maciej.Mroz
Constructor of a dynamic class creates CDO.
#codereview Robert.Manuszewski
Change 2725108 on 2015/10/12 by Mike.Beach
[UE-21891] Minor fix to the array shuffle() function; now processes the last entry like all the others.
Change 2726358 on 2015/10/13 by Maciej.Mroz
UDataTable is properly saved even if its RowStruct is null.
https://udn.unrealengine.com/questions/264064/crash-using-hotreload-in-custom-datatable-cdo-clas.html
Change 2727395 on 2015/10/13 by Mike.Beach
(WIP) Second pass on the Blueprint conversion pipeline; setting it up for more optimal (speedier) performance.
* Using stubs for replacements (rather than loading dynamic replacement).
* Giving the cook commandlet more control (so a conversion could be ran directly).
* Now logging replacements by old object path (to account for UPackage replacement queries).
* Fix for [UE-21947], unshelved from CL 2724944 (by Maciej.Mroz).
#codereview Maciej.Mroz
Change 2727484 on 2015/10/13 by Mike.Beach
[UE-22008] Fixing up comment/tooltip typo for UActorComponent::bAutoActivate.
Change 2727527 on 2015/10/13 by Mike.Beach
Downgrading an inactionable EdGraph warning, while adding more info so we could possibly determine what's happening.
Change 2727702 on 2015/10/13 by Dan.Oconnor
Fix for crash in UDelegateProperty::GetCPPType when called on a function with no OwnerClass (events)
Change 2727968 on 2015/10/14 by Maciej.Mroz
Since ConstructorHelpers::FClassFinder is usually static, the loaded class should be in root set, to prevent the pointer stored in ConstructorHelpers::FClassFinder from being obsolete.
FindOrLoadClass behaves now like FindOrLoadObject.
#codereview Robert.Manuszewski, Nick.Whiting
Change 2728139 on 2015/10/14 by Phillip.Kavan
2015-11-25 18:47:20 -05:00
FixupSelfMemberContext ( ) ;
2014-03-14 14:13:41 -04:00
}
}
void UK2Node_CallFunction : : ValidateNodeDuringCompilation ( class FCompilerResultsLog & MessageLog ) const
{
Super : : ValidateNodeDuringCompilation ( MessageLog ) ;
2014-10-16 10:22:49 -04:00
const UBlueprint * Blueprint = GetBlueprint ( ) ;
2014-03-14 14:13:41 -04:00
UFunction * Function = GetTargetFunction ( ) ;
if ( Function = = NULL )
{
2014-09-24 19:47:30 -04:00
FString OwnerName ;
if ( Blueprint ! = nullptr )
{
OwnerName = Blueprint - > GetName ( ) ;
if ( UClass * FuncOwnerClass = FunctionReference . GetMemberParentClass ( Blueprint - > GeneratedClass ) )
{
OwnerName = FuncOwnerClass - > GetName ( ) ;
}
}
2014-09-24 14:15:01 -04:00
FString const FunctName = FunctionReference . GetMemberName ( ) . ToString ( ) ;
FText const WarningFormat = LOCTEXT ( " FunctionNotFound " , " Could not find a function named \" %s \" in '%s'. \n Make sure '%s' has been compiled for @@ " ) ;
2015-02-23 15:58:14 -05:00
MessageLog . Error ( * FString : : Printf ( * WarningFormat . ToString ( ) , * FunctName , * OwnerName , * OwnerName ) , this ) ;
2014-03-14 14:13:41 -04:00
}
else if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_ExpandEnumAsExecs ) & & bWantsEnumToExecExpansion = = false )
{
const FString & EnumParamName = Function - > GetMetaData ( FBlueprintMetadata : : MD_ExpandEnumAsExecs ) ;
MessageLog . Warning ( * FString : : Printf ( * LOCTEXT ( " EnumToExecExpansionFailed " , " Unable to find enum parameter with name '%s' to expand for @@ " ) . ToString ( ) , * EnumParamName ) , this ) ;
}
2014-09-10 16:39:25 -04:00
if ( Function )
2014-03-14 14:13:41 -04:00
{
2014-09-10 16:39:25 -04:00
// enforce UnsafeDuringActorConstruction keyword
if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_UnsafeForConstructionScripts ) )
2014-03-14 14:13:41 -04:00
{
2014-09-10 16:39:25 -04:00
// emit warning if we are in a construction script
UEdGraph const * const Graph = GetGraph ( ) ;
UEdGraphSchema_K2 const * const Schema = Cast < const UEdGraphSchema_K2 > ( GetSchema ( ) ) ;
bool bNodeIsInConstructionScript = Schema & & Schema - > IsConstructionScript ( Graph ) ;
2014-03-14 14:13:41 -04:00
2014-09-10 16:39:25 -04:00
if ( bNodeIsInConstructionScript = = false )
2014-03-14 14:13:41 -04:00
{
2014-09-10 16:39:25 -04:00
// IsConstructionScript() can return false if graph was cloned from the construction script
// in that case, check the function entry
TArray < const UK2Node_FunctionEntry * > EntryPoints ;
Graph - > GetNodesOfClass ( EntryPoints ) ;
if ( EntryPoints . Num ( ) = = 1 )
2014-03-14 14:13:41 -04:00
{
2014-09-10 16:39:25 -04:00
UK2Node_FunctionEntry const * const Node = EntryPoints [ 0 ] ;
if ( Node )
{
UFunction * const SignatureFunction = FindField < UFunction > ( Node - > SignatureClass , Node - > SignatureName ) ;
bNodeIsInConstructionScript = SignatureFunction & & ( SignatureFunction - > GetFName ( ) = = Schema - > FN_UserConstructionScript ) ;
}
2014-03-14 14:13:41 -04:00
}
}
2014-09-10 16:39:25 -04:00
if ( bNodeIsInConstructionScript )
{
MessageLog . Warning ( * LOCTEXT ( " FunctionUnsafeDuringConstruction " , " Function '@@' is unsafe to call in a construction script. " ) . ToString ( ) , this ) ;
}
2014-03-14 14:13:41 -04:00
}
2014-09-10 16:39:25 -04:00
// enforce WorldContext restrictions
2014-10-16 10:22:49 -04:00
const bool bInsideBpFuncLibrary = Blueprint & & ( BPTYPE_FunctionLibrary = = Blueprint - > BlueprintType ) ;
if ( ! bInsideBpFuncLibrary & &
Function - > HasMetaData ( FBlueprintMetadata : : MD_WorldContext ) & &
! Function - > HasMetaData ( FBlueprintMetadata : : MD_CallableWithoutWorldContext ) )
2014-03-14 14:13:41 -04:00
{
2014-10-16 10:22:49 -04:00
check ( Blueprint ) ;
UClass * ParentClass = Blueprint - > ParentClass ;
check ( ParentClass ) ;
if ( ParentClass & & ! ParentClass - > GetDefaultObject ( ) - > ImplementsGetWorld ( ) & & ! ParentClass - > HasMetaData ( FBlueprintMetadata : : MD_ShowWorldContextPin ) )
2014-09-10 16:39:25 -04:00
{
MessageLog . Warning ( * LOCTEXT ( " FunctionUnsafeInContext " , " Function '@@' is unsafe to call from blueprints of class '@@'. " ) . ToString ( ) , this , ParentClass ) ;
}
2014-03-14 14:13:41 -04:00
}
}
2014-10-09 12:04:45 -04:00
FDynamicOutputHelper : : VerifyNode ( this , MessageLog ) ;
2014-03-14 14:13:41 -04:00
}
void UK2Node_CallFunction : : Serialize ( FArchive & Ar )
{
Super : : Serialize ( Ar ) ;
if ( Ar . IsLoading ( ) )
{
if ( Ar . UE4Ver ( ) < VER_UE4_SWITCH_CALL_NODE_TO_USE_MEMBER_REFERENCE )
{
UFunction * Function = FindField < UFunction > ( CallFunctionClass_DEPRECATED , CallFunctionName_DEPRECATED ) ;
const bool bProbablySelfCall = ( CallFunctionClass_DEPRECATED = = NULL ) | | ( ( Function ! = NULL ) & & ( Function - > GetOuterUClass ( ) - > ClassGeneratedBy = = GetBlueprint ( ) ) ) ;
FunctionReference . SetDirect ( CallFunctionName_DEPRECATED , FGuid ( ) , CallFunctionClass_DEPRECATED , bProbablySelfCall ) ;
}
if ( Ar . UE4Ver ( ) < VER_UE4_K2NODE_REFERENCEGUIDS )
{
FGuid FunctionGuid ;
if ( UBlueprint : : GetGuidFromClassByFieldName < UFunction > ( GetBlueprint ( ) - > GeneratedClass , FunctionReference . GetMemberName ( ) , FunctionGuid ) )
{
const bool bSelf = FunctionReference . IsSelfContext ( ) ;
FunctionReference . SetDirect ( FunctionReference . GetMemberName ( ) , FunctionGuid , ( bSelf ? NULL : FunctionReference . GetMemberParentClass ( ( UClass * ) NULL ) ) , bSelf ) ;
}
}
2015-08-19 14:13:40 -04:00
2015-08-26 18:44:36 -04:00
if ( ! Ar . IsObjectReferenceCollector ( ) )
2015-08-19 14:13:40 -04:00
{
2015-08-26 18:44:36 -04:00
// Don't validate the enabled state if the user has explicitly set it. Also skip validation if we're just duplicating this node.
const bool bIsDuplicating = ( Ar . GetPortFlags ( ) & PPF_Duplicate ) ! = 0 ;
if ( ! bIsDuplicating & & ! bUserSetEnabledState )
2015-08-19 14:13:40 -04:00
{
2015-08-26 18:44:36 -04:00
UClass * SelfScope = GetBlueprintClassFromNode ( ) ;
if ( ! FunctionReference . IsSelfContext ( ) | | SelfScope ! = nullptr )
2015-08-19 14:13:40 -04:00
{
2015-08-26 18:44:36 -04:00
if ( const UFunction * Function = FunctionReference . ResolveMember < UFunction > ( SelfScope ) )
2015-08-26 18:26:01 -04:00
{
2015-08-26 18:44:36 -04:00
// Enable as development-only if specified in metadata. This way existing functions that have the metadata added to them will get their enabled state fixed up on load.
if ( EnabledState = = ENodeEnabledState : : Enabled & & Function - > HasMetaData ( FBlueprintMetadata : : MD_DevelopmentOnly ) )
{
EnabledState = ENodeEnabledState : : DevelopmentOnly ;
}
// Ensure that if the metadata is removed, we also fix up the enabled state to avoid leaving it set as development-only in that case.
else if ( EnabledState = = ENodeEnabledState : : DevelopmentOnly & & ! Function - > HasMetaData ( FBlueprintMetadata : : MD_DevelopmentOnly ) )
{
EnabledState = ENodeEnabledState : : Enabled ;
}
2015-08-26 18:26:01 -04:00
}
2015-08-19 14:13:40 -04:00
}
}
}
2014-03-14 14:13:41 -04:00
}
}
void UK2Node_CallFunction : : PostPlacedNewNode ( )
{
Super : : PostPlacedNewNode ( ) ;
// Try re-setting the function given our new parent scope, in case it turns an external to an internal, or vis versa
2015-03-12 14:17:48 -04:00
FunctionReference . RefreshGivenNewSelfScope < UFunction > ( GetBlueprintClassFromNode ( ) ) ;
2015-08-19 14:13:40 -04:00
// Re-enable for development only if specified in metadata.
if ( EnabledState = = ENodeEnabledState : : Enabled & & ! bUserSetEnabledState )
{
const UFunction * Function = GetTargetFunction ( ) ;
if ( Function & & Function - > HasMetaData ( FBlueprintMetadata : : MD_DevelopmentOnly ) )
{
EnabledState = ENodeEnabledState : : DevelopmentOnly ;
}
}
2014-03-14 14:13:41 -04:00
}
FNodeHandlingFunctor * UK2Node_CallFunction : : CreateNodeHandler ( FKismetCompilerContext & CompilerContext ) const
{
return new FKCHandler_CallFunction ( CompilerContext ) ;
}
void UK2Node_CallFunction : : ExpandNode ( class FKismetCompilerContext & CompilerContext , UEdGraph * SourceGraph )
{
2014-06-16 10:30:41 -04:00
Super : : ExpandNode ( CompilerContext , SourceGraph ) ;
2014-10-17 06:37:11 -04:00
const UEdGraphSchema_K2 * Schema = CompilerContext . GetSchema ( ) ;
UFunction * Function = GetTargetFunction ( ) ;
// connect DefaultToSelf and WorldContext inside static functions to proper 'self'
[UE-2345] BP - enforce const-correctness in native const class method overrides
this change introduces enforcement of 'const-correctness' into implemented function graphs.
summary:
if you have a function declared in C++ like this:
UFUNCTION(BlueprintImplementableEvent)
int32 MyFunctionThatReturnsSomeValue() const;
if you implement that (BPIE) function in a Blueprint that's parented to that native class, it will now be flagged as 'const'. this makes any properties of 'self' read-only within the context of that graph, which means the compiler will emit an error if you try to set a property or otherwise call a non-const, non-static function with 'self' as the target.
if there happens to already be an implemented const function in a Blueprint that was in place prior to this change, the compiler will emit a warning instead of an error, in order to allow existing Blueprints that may currently be "violating" const within the context of a const BPIE function to still compile, while still alerting to issues that should probably be addressed.
notes:
1) this also applies to BlueprintNativeEvent (BPNE) implementations, and also when implementing BPIE/BPNE interface methods that are also declared as const
2) a const BPIE/BPNE function with no return value and no output parameters will be implemented as a "normal" impure function, and not as an event as in the non-const case
3) a const BPIE/BPNE function with a return value and/or output parameters will currently be implemented as a pure function, regardless of whether or not BlueprintCallable is specified
4) this CL also retains some consolidation of static function validation code that i had previously done, mostly to allow static functions to more easily be whitelisted for const function graphs
#codereview Nick.Whiting, Michael.Noland
[CL 2368059 by Phillip Kavan in Main branch]
2014-11-21 17:47:17 -05:00
if ( SourceGraph & & Schema - > IsStaticFunctionGraph ( SourceGraph ) & & Function )
2014-03-14 14:13:41 -04:00
{
2014-10-17 06:37:11 -04:00
TArray < UK2Node_FunctionEntry * > EntryPoints ;
SourceGraph - > GetNodesOfClass ( EntryPoints ) ;
if ( 1 ! = EntryPoints . Num ( ) )
2014-04-30 13:08:46 -04:00
{
2014-10-17 06:37:11 -04:00
CompilerContext . MessageLog . Warning ( * FString : : Printf ( * LOCTEXT ( " WrongEntryPointsNum " , " %i entry points found while expanding node @@ " ) . ToString ( ) , EntryPoints . Num ( ) ) , this ) ;
2014-04-30 13:08:46 -04:00
}
2014-10-17 06:37:11 -04:00
else if ( auto BetterSelfPin = EntryPoints [ 0 ] - > GetAutoWorldContextPin ( ) )
2014-03-14 14:13:41 -04:00
{
2014-10-17 06:37:11 -04:00
FString const DefaultToSelfMetaValue = Function - > GetMetaData ( FBlueprintMetadata : : MD_DefaultToSelf ) ;
FString const WorldContextMetaValue = Function - > GetMetaData ( FBlueprintMetadata : : MD_WorldContext ) ;
struct FStructConnectHelper
2014-03-14 14:13:41 -04:00
{
2014-10-17 06:37:11 -04:00
static void Connect ( const FString & PinName , UK2Node * Node , UEdGraphPin * BetterSelf , const UEdGraphSchema_K2 * InSchema , FCompilerResultsLog & MessageLog )
2014-03-14 14:13:41 -04:00
{
2014-10-17 06:37:11 -04:00
auto Pin = Node - > FindPin ( PinName ) ;
if ( ! PinName . IsEmpty ( ) & & Pin & & ! Pin - > LinkedTo . Num ( ) )
2014-03-14 14:13:41 -04:00
{
2014-10-17 06:37:11 -04:00
const bool bConnected = InSchema - > TryCreateConnection ( Pin , BetterSelf ) ;
if ( ! bConnected )
2014-03-14 14:13:41 -04:00
{
2014-10-17 06:37:11 -04:00
MessageLog . Warning ( * LOCTEXT ( " DefaultToSelfNotConnected " , " DefaultToSelf pin @@ from node @@ cannot be connected to @@ " ) . ToString ( ) , Pin , Node , BetterSelf ) ;
2014-06-09 11:11:12 -04:00
}
}
2014-10-17 06:37:11 -04:00
}
} ;
FStructConnectHelper : : Connect ( DefaultToSelfMetaValue , this , BetterSelfPin , Schema , CompilerContext . MessageLog ) ;
2014-10-17 07:57:28 -04:00
if ( ! Function - > HasMetaData ( FBlueprintMetadata : : MD_CallableWithoutWorldContext ) )
{
FStructConnectHelper : : Connect ( WorldContextMetaValue , this , BetterSelfPin , Schema , CompilerContext . MessageLog ) ;
}
2014-10-17 06:37:11 -04:00
}
}
// If we have an enum param that is expanded, we handle that first
if ( bWantsEnumToExecExpansion )
{
if ( Function )
{
// Get the metadata that identifies which param is the enum, and try and find it
const FString & EnumParamName = Function - > GetMetaData ( FBlueprintMetadata : : MD_ExpandEnumAsExecs ) ;
UByteProperty * EnumProp = FindField < UByteProperty > ( Function , FName ( * EnumParamName ) ) ;
UEdGraphPin * EnumParamPin = FindPinChecked ( EnumParamName ) ;
if ( EnumProp ! = NULL & & EnumProp - > Enum ! = NULL )
{
// Expanded as input execs pins
if ( EnumParamPin - > Direction = = EGPD_Input )
{
// Create normal exec input
UEdGraphPin * ExecutePin = CreatePin ( EGPD_Input , Schema - > PC_Exec , TEXT ( " " ) , NULL , false , false , Schema - > PN_Execute ) ;
// Create temp enum variable
UK2Node_TemporaryVariable * TempEnumVarNode = CompilerContext . SpawnIntermediateNode < UK2Node_TemporaryVariable > ( this , SourceGraph ) ;
TempEnumVarNode - > VariableType . PinCategory = Schema - > PC_Byte ;
TempEnumVarNode - > VariableType . PinSubCategoryObject = EnumProp - > Enum ;
TempEnumVarNode - > AllocateDefaultPins ( ) ;
// Get the output pin
UEdGraphPin * TempEnumVarOutput = TempEnumVarNode - > GetVariablePin ( ) ;
// Connect temp enum variable to (hidden) enum pin
Schema - > TryCreateConnection ( TempEnumVarOutput , EnumParamPin ) ;
// Now we want to iterate over other exec inputs...
for ( int32 PinIdx = Pins . Num ( ) - 1 ; PinIdx > = 0 ; PinIdx - - )
2014-06-09 11:11:12 -04:00
{
2014-10-17 06:37:11 -04:00
UEdGraphPin * Pin = Pins [ PinIdx ] ;
if ( Pin ! = NULL & &
Pin ! = ExecutePin & &
Pin - > Direction = = EGPD_Input & &
Pin - > PinType . PinCategory = = Schema - > PC_Exec )
2014-06-09 11:11:12 -04:00
{
2014-10-17 06:37:11 -04:00
// Create node to set the temp enum var
UK2Node_AssignmentStatement * AssignNode = CompilerContext . SpawnIntermediateNode < UK2Node_AssignmentStatement > ( this , SourceGraph ) ;
AssignNode - > AllocateDefaultPins ( ) ;
// Move connections from fake 'enum exec' pint to this assignment node
CompilerContext . MovePinLinksToIntermediate ( * Pin , * AssignNode - > GetExecPin ( ) ) ;
// Connect this to out temp enum var
Schema - > TryCreateConnection ( AssignNode - > GetVariablePin ( ) , TempEnumVarOutput ) ;
// Connect exec output to 'real' exec pin
Schema - > TryCreateConnection ( AssignNode - > GetThenPin ( ) , ExecutePin ) ;
// set the literal enum value to set to
AssignNode - > GetValuePin ( ) - > DefaultValue = Pin - > PinName ;
// Finally remove this 'cosmetic' exec pin
Pins . RemoveAt ( PinIdx ) ;
}
}
}
// Expanded as output execs pins
else if ( EnumParamPin - > Direction = = EGPD_Output )
{
// Create normal exec output
UEdGraphPin * ExecutePin = CreatePin ( EGPD_Output , Schema - > PC_Exec , TEXT ( " " ) , NULL , false , false , Schema - > PN_Execute ) ;
// Create a SwitchEnum node to switch on the output enum
UK2Node_SwitchEnum * SwitchEnumNode = CompilerContext . SpawnIntermediateNode < UK2Node_SwitchEnum > ( this , SourceGraph ) ;
UEnum * EnumObject = Cast < UEnum > ( EnumParamPin - > PinType . PinSubCategoryObject . Get ( ) ) ;
SwitchEnumNode - > SetEnum ( EnumObject ) ;
SwitchEnumNode - > AllocateDefaultPins ( ) ;
// Hook up execution to the switch node
Schema - > TryCreateConnection ( ExecutePin , SwitchEnumNode - > GetExecPin ( ) ) ;
// Connect (hidden) enum pin to switch node's selection pin
Schema - > TryCreateConnection ( EnumParamPin , SwitchEnumNode - > GetSelectionPin ( ) ) ;
// Now we want to iterate over other exec outputs
for ( int32 PinIdx = Pins . Num ( ) - 1 ; PinIdx > = 0 ; PinIdx - - )
{
UEdGraphPin * Pin = Pins [ PinIdx ] ;
if ( Pin ! = NULL & &
Pin ! = ExecutePin & &
Pin - > Direction = = EGPD_Output & &
Pin - > PinType . PinCategory = = Schema - > PC_Exec )
{
// Move connections from fake 'enum exec' pint to this switch node
CompilerContext . MovePinLinksToIntermediate ( * Pin , * SwitchEnumNode - > FindPinChecked ( Pin - > PinName ) ) ;
2014-06-09 11:11:12 -04:00
2014-10-17 06:37:11 -04:00
// Finally remove this 'cosmetic' exec pin
Pins . RemoveAt ( PinIdx ) ;
2014-03-14 14:13:41 -04:00
}
}
}
}
}
2014-10-17 06:37:11 -04:00
}
2014-03-14 14:13:41 -04:00
2014-10-17 06:37:11 -04:00
// AUTO CREATED REFS
{
if ( Function )
2014-10-09 06:06:10 -04:00
{
2014-10-17 06:37:11 -04:00
TArray < FString > AutoCreateRefTermPinNames ;
const bool bHasAutoCreateRefTerms = Function - > HasMetaData ( FBlueprintMetadata : : MD_AutoCreateRefTerm ) ;
if ( bHasAutoCreateRefTerms )
2014-10-09 06:06:10 -04:00
{
2014-10-17 06:37:11 -04:00
CompilerContext . GetSchema ( ) - > GetAutoEmitTermParameters ( Function , AutoCreateRefTermPinNames ) ;
}
2014-10-09 06:06:10 -04:00
2014-10-17 06:37:11 -04:00
for ( auto Pin : Pins )
{
if ( Pin & & bHasAutoCreateRefTerms & & AutoCreateRefTermPinNames . Contains ( Pin - > PinName ) )
2014-10-09 11:28:08 -04:00
{
2014-10-17 06:37:11 -04:00
const bool bValidAutoRefPin = Pin - > PinType . bIsReference
& & ! CompilerContext . GetSchema ( ) - > IsMetaPin ( * Pin )
& & ( Pin - > Direction = = EGPD_Input )
2015-03-26 21:41:40 -04:00
& & ! Pin - > LinkedTo . Num ( ) ;
2014-10-17 06:37:11 -04:00
if ( bValidAutoRefPin )
2014-10-09 11:28:08 -04:00
{
2015-03-26 21:41:40 -04:00
const bool bHasDefaultValue = ! Pin - > DefaultValue . IsEmpty ( ) | | Pin - > DefaultObject | | ! Pin - > DefaultTextValue . IsEmpty ( ) ;
2014-10-17 06:37:11 -04:00
//default values can be reset when the pin is connected
const auto DefaultValue = Pin - > DefaultValue ;
const auto DefaultObject = Pin - > DefaultObject ;
const auto DefaultTextValue = Pin - > DefaultTextValue ;
2014-11-20 15:51:13 -05:00
const auto AutogeneratedDefaultValue = Pin - > AutogeneratedDefaultValue ;
2014-10-09 11:28:08 -04:00
2014-10-17 06:37:11 -04:00
auto ValuePin = InnerHandleAutoCreateRef ( this , Pin , CompilerContext , SourceGraph , bHasDefaultValue ) ;
if ( ValuePin )
{
2016-02-01 14:57:29 -05:00
if ( ! DefaultObject & & DefaultTextValue . IsEmpty ( ) & & DefaultValue . Equals ( AutogeneratedDefaultValue , ESearchCase : : CaseSensitive ) )
2014-11-20 15:51:13 -05:00
{
// Use the latest code to set default value
Schema - > SetPinDefaultValueBasedOnType ( ValuePin ) ;
}
else
{
ValuePin - > DefaultValue = DefaultValue ;
ValuePin - > DefaultObject = DefaultObject ;
ValuePin - > DefaultTextValue = DefaultTextValue ;
}
2014-10-09 06:06:10 -04:00
}
}
}
}
}
2014-10-17 06:37:11 -04:00
}
2014-10-09 06:06:10 -04:00
2014-10-17 06:37:11 -04:00
// Then we go through and expand out array iteration if necessary
const bool bAllowMultipleSelfs = AllowMultipleSelfs ( true ) ;
UEdGraphPin * MultiSelf = Schema - > FindSelfPin ( * this , EEdGraphPinDirection : : EGPD_Input ) ;
if ( bAllowMultipleSelfs & & MultiSelf & & ! MultiSelf - > PinType . bIsArray )
{
const bool bProperInputToExpandForEach =
( 1 = = MultiSelf - > LinkedTo . Num ( ) ) & &
( NULL ! = MultiSelf - > LinkedTo [ 0 ] ) & &
( MultiSelf - > LinkedTo [ 0 ] - > PinType . bIsArray ) ;
if ( bProperInputToExpandForEach )
2014-03-14 14:13:41 -04:00
{
2014-10-17 06:37:11 -04:00
CallForEachElementInArrayExpansion ( this , MultiSelf , CompilerContext , SourceGraph ) ;
2014-03-14 14:13:41 -04:00
}
}
}
2014-10-09 06:06:10 -04:00
UEdGraphPin * UK2Node_CallFunction : : InnerHandleAutoCreateRef ( UK2Node * Node , UEdGraphPin * Pin , FKismetCompilerContext & CompilerContext , UEdGraph * SourceGraph , bool bForceAssignment )
{
const bool bAddAssigment = ! Pin - > PinType . bIsArray & & bForceAssignment ;
// ADD LOCAL VARIABLE
UK2Node_TemporaryVariable * LocalVariable = CompilerContext . SpawnIntermediateNode < UK2Node_TemporaryVariable > ( Node , SourceGraph ) ;
LocalVariable - > VariableType = Pin - > PinType ;
LocalVariable - > VariableType . bIsReference = false ;
LocalVariable - > AllocateDefaultPins ( ) ;
if ( ! bAddAssigment )
{
if ( ! CompilerContext . GetSchema ( ) - > TryCreateConnection ( LocalVariable - > GetVariablePin ( ) , Pin ) )
{
CompilerContext . MessageLog . Error ( * LOCTEXT ( " AutoCreateRefTermPin_NotConnected " , " AutoCreateRefTerm Expansion: Pin @@ cannot be connected to @@ " ) . ToString ( ) , LocalVariable - > GetVariablePin ( ) , Pin ) ;
return NULL ;
}
}
// ADD ASSIGMENT
else
{
// TODO connect to dest..
UK2Node_PureAssignmentStatement * AssignDefaultValue = CompilerContext . SpawnIntermediateNode < UK2Node_PureAssignmentStatement > ( Node , SourceGraph ) ;
AssignDefaultValue - > AllocateDefaultPins ( ) ;
const bool bVariableConnected = CompilerContext . GetSchema ( ) - > TryCreateConnection ( AssignDefaultValue - > GetVariablePin ( ) , LocalVariable - > GetVariablePin ( ) ) ;
2015-07-14 06:57:53 -04:00
auto AssignInputPit = AssignDefaultValue - > GetValuePin ( ) ;
const bool bPreviousInputSaved = AssignInputPit & & CompilerContext . MovePinLinksToIntermediate ( * Pin , * AssignInputPit ) . CanSafeConnect ( ) ;
2014-10-09 06:06:10 -04:00
const bool bOutputConnected = CompilerContext . GetSchema ( ) - > TryCreateConnection ( AssignDefaultValue - > GetOutputPin ( ) , Pin ) ;
2015-07-14 06:57:53 -04:00
if ( ! bVariableConnected | | ! bOutputConnected | | ! bPreviousInputSaved )
2014-10-09 06:06:10 -04:00
{
CompilerContext . MessageLog . Error ( * LOCTEXT ( " AutoCreateRefTermPin_AssignmentError " , " AutoCreateRefTerm Expansion: Assignment Error @@ " ) . ToString ( ) , AssignDefaultValue ) ;
return NULL ;
}
CompilerContext . GetSchema ( ) - > SetPinDefaultValueBasedOnType ( AssignDefaultValue - > GetValuePin ( ) ) ;
2015-07-14 06:57:53 -04:00
return AssignInputPit ;
2014-10-09 06:06:10 -04:00
}
return NULL ;
}
2014-03-14 14:13:41 -04:00
void UK2Node_CallFunction : : CallForEachElementInArrayExpansion ( UK2Node * Node , UEdGraphPin * MultiSelf , FKismetCompilerContext & CompilerContext , UEdGraph * SourceGraph )
{
const UEdGraphSchema_K2 * Schema = CompilerContext . GetSchema ( ) ;
check ( Node & & MultiSelf & & SourceGraph & & Schema ) ;
const bool bProperInputToExpandForEach =
( 1 = = MultiSelf - > LinkedTo . Num ( ) ) & &
( NULL ! = MultiSelf - > LinkedTo [ 0 ] ) & &
( MultiSelf - > LinkedTo [ 0 ] - > PinType . bIsArray ) ;
ensure ( bProperInputToExpandForEach ) ;
UEdGraphPin * ThenPin = Node - > FindPinChecked ( Schema - > PN_Then ) ;
// Create int Iterator
UK2Node_TemporaryVariable * IteratorVar = CompilerContext . SpawnIntermediateNode < UK2Node_TemporaryVariable > ( Node , SourceGraph ) ;
IteratorVar - > VariableType . PinCategory = Schema - > PC_Int ;
IteratorVar - > AllocateDefaultPins ( ) ;
// Initialize iterator
UK2Node_AssignmentStatement * InteratorInitialize = CompilerContext . SpawnIntermediateNode < UK2Node_AssignmentStatement > ( Node , SourceGraph ) ;
InteratorInitialize - > AllocateDefaultPins ( ) ;
InteratorInitialize - > GetValuePin ( ) - > DefaultValue = TEXT ( " 0 " ) ;
Schema - > TryCreateConnection ( IteratorVar - > GetVariablePin ( ) , InteratorInitialize - > GetVariablePin ( ) ) ;
2014-04-23 17:45:37 -04:00
CompilerContext . MovePinLinksToIntermediate ( * Node - > GetExecPin ( ) , * InteratorInitialize - > GetExecPin ( ) ) ;
2014-03-14 14:13:41 -04:00
// Do loop branch
UK2Node_IfThenElse * Branch = CompilerContext . SpawnIntermediateNode < UK2Node_IfThenElse > ( Node , SourceGraph ) ;
Branch - > AllocateDefaultPins ( ) ;
Schema - > TryCreateConnection ( InteratorInitialize - > GetThenPin ( ) , Branch - > GetExecPin ( ) ) ;
2014-04-23 17:45:37 -04:00
CompilerContext . MovePinLinksToIntermediate ( * ThenPin , * Branch - > GetElsePin ( ) ) ;
2014-03-14 14:13:41 -04:00
// Do loop condition
UK2Node_CallFunction * Condition = CompilerContext . SpawnIntermediateNode < UK2Node_CallFunction > ( Node , SourceGraph ) ;
2015-06-05 11:45:49 -04:00
Condition - > SetFromFunction ( UKismetMathLibrary : : StaticClass ( ) - > FindFunctionByName ( GET_FUNCTION_NAME_CHECKED ( UKismetMathLibrary , Less_IntInt ) ) ) ;
2014-03-14 14:13:41 -04:00
Condition - > AllocateDefaultPins ( ) ;
Schema - > TryCreateConnection ( Condition - > GetReturnValuePin ( ) , Branch - > GetConditionPin ( ) ) ;
Schema - > TryCreateConnection ( Condition - > FindPinChecked ( TEXT ( " A " ) ) , IteratorVar - > GetVariablePin ( ) ) ;
// Array size
UK2Node_CallArrayFunction * ArrayLength = CompilerContext . SpawnIntermediateNode < UK2Node_CallArrayFunction > ( Node , SourceGraph ) ;
2015-06-05 11:45:49 -04:00
ArrayLength - > SetFromFunction ( UKismetArrayLibrary : : StaticClass ( ) - > FindFunctionByName ( GET_FUNCTION_NAME_CHECKED ( UKismetArrayLibrary , Array_Length ) ) ) ;
2014-03-14 14:13:41 -04:00
ArrayLength - > AllocateDefaultPins ( ) ;
2014-04-23 17:45:37 -04:00
CompilerContext . CopyPinLinksToIntermediate ( * MultiSelf , * ArrayLength - > GetTargetArrayPin ( ) ) ;
2014-03-14 14:13:41 -04:00
ArrayLength - > PinConnectionListChanged ( ArrayLength - > GetTargetArrayPin ( ) ) ;
Schema - > TryCreateConnection ( Condition - > FindPinChecked ( TEXT ( " B " ) ) , ArrayLength - > GetReturnValuePin ( ) ) ;
// Get Element
UK2Node_CallArrayFunction * GetElement = CompilerContext . SpawnIntermediateNode < UK2Node_CallArrayFunction > ( Node , SourceGraph ) ;
2015-06-05 11:45:49 -04:00
GetElement - > SetFromFunction ( UKismetArrayLibrary : : StaticClass ( ) - > FindFunctionByName ( GET_FUNCTION_NAME_CHECKED ( UKismetArrayLibrary , Array_Get ) ) ) ;
2014-03-14 14:13:41 -04:00
GetElement - > AllocateDefaultPins ( ) ;
2014-04-23 17:45:37 -04:00
CompilerContext . CopyPinLinksToIntermediate ( * MultiSelf , * GetElement - > GetTargetArrayPin ( ) ) ;
2014-03-14 14:13:41 -04:00
GetElement - > PinConnectionListChanged ( GetElement - > GetTargetArrayPin ( ) ) ;
Schema - > TryCreateConnection ( GetElement - > FindPinChecked ( TEXT ( " Index " ) ) , IteratorVar - > GetVariablePin ( ) ) ;
// Iterator increment
UK2Node_CallFunction * Increment = CompilerContext . SpawnIntermediateNode < UK2Node_CallFunction > ( Node , SourceGraph ) ;
2015-06-05 11:45:49 -04:00
Increment - > SetFromFunction ( UKismetMathLibrary : : StaticClass ( ) - > FindFunctionByName ( GET_FUNCTION_NAME_CHECKED ( UKismetMathLibrary , Add_IntInt ) ) ) ;
2014-03-14 14:13:41 -04:00
Increment - > AllocateDefaultPins ( ) ;
Schema - > TryCreateConnection ( Increment - > FindPinChecked ( TEXT ( " A " ) ) , IteratorVar - > GetVariablePin ( ) ) ;
Increment - > FindPinChecked ( TEXT ( " B " ) ) - > DefaultValue = TEXT ( " 1 " ) ;
// Iterator assigned
UK2Node_AssignmentStatement * IteratorAssign = CompilerContext . SpawnIntermediateNode < UK2Node_AssignmentStatement > ( Node , SourceGraph ) ;
IteratorAssign - > AllocateDefaultPins ( ) ;
Schema - > TryCreateConnection ( IteratorAssign - > GetVariablePin ( ) , IteratorVar - > GetVariablePin ( ) ) ;
Schema - > TryCreateConnection ( IteratorAssign - > GetValuePin ( ) , Increment - > GetReturnValuePin ( ) ) ;
Schema - > TryCreateConnection ( IteratorAssign - > GetThenPin ( ) , Branch - > GetExecPin ( ) ) ;
// Connect pins from intermediate nodes back in to the original node
Schema - > TryCreateConnection ( Branch - > GetThenPin ( ) , Node - > GetExecPin ( ) ) ;
Schema - > TryCreateConnection ( ThenPin , IteratorAssign - > GetExecPin ( ) ) ;
Schema - > TryCreateConnection ( GetElement - > FindPinChecked ( TEXT ( " Item " ) ) , MultiSelf ) ;
}
FName UK2Node_CallFunction : : GetCornerIcon ( ) const
{
if ( const UFunction * Function = GetTargetFunction ( ) )
{
if ( Function - > HasAllFunctionFlags ( FUNC_BlueprintAuthorityOnly ) )
{
return TEXT ( " Graph.Replication.AuthorityOnly " ) ;
}
else if ( Function - > HasAllFunctionFlags ( FUNC_BlueprintCosmetic ) )
{
return TEXT ( " Graph.Replication.ClientEvent " ) ;
}
else if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_Latent ) )
{
return TEXT ( " Graph.Latent.LatentIcon " ) ;
}
}
return Super : : GetCornerIcon ( ) ;
}
FName UK2Node_CallFunction : : GetPaletteIcon ( FLinearColor & OutColor ) const
{
2014-09-12 12:56:24 -04:00
return GetPaletteIconForFunction ( GetTargetFunction ( ) , OutColor ) ;
2014-03-14 14:13:41 -04:00
}
2015-01-15 12:10:46 -05:00
bool UK2Node_CallFunction : : ReconnectPureExecPins ( TArray < UEdGraphPin * > & OldPins )
{
2015-02-10 13:23:04 -05:00
if ( IsNodePure ( ) )
2015-01-15 12:10:46 -05:00
{
// look for an old exec pin
const UEdGraphSchema_K2 * K2Schema = GetDefault < UEdGraphSchema_K2 > ( ) ;
UEdGraphPin * PinExec = nullptr ;
for ( int32 PinIdx = 0 ; PinIdx < OldPins . Num ( ) ; PinIdx + + )
{
if ( OldPins [ PinIdx ] - > PinName = = K2Schema - > PN_Execute )
{
PinExec = OldPins [ PinIdx ] ;
break ;
}
}
if ( PinExec )
{
// look for old then pin
UEdGraphPin * PinThen = nullptr ;
for ( int32 PinIdx = 0 ; PinIdx < OldPins . Num ( ) ; PinIdx + + )
{
if ( OldPins [ PinIdx ] - > PinName = = K2Schema - > PN_Then )
{
PinThen = OldPins [ PinIdx ] ;
break ;
}
}
if ( PinThen )
{
// reconnect all incoming links to old exec pin to the far end of the old then pin.
if ( PinThen - > LinkedTo . Num ( ) > 0 )
{
UEdGraphPin * PinThenLinked = PinThen - > LinkedTo [ 0 ] ;
while ( PinExec - > LinkedTo . Num ( ) > 0 )
{
UEdGraphPin * PinExecLinked = PinExec - > LinkedTo [ 0 ] ;
PinExecLinked - > BreakLinkTo ( PinExec ) ;
PinExecLinked - > MakeLinkTo ( PinThenLinked ) ;
}
return true ;
}
}
}
}
return false ;
}
2015-05-27 17:51:08 -04:00
void UK2Node_CallFunction : : InvalidatePinTooltips ( )
{
bPinTooltipsValid = false ;
}
2014-03-14 14:13:41 -04:00
FText UK2Node_CallFunction : : GetToolTipHeading ( ) const
{
FText Heading = Super : : GetToolTipHeading ( ) ;
struct FHeadingBuilder
{
FHeadingBuilder ( FText InitialHeading ) : ConstructedHeading ( InitialHeading ) { }
void Append ( FText HeadingAddOn )
{
if ( ConstructedHeading . IsEmpty ( ) )
{
ConstructedHeading = HeadingAddOn ;
}
else
{
ConstructedHeading = FText : : Format ( FText : : FromString ( " {0} \n {1} " ) , HeadingAddOn , ConstructedHeading ) ;
}
}
FText ConstructedHeading ;
} ;
FHeadingBuilder HeadingBuilder ( Super : : GetToolTipHeading ( ) ) ;
if ( const UFunction * Function = GetTargetFunction ( ) )
{
if ( Function - > HasAllFunctionFlags ( FUNC_BlueprintAuthorityOnly ) )
{
HeadingBuilder . Append ( LOCTEXT ( " ServerOnlyFunc " , " Server Only " ) ) ;
}
if ( Function - > HasAllFunctionFlags ( FUNC_BlueprintCosmetic ) )
{
HeadingBuilder . Append ( LOCTEXT ( " ClientOnlyFunc " , " Client Only " ) ) ;
}
if ( Function - > HasMetaData ( FBlueprintMetadata : : MD_Latent ) )
{
HeadingBuilder . Append ( LOCTEXT ( " LatentFunc " , " Latent " ) ) ;
}
}
return HeadingBuilder . ConstructedHeading ;
}
2014-06-06 18:51:05 -04:00
void UK2Node_CallFunction : : GetNodeAttributes ( TArray < TKeyValuePair < FString , FString > > & OutNodeAttributes ) const
{
UFunction * TargetFunction = GetTargetFunction ( ) ;
const FString TargetFunctionName = TargetFunction ? TargetFunction - > GetName ( ) : TEXT ( " InvalidFunction " ) ;
OutNodeAttributes . Add ( TKeyValuePair < FString , FString > ( TEXT ( " Type " ) , TEXT ( " Function " ) ) ) ;
OutNodeAttributes . Add ( TKeyValuePair < FString , FString > ( TEXT ( " Class " ) , GetClass ( ) - > GetName ( ) ) ) ;
OutNodeAttributes . Add ( TKeyValuePair < FString , FString > ( TEXT ( " Name " ) , TargetFunctionName ) ) ;
}
2014-07-14 16:15:27 -04:00
FText UK2Node_CallFunction : : GetMenuCategory ( ) const
{
UFunction * TargetFunction = GetTargetFunction ( ) ;
2014-09-29 14:31:08 -04:00
if ( TargetFunction ! = nullptr )
{
2015-05-08 10:46:42 -04:00
return GetDefaultCategoryForFunction ( TargetFunction , FText : : GetEmpty ( ) ) ;
2014-09-29 14:31:08 -04:00
}
return FText : : GetEmpty ( ) ;
2014-07-14 16:15:27 -04:00
}
2015-04-25 17:47:39 -04:00
bool UK2Node_CallFunction : : HasExternalDependencies ( TArray < class UStruct * > * OptionalOutput ) const
2014-03-14 14:13:41 -04:00
{
2015-04-25 16:18:36 -04:00
UFunction * Function = GetTargetFunction ( ) ;
const UClass * SourceClass = Function ? Function - > GetOwnerClass ( ) : nullptr ;
2014-03-14 14:13:41 -04:00
const UBlueprint * SourceBlueprint = GetBlueprint ( ) ;
2015-09-23 05:35:44 -04:00
bool bResult = ( SourceClass ! = nullptr ) & & ( SourceClass - > ClassGeneratedBy ! = SourceBlueprint ) ;
2014-03-14 14:13:41 -04:00
if ( bResult & & OptionalOutput )
{
2015-04-25 16:18:36 -04:00
OptionalOutput - > AddUnique ( Function ) ;
2014-03-14 14:13:41 -04:00
}
2015-04-25 17:47:39 -04:00
2015-09-23 05:35:44 -04:00
// All structures, that are required for the BP compilation, should be gathered
for ( auto Pin : Pins )
{
UStruct * DepStruct = Pin ? Cast < UStruct > ( Pin - > PinType . PinSubCategoryObject . Get ( ) ) : nullptr ;
UClass * DepClass = Cast < UClass > ( DepStruct ) ;
if ( DepClass & & ( DepClass - > ClassGeneratedBy = = SourceBlueprint ) )
{
//Don't include self
continue ;
}
2015-11-18 16:20:49 -05:00
if ( DepStruct & & ! DepStruct - > IsNative ( ) )
2015-09-23 05:35:44 -04:00
{
if ( OptionalOutput )
{
OptionalOutput - > AddUnique ( DepStruct ) ;
}
bResult = true ;
}
}
2015-04-25 17:47:39 -04:00
const bool bSuperResult = Super : : HasExternalDependencies ( OptionalOutput ) ;
return bSuperResult | | bResult ;
2014-03-14 14:13:41 -04:00
}
2014-08-25 15:47:12 -04:00
UEdGraph * UK2Node_CallFunction : : GetFunctionGraph ( const UEdGraphNode * & OutGraphNode ) const
2014-03-14 14:13:41 -04:00
{
2014-08-25 15:47:12 -04:00
OutGraphNode = NULL ;
// Search for the Blueprint owner of the function graph, climbing up through the Blueprint hierarchy
2015-03-12 14:17:48 -04:00
UClass * MemberParentClass = FunctionReference . GetMemberParentClass ( GetBlueprintClassFromNode ( ) ) ;
2014-08-25 15:47:12 -04:00
if ( MemberParentClass ! = NULL )
{
UBlueprintGeneratedClass * ParentClass = Cast < UBlueprintGeneratedClass > ( MemberParentClass ) ;
if ( ParentClass ! = NULL & & ParentClass - > ClassGeneratedBy ! = NULL )
{
UBlueprint * Blueprint = Cast < UBlueprint > ( ParentClass - > ClassGeneratedBy ) ;
while ( Blueprint ! = NULL )
{
UEdGraph * TargetGraph = FindObject < UEdGraph > ( Blueprint , * ( FunctionReference . GetMemberName ( ) . ToString ( ) ) ) ;
if ( ( TargetGraph ! = NULL ) & & ! TargetGraph - > HasAnyFlags ( RF_Transient ) )
{
// Found the function graph in a Blueprint, return that graph
return TargetGraph ;
}
else
{
// Did not find the function call as a graph, it may be a custom event
UK2Node_CustomEvent * CustomEventNode = NULL ;
TArray < UK2Node_CustomEvent * > CustomEventNodes ;
FBlueprintEditorUtils : : GetAllNodesOfClass ( Blueprint , CustomEventNodes ) ;
for ( UK2Node_CustomEvent * CustomEvent : CustomEventNodes )
{
if ( CustomEvent - > CustomFunctionName = = FunctionReference . GetMemberName ( ) )
{
OutGraphNode = CustomEvent ;
return CustomEvent - > GetGraph ( ) ;
}
}
}
ParentClass = Cast < UBlueprintGeneratedClass > ( Blueprint - > ParentClass ) ;
Blueprint = ParentClass ! = NULL ? Cast < UBlueprint > ( ParentClass - > ClassGeneratedBy ) : NULL ;
}
}
}
return NULL ;
2014-03-14 14:13:41 -04:00
}
2014-04-23 20:18:55 -04:00
bool UK2Node_CallFunction : : IsStructureWildcardProperty ( const UFunction * Function , const FString & PropertyName )
{
if ( Function & & ! PropertyName . IsEmpty ( ) )
{
TArray < FString > Names ;
FCustomStructureParamHelper : : FillCustomStructureParameterNames ( Function , Names ) ;
if ( Names . Contains ( PropertyName ) )
{
return true ;
}
}
return false ;
}
2015-06-01 14:36:32 -04:00
void UK2Node_CallFunction : : AddSearchMetaDataInfo ( TArray < struct FSearchTagDataPair > & OutTaggedMetaData ) const
{
Super : : AddSearchMetaDataInfo ( OutTaggedMetaData ) ;
if ( UFunction * TargetFunction = GetTargetFunction ( ) )
{
OutTaggedMetaData . Add ( FSearchTagDataPair ( FFindInBlueprintSearchTags : : FiB_NativeName , FText : : FromString ( TargetFunction - > GetName ( ) ) ) ) ;
}
}
2015-06-30 14:42:07 -04:00
bool UK2Node_CallFunction : : IsConnectionDisallowed ( const UEdGraphPin * MyPin , const UEdGraphPin * OtherPin , FString & OutReason ) const
{
bool bIsDisallowed = Super : : IsConnectionDisallowed ( MyPin , OtherPin , OutReason ) ;
if ( ! bIsDisallowed & & MyPin ! = nullptr )
{
if ( MyPin - > bNotConnectable )
{
bIsDisallowed = true ;
OutReason = LOCTEXT ( " PinConnectionDisallowed " , " This parameter is for internal use only. " ) . ToString ( ) ;
}
}
return bIsDisallowed ;
}
2014-03-14 14:13:41 -04:00
# undef LOCTEXT_NAMESPACE