2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "GraphEditorCommon.h"
|
|
|
|
|
|
|
|
|
|
#include "UnrealEd.h"
|
|
|
|
|
|
|
|
|
|
#include "NodeFactory.h"
|
|
|
|
|
|
|
|
|
|
#include "SGraphNodeDefault.h"
|
|
|
|
|
#include "SGraphNodeComment.h"
|
Added a new documentation node to the blueprints to display udn documentation excerpts in the grapheditor.
#TTP 312311 - ROCKET: TASK: Add a "Documentation Node"
#Branch UE4
#Proj BlueprintGraph, EdGraph, Kismet, KismetCompiler, GraphEditor, Documentation, EditorStyle
#Change Updated UEdGraphSchema to include an interface call to retrieve an FEdGraphSchemaAction to create documentation nodes. At this point only the K2 interfaces implement this.
#Change Updated UEdGraphSchema_K2 to include a call to retrieve an FEdGraphSchemaAction to create documentation nodes. This is used to add the actions to the blueprint palette and context menus.
#Add Added FEdGraphSchemaAction_K2AddDocumentation in EdGraphSchema_K2_Actions.h/cpp to implement the calls in UEdGraphSchema to create documenation nodes from palette and context menus.
#Change Modified FK2ActionMenuBuilder to provide a static call to create a documentation action in the same style as the comment. Additionally added calls to FK2ActionMenuBuilder::GetPaletteActions and FK2ActionMenuBuilder::GetContextAllowedNodeTypes to call this to add entries in the palette and context menus.
#Add Added a new Brush GraphEditor.Documentation_16x, for the context menu icon in SlateEditorStyle.cpp.
#Change Modified GetPaletteItemIcon in SBlueprintPalette.cpp to return the new icon for the DocumentationNode
#Change Modified FKismetCompilerContext::IsNodePure to include the Documentaton node in the drop through ensure test to prevent asserts on compling if a documentation node is present.
#Change Added an entry for Documentation node in FNodeFactory::CreateNodeWidget.
#Change Modified IDocumentationPage interface to provide the ability to provide a TextWrapAt Attribute so this can be set before creating excerpt content if desired.
#Change Modified the UDNParser to control text wrap at values in the created widgets using a float Attribute WrapAt, Added a set call in the DocumentationPage and made the default behaviour mimic the code it replaced.
#Add Added the class UEdGraphNode_Documentation implemented in EdGraphNode_Documentation.h and UEdGraph.cpp, this is the UObject implementation for the documentation nodes.
#Add Added the class SGraphNodeDocumentation as the GraphPanel implementation of the EdGraphNode_Documentation.
#Change Moved the resizable code from SGraphNodeComment into a SGraphNodeResizable and changed SGraphNodeComment and SGraphNodeDocumentation inherit from it to avoid duplicating code.
#Change Added a documentation specific details customisation so the excerpts can be displayed as combo button.
#Change Added FBlueprintDocumentationDetails into BlueprintDetailsCustomization.h/cpp to handle the user interaction with the documentation node in the BP Editor.
ReviewedBy Chris.Wood, Mike.Beach
[CL 2247425 by Ben Cosh in Main branch]
2014-08-07 15:33:55 -04:00
|
|
|
#include "SGraphNodeDocumentation.h"
|
|
|
|
|
#include "EdGraph/EdGraphNode_Documentation.h"
|
2014-05-15 17:34:14 -04:00
|
|
|
#include "SGraphNodeKnot.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Base.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Default.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Var.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Terminator.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Composite.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeSwitchStatement.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Sequence.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Timeline.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeSpawnActor.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeSpawnActorFromClass.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2CreateDelegate.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeCallParameterCollectionFunction.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2Event.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeFormatText.h"
|
|
|
|
|
#include "KismetNodes/SGraphNodeK2ArrayFunction.h"
|
|
|
|
|
|
2014-04-24 08:49:31 -04:00
|
|
|
#include "AnimGraphNode_Root.h"
|
|
|
|
|
#include "AnimGraphNode_SequencePlayer.h"
|
2014-04-24 14:34:01 -04:00
|
|
|
#include "AnimGraphNode_StateMachineBase.h"
|
2014-10-01 09:43:43 -04:00
|
|
|
#include "AnimGraphNode_LayeredBoneBlend.h"
|
2014-04-24 08:49:31 -04:00
|
|
|
#include "AnimStateNode.h"
|
2014-04-24 14:34:01 -04:00
|
|
|
#include "AnimStateEntryNode.h"
|
|
|
|
|
#include "AnimStateConduitNode.h"
|
|
|
|
|
#include "AnimStateTransitionNode.h"
|
2014-04-24 08:49:31 -04:00
|
|
|
|
|
|
|
|
#include "AnimationStateMachineSchema.h"
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "AnimationStateNodes/SGraphNodeAnimState.h"
|
|
|
|
|
#include "AnimationStateNodes/SGraphNodeAnimTransition.h"
|
|
|
|
|
#include "AnimationStateNodes/SGraphNodeAnimStateEntry.h"
|
|
|
|
|
|
|
|
|
|
#include "AnimationNodes/SGraphNodeSequencePlayer.h"
|
|
|
|
|
#include "AnimationNodes/SGraphNodeAnimationResult.h"
|
|
|
|
|
#include "AnimationNodes/SGraphNodeStateMachineInstance.h"
|
2014-10-01 09:43:43 -04:00
|
|
|
#include "AnimationNodes/SGraphNodeLayeredBoneBlend.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "AnimationPins/SGraphPinPose.h"
|
|
|
|
|
|
|
|
|
|
#include "KismetPins/SGraphPinBool.h"
|
|
|
|
|
#include "KismetPins/SGraphPinString.h"
|
|
|
|
|
#include "KismetPins/SGraphPinText.h"
|
|
|
|
|
#include "KismetPins/SGraphPinObject.h"
|
|
|
|
|
#include "KismetPins/SGraphPinClass.h"
|
|
|
|
|
#include "KismetPins/SGraphPinExec.h"
|
|
|
|
|
#include "KismetPins/SGraphPinNum.h"
|
2015-03-19 18:56:54 -04:00
|
|
|
#include "KismetPins/SGraphPinInteger.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "KismetPins/SGraphPinColor.h"
|
|
|
|
|
#include "KismetPins/SGraphPinEnum.h"
|
|
|
|
|
#include "KismetPins/SGraphPinKey.h"
|
|
|
|
|
#include "KismetPins/SGraphPinVector.h"
|
|
|
|
|
#include "KismetPins/SGraphPinVector2D.h"
|
2014-07-28 13:15:12 -04:00
|
|
|
#include "NiagaraPins/SGraphPinVector4.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "KismetPins/SGraphPinIndex.h"
|
2014-11-19 11:55:51 -05:00
|
|
|
#include "KismetPins/SGraphPinCollisionProfile.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
#include "SoundNodes/SGraphNodeSoundBase.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "SoundNodes/SGraphNodeSoundResult.h"
|
|
|
|
|
|
|
|
|
|
#include "MaterialNodes/SGraphNodeMaterialBase.h"
|
|
|
|
|
#include "MaterialNodes/SGraphNodeMaterialComment.h"
|
|
|
|
|
#include "MaterialNodes/SGraphNodeMaterialResult.h"
|
|
|
|
|
|
|
|
|
|
#include "MaterialPins/SGraphPinMaterialInput.h"
|
|
|
|
|
|
|
|
|
|
#include "EdGraphUtilities.h"
|
|
|
|
|
|
|
|
|
|
TSharedPtr<SGraphNode> FNodeFactory::CreateNodeWidget(UEdGraphNode* InNode)
|
|
|
|
|
{
|
|
|
|
|
check(InNode != NULL);
|
|
|
|
|
|
|
|
|
|
// First give a shot to the registered node factories
|
|
|
|
|
for (auto FactoryIt = FEdGraphUtilities::VisualNodeFactories.CreateIterator(); FactoryIt; ++FactoryIt)
|
|
|
|
|
{
|
|
|
|
|
TSharedPtr<FGraphPanelNodeFactory> FactoryPtr = *FactoryIt;
|
|
|
|
|
if (FactoryPtr.IsValid())
|
|
|
|
|
{
|
|
|
|
|
TSharedPtr<SGraphNode> ResultVisualNode = FactoryPtr->CreateNode(InNode);
|
|
|
|
|
if (ResultVisualNode.IsValid())
|
|
|
|
|
{
|
|
|
|
|
return ResultVisualNode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//@TODO: Fold all of this code into registered factories for the various schemas!
|
|
|
|
|
if (UAnimGraphNode_Base* BaseAnimNode = Cast<UAnimGraphNode_Base>(InNode))
|
|
|
|
|
{
|
|
|
|
|
if (UAnimGraphNode_Root* RootAnimNode = Cast<UAnimGraphNode_Root>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeAnimationResult, RootAnimNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UAnimGraphNode_StateMachineBase* StateMachineInstance = Cast<UAnimGraphNode_StateMachineBase>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeStateMachineInstance, StateMachineInstance);
|
|
|
|
|
}
|
|
|
|
|
else if (UAnimGraphNode_SequencePlayer* SequencePlayer = Cast<UAnimGraphNode_SequencePlayer>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeSequencePlayer, SequencePlayer);
|
|
|
|
|
}
|
2014-10-01 09:43:43 -04:00
|
|
|
else if (UAnimGraphNode_LayeredBoneBlend* LayeredBlend = Cast<UAnimGraphNode_LayeredBoneBlend>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeLayeredBoneBlend, LayeredBlend);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (USoundCueGraphNode_Base* BaseSoundNode = Cast<USoundCueGraphNode_Base>(InNode))
|
|
|
|
|
{
|
|
|
|
|
if (USoundCueGraphNode_Root* RootSoundNode = Cast<USoundCueGraphNode_Root>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeSoundResult, RootSoundNode);
|
|
|
|
|
}
|
2014-04-02 18:09:23 -04:00
|
|
|
else if (USoundCueGraphNode* SoundNode = Cast<USoundCueGraphNode>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeSoundBase, SoundNode);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (UMaterialGraphNode_Base* BaseMaterialNode = Cast<UMaterialGraphNode_Base>(InNode))
|
|
|
|
|
{
|
|
|
|
|
if (UMaterialGraphNode_Root* RootMaterialNode = Cast<UMaterialGraphNode_Root>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeMaterialResult, RootMaterialNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UMaterialGraphNode* MaterialNode = Cast<UMaterialGraphNode>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeMaterialBase, MaterialNode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (UK2Node* K2Node = Cast<UK2Node>(InNode))
|
|
|
|
|
{
|
|
|
|
|
if (UK2Node_Composite* CompositeNode = Cast<UK2Node_Composite>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Composite, CompositeNode);
|
|
|
|
|
}
|
|
|
|
|
else if (K2Node->DrawNodeAsVariable())
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Var, K2Node);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_Switch* SwitchNode = Cast<UK2Node_Switch>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeSwitchStatement, SwitchNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_ExecutionSequence* SequenceNode = Cast<UK2Node_ExecutionSequence>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Sequence, SequenceNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_MakeArray* MakeArrayNode = Cast<UK2Node_MakeArray>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Sequence, MakeArrayNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_CommutativeAssociativeBinaryOperator* OperatorNode = Cast<UK2Node_CommutativeAssociativeBinaryOperator>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Sequence, OperatorNode);
|
|
|
|
|
}
|
2014-06-04 13:51:09 -04:00
|
|
|
else if (UK2Node_DoOnceMultiInput* DoOnceMultiInputNode = Cast<UK2Node_DoOnceMultiInput>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Sequence, DoOnceMultiInputNode);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
else if (UK2Node_Timeline* TimelineNode = Cast<UK2Node_Timeline>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Timeline, TimelineNode);
|
|
|
|
|
}
|
|
|
|
|
else if(UK2Node_SpawnActor* SpawnActorNode = Cast<UK2Node_SpawnActor>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeSpawnActor, SpawnActorNode);
|
|
|
|
|
}
|
|
|
|
|
else if(UK2Node_SpawnActorFromClass* SpawnActorNodeFromClass = Cast<UK2Node_SpawnActorFromClass>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeSpawnActorFromClass, SpawnActorNodeFromClass);
|
|
|
|
|
}
|
|
|
|
|
else if(UK2Node_CreateDelegate* CreateDelegateNode = Cast<UK2Node_CreateDelegate>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2CreateDelegate, CreateDelegateNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_CallMaterialParameterCollectionFunction* CallFunctionNode = Cast<UK2Node_CallMaterialParameterCollectionFunction>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeCallParameterCollectionFunction, CallFunctionNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_Event* EventNode = Cast<UK2Node_Event>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Event, EventNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_FormatText* FormatTextNode = Cast<UK2Node_FormatText>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeFormatText, FormatTextNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UK2Node_CallArrayFunction* CallFunction = Cast<UK2Node_CallArrayFunction>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2ArrayFunction, CallFunction);
|
|
|
|
|
}
|
2014-05-15 17:34:14 -04:00
|
|
|
else if (UK2Node_Knot* Knot = Cast<UK2Node_Knot>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeKnot, Knot);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeK2Default, K2Node);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (UAnimStateTransitionNode* TransitionNode = Cast<UAnimStateTransitionNode>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeAnimTransition, TransitionNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UAnimStateNode* StateNode = Cast<UAnimStateNode>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeAnimState, StateNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UAnimStateConduitNode* ConduitNode = Cast<UAnimStateConduitNode>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeAnimConduit, ConduitNode);
|
|
|
|
|
}
|
|
|
|
|
else if (UAnimStateEntryNode* EntryNode = Cast<UAnimStateEntryNode>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeAnimStateEntry, EntryNode);
|
|
|
|
|
}
|
Added a new documentation node to the blueprints to display udn documentation excerpts in the grapheditor.
#TTP 312311 - ROCKET: TASK: Add a "Documentation Node"
#Branch UE4
#Proj BlueprintGraph, EdGraph, Kismet, KismetCompiler, GraphEditor, Documentation, EditorStyle
#Change Updated UEdGraphSchema to include an interface call to retrieve an FEdGraphSchemaAction to create documentation nodes. At this point only the K2 interfaces implement this.
#Change Updated UEdGraphSchema_K2 to include a call to retrieve an FEdGraphSchemaAction to create documentation nodes. This is used to add the actions to the blueprint palette and context menus.
#Add Added FEdGraphSchemaAction_K2AddDocumentation in EdGraphSchema_K2_Actions.h/cpp to implement the calls in UEdGraphSchema to create documenation nodes from palette and context menus.
#Change Modified FK2ActionMenuBuilder to provide a static call to create a documentation action in the same style as the comment. Additionally added calls to FK2ActionMenuBuilder::GetPaletteActions and FK2ActionMenuBuilder::GetContextAllowedNodeTypes to call this to add entries in the palette and context menus.
#Add Added a new Brush GraphEditor.Documentation_16x, for the context menu icon in SlateEditorStyle.cpp.
#Change Modified GetPaletteItemIcon in SBlueprintPalette.cpp to return the new icon for the DocumentationNode
#Change Modified FKismetCompilerContext::IsNodePure to include the Documentaton node in the drop through ensure test to prevent asserts on compling if a documentation node is present.
#Change Added an entry for Documentation node in FNodeFactory::CreateNodeWidget.
#Change Modified IDocumentationPage interface to provide the ability to provide a TextWrapAt Attribute so this can be set before creating excerpt content if desired.
#Change Modified the UDNParser to control text wrap at values in the created widgets using a float Attribute WrapAt, Added a set call in the DocumentationPage and made the default behaviour mimic the code it replaced.
#Add Added the class UEdGraphNode_Documentation implemented in EdGraphNode_Documentation.h and UEdGraph.cpp, this is the UObject implementation for the documentation nodes.
#Add Added the class SGraphNodeDocumentation as the GraphPanel implementation of the EdGraphNode_Documentation.
#Change Moved the resizable code from SGraphNodeComment into a SGraphNodeResizable and changed SGraphNodeComment and SGraphNodeDocumentation inherit from it to avoid duplicating code.
#Change Added a documentation specific details customisation so the excerpts can be displayed as combo button.
#Change Added FBlueprintDocumentationDetails into BlueprintDetailsCustomization.h/cpp to handle the user interaction with the documentation node in the BP Editor.
ReviewedBy Chris.Wood, Mike.Beach
[CL 2247425 by Ben Cosh in Main branch]
2014-08-07 15:33:55 -04:00
|
|
|
else if(UEdGraphNode_Documentation* DocNode = Cast<UEdGraphNode_Documentation>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeDocumentation, DocNode);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
else if (InNode->ShouldDrawNodeAsComment())
|
|
|
|
|
{
|
|
|
|
|
if (UMaterialGraphNode_Comment* MaterialCommentNode = Cast<UMaterialGraphNode_Comment>(InNode))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeMaterialComment, MaterialCommentNode);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeComment, InNode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphNodeDefault)
|
|
|
|
|
.GraphNodeObj(InNode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TSharedPtr<SGraphPin> FNodeFactory::CreatePinWidget(UEdGraphPin* InPin)
|
|
|
|
|
{
|
|
|
|
|
check(InPin != NULL);
|
|
|
|
|
|
|
|
|
|
// First give a shot to the registered pin factories
|
|
|
|
|
for (auto FactoryIt = FEdGraphUtilities::VisualPinFactories.CreateIterator(); FactoryIt; ++FactoryIt)
|
|
|
|
|
{
|
|
|
|
|
TSharedPtr<FGraphPanelPinFactory> FactoryPtr = *FactoryIt;
|
|
|
|
|
if (FactoryPtr.IsValid())
|
|
|
|
|
{
|
|
|
|
|
TSharedPtr<SGraphPin> ResultVisualPin = FactoryPtr->CreatePin(InPin);
|
|
|
|
|
if (ResultVisualPin.IsValid())
|
|
|
|
|
{
|
|
|
|
|
return ResultVisualPin;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (const UEdGraphSchema_K2* K2Schema = Cast<const UEdGraphSchema_K2>(InPin->GetSchema()))
|
|
|
|
|
{
|
|
|
|
|
if (InPin->PinType.PinCategory == K2Schema->PC_Boolean)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinBool, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Text)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinText, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Exec)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinExec, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Object)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinObject, InPin);
|
|
|
|
|
}
|
2014-04-23 17:58:27 -04:00
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Interface)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinObject, InPin);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Class)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinClass, InPin);
|
|
|
|
|
}
|
2015-03-19 18:56:54 -04:00
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Int)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinInteger, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Float)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinNum, InPin);
|
|
|
|
|
}
|
2014-07-02 13:08:42 -04:00
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_String || InPin->PinType.PinCategory == K2Schema->PC_Name)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinString, InPin);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Struct)
|
|
|
|
|
{
|
2014-07-14 17:15:42 -04:00
|
|
|
// If you update this logic you'll probably need to update UEdGraphSchema_K2::ShouldHidePinDefaultValue!
|
2015-01-20 09:33:54 -05:00
|
|
|
UScriptStruct* ColorStruct = GetBaseStructure(TEXT("LinearColor"));
|
|
|
|
|
UScriptStruct* VectorStruct = GetBaseStructure(TEXT("Vector"));
|
|
|
|
|
UScriptStruct* Vector2DStruct = GetBaseStructure(TEXT("Vector2D"));
|
|
|
|
|
UScriptStruct* RotatorStruct = GetBaseStructure(TEXT("Rotator"));
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
if (InPin->PinType.PinSubCategoryObject == ColorStruct)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinColor, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if ((InPin->PinType.PinSubCategoryObject == VectorStruct) || (InPin->PinType.PinSubCategoryObject == RotatorStruct))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinVector, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if (InPin->PinType.PinSubCategoryObject == Vector2DStruct)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinVector2D, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if (InPin->PinType.PinSubCategoryObject == FKey::StaticStruct())
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinKey, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if ((InPin->PinType.PinSubCategoryObject == FPoseLink::StaticStruct()) || (InPin->PinType.PinSubCategoryObject == FComponentSpacePoseLink::StaticStruct()))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinPose, InPin);
|
|
|
|
|
}
|
2014-11-19 11:55:51 -05:00
|
|
|
else if (InPin->PinType.PinSubCategoryObject == FCollisionProfileName::StaticStruct())
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinCollisionProfile, InPin);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else if (InPin->PinType.PinCategory == K2Schema->PC_Byte)
|
|
|
|
|
{
|
|
|
|
|
// Check for valid enum object reference
|
|
|
|
|
if ((InPin->PinType.PinSubCategoryObject != NULL) && (InPin->PinType.PinSubCategoryObject->IsA(UEnum::StaticClass())))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinEnum, InPin);
|
|
|
|
|
}
|
2014-07-02 13:08:42 -04:00
|
|
|
else
|
|
|
|
|
{
|
2015-03-19 18:56:54 -04:00
|
|
|
return SNew(SGraphPinInteger, InPin);
|
2014-07-02 13:08:42 -04:00
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else if ((InPin->PinType.PinCategory == K2Schema->PC_Wildcard) && (InPin->PinType.PinSubCategory == K2Schema->PSC_Index))
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinIndex, InPin);
|
|
|
|
|
}
|
|
|
|
|
else if(InPin->PinType.PinCategory == K2Schema->PC_MCDelegate)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinString, InPin);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const UAnimationStateMachineSchema* AnimStateMachineSchema = Cast<const UAnimationStateMachineSchema>(InPin->GetSchema());
|
|
|
|
|
if (AnimStateMachineSchema != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (InPin->PinType.PinCategory == AnimStateMachineSchema->PC_Exec)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinExec, InPin);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (const UMaterialGraphSchema* MaterialGraphSchema = Cast<const UMaterialGraphSchema>(InPin->GetSchema()))
|
|
|
|
|
{
|
|
|
|
|
if (InPin->PinType.PinCategory == MaterialGraphSchema->PC_MaterialInput)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinMaterialInput, InPin);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPin, InPin);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-28 13:15:12 -04:00
|
|
|
if (const UEdGraphSchema_Niagara* NSchema = Cast<const UEdGraphSchema_Niagara>(InPin->GetSchema()))
|
|
|
|
|
{
|
2014-10-16 03:41:17 -04:00
|
|
|
if (InPin->PinType.PinCategory == NSchema->PC_Float)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinNum, InPin);
|
|
|
|
|
}
|
|
|
|
|
if (InPin->PinType.PinCategory == NSchema->PC_Vector)
|
2014-07-28 13:15:12 -04:00
|
|
|
{
|
|
|
|
|
return SNew(SGraphPinVector4, InPin);
|
|
|
|
|
}
|
2014-10-16 03:41:17 -04:00
|
|
|
if (InPin->PinType.PinCategory == NSchema->PC_Matrix)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPin, InPin);
|
|
|
|
|
}
|
2015-01-08 11:49:58 -05:00
|
|
|
if (InPin->PinType.PinCategory == NSchema->PC_Curve)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SGraphPin, InPin);
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-28 13:15:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-07-02 13:08:42 -04:00
|
|
|
// If we didn't pick a custom pin widget, use an uncustomized basic pin
|
|
|
|
|
return SNew(SGraphPin, InPin);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|