本文整理汇总了C++中UEdGraphNode::AutowireNewNode方法的典型用法代码示例。如果您正苦于以下问题:C++ UEdGraphNode::AutowireNewNode方法的具体用法?C++ UEdGraphNode::AutowireNewNode怎么用?C++ UEdGraphNode::AutowireNewNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UEdGraphNode
的用法示例。
在下文中一共展示了UEdGraphNode::AutowireNewNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PerformAction
//------------------------------------------------------------------------------
UEdGraphNode* FBlueprintActionMenuItem::PerformAction(UEdGraph* ParentGraph, TArray<UEdGraphPin*>& FromPins, FVector2D const Location, bool bSelectNewNode/* = true*/)
{
UEdGraphPin* FromPin = nullptr;
if (FromPins.Num() > 0)
{
FromPin = FromPins[0];
}
UEdGraphNode* SpawnedNode = PerformAction(ParentGraph, FromPin, Location, bSelectNewNode);
// try auto-wiring the rest of the pins (if there are any)
for (int32 PinIndex = 1; PinIndex < FromPins.Num(); ++PinIndex)
{
SpawnedNode->AutowireNewNode(FromPins[PinIndex]);
}
return SpawnedNode;
}
示例2:
UEdGraphNode* FEdGraphSchemaAction_K2NewNode::CreateNode(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, class UK2Node* NodeTemplate, bool bSelectNewNode/* = true*/)
{
// Smart pointer that handles fixup after potential node reconstruction
FWeakGraphPinPtr FromPinPtr = FromPin;
// Duplicate template node to create new node
UEdGraphNode* ResultNode = DuplicateObject<UK2Node>(NodeTemplate, ParentGraph);
ResultNode->SetFlags(RF_Transactional);
ParentGraph->AddNode(ResultNode, true, bSelectNewNode);
ResultNode->CreateNewGuid();
ResultNode->PostPlacedNewNode();
ResultNode->AllocateDefaultPins();
// For input pins, new node will generally overlap node being dragged off
// Work out if we want to visually push away from connected node
int32 XLocation = Location.X;
if (FromPinPtr.IsValid() && FromPinPtr->Direction == EGPD_Input)
{
UEdGraphNode* PinNode = FromPinPtr->GetOwningNode();
const float XDelta = FMath::Abs(PinNode->NodePosX - Location.X);
if (XDelta < NodeDistance)
{
// Set location to edge of current node minus the max move distance
// to force node to push off from connect node enough to give selection handle
XLocation = PinNode->NodePosX - NodeDistance;
}
}
ResultNode->NodePosX = XLocation;
ResultNode->NodePosY = Location.Y;
ResultNode->SnapToGrid(SNAP_GRID);
// make sure to auto-wire after we position the new node (in case the
// auto-wire creates a conversion node to put between them)
ResultNode->AutowireNewNode(FromPinPtr);
// Update Analytics for the new nodes
FBlueprintEditorUtils::AnalyticsTrackNewNode( ResultNode );
// NOTE: At this point the node may have been reconstructed, depending on node type!
return ResultNode;
}
示例3: PerformAction
UEdGraphNode* FDecoratorSchemaAction_NewNode::PerformAction(class UEdGraph* ParentGraph, TArray<UEdGraphPin*>& FromPins, const FVector2D Location, bool bSelectNewNode)
{
UEdGraphNode* ResultNode = NULL;
if (FromPins.Num() > 0)
{
ResultNode = PerformAction(ParentGraph, FromPins[0], Location);
// Try autowiring the rest of the pins
for (int32 Index = 1; Index < FromPins.Num(); ++Index)
{
ResultNode->AutowireNewNode(FromPins[Index]);
}
}
else
{
ResultNode = PerformAction(ParentGraph, NULL, Location, bSelectNewNode);
}
return ResultNode;
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:20,代码来源:EdGraphSchema_BehaviorTreeDecorator.cpp
示例4: CreateNode
UEdGraphNode* FEdGraphSchemaAction_NewNode::CreateNode(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, class UEdGraphNode* NodeTemplate)
{
// Duplicate template node to create new node
UEdGraphNode* ResultNode = NULL;
#if WITH_EDITOR
ResultNode = DuplicateObject<UEdGraphNode>(NodeTemplate, ParentGraph);
ResultNode->SetFlags(RF_Transactional);
ParentGraph->AddNode(ResultNode, true);
ResultNode->CreateNewGuid();
ResultNode->PostPlacedNewNode();
ResultNode->AllocateDefaultPins();
ResultNode->AutowireNewNode(FromPin);
// For input pins, new node will generally overlap node being dragged off
// Work out if we want to visually push away from connected node
int32 XLocation = Location.X;
if (FromPin && FromPin->Direction == EGPD_Input)
{
UEdGraphNode* PinNode = FromPin->GetOwningNode();
const float XDelta = FMath::Abs(PinNode->NodePosX - Location.X);
if (XDelta < NodeDistance)
{
// Set location to edge of current node minus the max move distance
// to force node to push off from connect node enough to give selection handle
XLocation = PinNode->NodePosX - NodeDistance;
}
}
ResultNode->NodePosX = XLocation;
ResultNode->NodePosY = Location.Y;
ResultNode->SnapToGrid(SNAP_GRID);
#endif // WITH_EDITOR
return ResultNode;
}