本文整理汇总了C++中FindPin函数的典型用法代码示例。如果您正苦于以下问题:C++ FindPin函数的具体用法?C++ FindPin怎么用?C++ FindPin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindPin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTargetFunction
void UK2Node_CallArrayFunction::GetArrayPins(TArray< FArrayPropertyPinCombo >& OutArrayPinInfo ) const
{
OutArrayPinInfo.Empty();
UFunction* TargetFunction = GetTargetFunction();
check(TargetFunction);
FString ArrayPointerMetaData = TargetFunction->GetMetaData(FBlueprintMetadata::MD_ArrayParam);
TArray<FString> ArrayPinComboNames;
ArrayPointerMetaData.ParseIntoArray(ArrayPinComboNames, TEXT(","), true);
for(auto Iter = ArrayPinComboNames.CreateConstIterator(); Iter; ++Iter)
{
TArray<FString> ArrayPinNames;
Iter->ParseIntoArray(ArrayPinNames, TEXT("|"), true);
FArrayPropertyPinCombo ArrayInfo;
ArrayInfo.ArrayPin = FindPin(ArrayPinNames[0]);
if(ArrayPinNames.Num() > 1)
{
ArrayInfo.ArrayPropPin = FindPin(ArrayPinNames[1]);
}
if(ArrayInfo.ArrayPin)
{
OutArrayPinInfo.Add(ArrayInfo);
}
}
}
示例2: GetBlueprint
void UK2Node_Timeline::ExpandNode(FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph)
{
Super::ExpandNode(CompilerContext, SourceGraph);
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
UBlueprint* Blueprint = GetBlueprint();
check(Blueprint);
UTimelineTemplate* Timeline = Blueprint->FindTimelineTemplateByVariableName(TimelineName);
if(Timeline)
{
ExpandForPin(GetDirectionPin(), Timeline->GetDirectionPropertyName(), CompilerContext, SourceGraph);
for(int32 i=0; i<Timeline->FloatTracks.Num(); i++)
{
const FName TrackName = Timeline->FloatTracks[i].TrackName;
ExpandForPin(FindPin(TrackName.ToString()), Timeline->GetTrackPropertyName(TrackName), CompilerContext, SourceGraph);
}
for(int32 i=0; i<Timeline->VectorTracks.Num(); i++)
{
const FName TrackName = Timeline->VectorTracks[i].TrackName;
ExpandForPin(FindPin(TrackName.ToString()), Timeline->GetTrackPropertyName(TrackName), CompilerContext, SourceGraph);
}
for(int32 i=0; i<Timeline->LinearColorTracks.Num(); i++)
{
const FName TrackName = Timeline->LinearColorTracks[i].TrackName;
ExpandForPin(FindPin(TrackName.ToString()), Timeline->GetTrackPropertyName(TrackName), CompilerContext, SourceGraph);
}
}
}
示例3: GetDelegateSignature
void UK2Node_DelegateSet::ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph)
{
Super::ExpandNode(CompilerContext, SourceGraph);
if (SourceGraph != CompilerContext.ConsolidatedEventGraph)
{
CompilerContext.MessageLog.Error(*FString::Printf(*NSLOCTEXT("KismetCompiler", "InvalidNodeOutsideUbergraph_Error", "Unexpected node @@ found outside ubergraph.").ToString()), this);
}
else
{
UFunction* TargetFunction = GetDelegateSignature();
if(TargetFunction != NULL)
{
const UEdGraphSchema_K2* Schema = CompilerContext.GetSchema();
// First, create an event node matching the delegate signature
UK2Node_Event* DelegateEvent = CompilerContext.SpawnIntermediateEventNode<UK2Node_Event>(this, nullptr, SourceGraph);
DelegateEvent->EventReference.SetFromField<UFunction>(TargetFunction, false);
DelegateEvent->CustomFunctionName = GetDelegateTargetEntryPointName();
DelegateEvent->bInternalEvent = true;
DelegateEvent->AllocateDefaultPins();
// Move the pins over to the newly created event node
for( TArray<UEdGraphPin*>::TIterator PinIt(DelegateEvent->Pins); PinIt; ++PinIt )
{
UEdGraphPin* CurrentPin = *PinIt;
check(CurrentPin);
if( CurrentPin->Direction == EGPD_Output )
{
if( CurrentPin->PinType.PinCategory == Schema->PC_Exec )
{
// Hook up the exec pin specially, since it has a different name on the dynamic delegate node
UEdGraphPin* OldExecPin = FindPin(Schema->PN_DelegateEntry);
check(OldExecPin);
CompilerContext.MovePinLinksToIntermediate(*OldExecPin, *CurrentPin);
}
else if( CurrentPin->PinName != UK2Node_Event::DelegateOutputName )
{
// Hook up all other pins, EXCEPT the delegate output pin, which isn't needed in this case
UEdGraphPin* OldPin = FindPin(CurrentPin->PinName);
if( !OldPin )
{
// If we couldn't find the old pin, the function signature is out of date. Tell them to reconstruct
CompilerContext.MessageLog.Error(*FString::Printf(*NSLOCTEXT("KismetCompiler", "EventNodeOutOfDate_Error", "Event node @@ is out-of-date. Please refresh it.").ToString()), this);
return;
}
CompilerContext.MovePinLinksToIntermediate(*OldPin, *CurrentPin);
}
}
}
}
else
{
CompilerContext.MessageLog.Error(*FString::Printf(*LOCTEXT("DelegateSigNotFound_Error", "Set Delegate node @@ unable to find function.").ToString()), this);
}
}
}
示例4: FindPinChecked
void UK2Node_EaseFunction::ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph)
{
Super::ExpandNode(CompilerContext, SourceGraph);
/**
At the end of this, the UK2Node_EaseFunction will not be a part of the Blueprint, it merely handles connecting
the other nodes into the Blueprint.
*/
UFunction* Function = UKismetMathLibrary::StaticClass()->FindFunctionByName(*EaseFunctionName);
if (Function == NULL)
{
CompilerContext.MessageLog.Error(*LOCTEXT("InvalidFunctionName", "BaseAsyncTask: Type not supported or not initialized. @@").ToString(), this);
return;
}
const UEdGraphSchema_K2* Schema = CompilerContext.GetSchema();
// The call function does all the real work, each child class implementing easing for a given type provides
// the name of the desired function
UK2Node_CallFunction* CallFunction = CompilerContext.SpawnIntermediateNode<UK2Node_CallFunction>(this, SourceGraph);
CallFunction->SetFromFunction(Function);
CallFunction->AllocateDefaultPins();
CompilerContext.MessageLog.NotifyIntermediateObjectCreation(CallFunction, this);
// Move the ease function and the alpha connections from us to the call function
CompilerContext.MovePinLinksToIntermediate(*FindPin(FEaseFunctionNodeHelper::GetEaseFuncPinName()), *CallFunction->FindPin(TEXT("EasingFunc")));
CompilerContext.MovePinLinksToIntermediate(*FindPin(FEaseFunctionNodeHelper::GetAlphaPinName()), *CallFunction->FindPin(TEXT("Alpha")));
// Move base connections to the call function's connections
CompilerContext.MovePinLinksToIntermediate(*FindPin(FEaseFunctionNodeHelper::GetAPinName()), *CallFunction->FindPin(TEXT("A")));
CompilerContext.MovePinLinksToIntermediate(*FindPin(FEaseFunctionNodeHelper::GetBPinName()), *CallFunction->FindPin(TEXT("B")));
CompilerContext.MovePinLinksToIntermediate(*FindPin(FEaseFunctionNodeHelper::GetResultPinName()), *CallFunction->GetReturnValuePin());
// Now move the custom pins to their new locations
UEdGraphPin* ShortestPathPin = FindPinChecked(FEaseFunctionNodeHelper::GetShortestPathPinName());
if (!ShortestPathPin->bHidden)
{
CompilerContext.MovePinLinksToIntermediate(*ShortestPathPin, *CallFunction->FindPinChecked(TEXT("bShortestPath")));
}
UEdGraphPin* BlendExpPin = FindPinChecked(FEaseFunctionNodeHelper::GetBlendExpPinName());
if (!BlendExpPin->bHidden)
{
CompilerContext.MovePinLinksToIntermediate(*BlendExpPin, *CallFunction->FindPinChecked(FEaseFunctionNodeHelper::GetBlendExpPinName()));
}
UEdGraphPin* StepsPin = FindPinChecked(FEaseFunctionNodeHelper::GetStepsPinName());
if (!StepsPin->bHidden)
{
CompilerContext.MovePinLinksToIntermediate(*StepsPin, *CallFunction->FindPinChecked(FEaseFunctionNodeHelper::GetStepsPinName()));
}
// Cleanup links to ourself and we are done!
BreakAllNodeLinks();
}
示例5: FindPin
void UGameplayTagsK2Node_MultiCompareGameplayTagContainerSingleTags::ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph)
{
Super::ExpandNode(CompilerContext, SourceGraph);
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
// Get The input and output pins to our node
UEdGraphPin* InPinSwitch = FindPin(TEXT("Gameplay Tag Container"));
UEdGraphPin* InPinContainerMatchType = FindPin(TEXT("Tag Container Match Type"));
UEdGraphPin* InPinTagsMatchType = FindPin(TEXT("Tags Match Type"));
// For Each Pin Compare against the Tag container
for (int32 Index = 0; Index < NumberOfPins; ++Index)
{
FString InPinName = TEXT("TagCase_") + FString::FormatAsNumber(Index);
FString OutPinName = TEXT("Case_") + FString::FormatAsNumber(Index) + TEXT(" True");
UEdGraphPin* InPinCase = FindPin(InPinName);
UEdGraphPin* OutPinCase = FindPin(OutPinName);
// Create call function node for the Compare function HasAllMatchingGameplayTags
UK2Node_CallFunction* PinCallFunction = CompilerContext.SpawnIntermediateNode<UK2Node_CallFunction>(this, SourceGraph);
const UFunction* Function = UBlueprintGameplayTagLibrary::StaticClass()->FindFunctionByName(GET_FUNCTION_NAME_CHECKED(UBlueprintGameplayTagLibrary, DoesContainerHaveTag));
PinCallFunction->SetFromFunction(Function);
PinCallFunction->AllocateDefaultPins();
UEdGraphPin *TagContainerPin = PinCallFunction->FindPinChecked(FString(TEXT("TagContainer")));
CompilerContext.CopyPinLinksToIntermediate(*InPinSwitch, *TagContainerPin);
UEdGraphPin *TagPin = PinCallFunction->FindPinChecked(FString(TEXT("Tag")));
CompilerContext.MovePinLinksToIntermediate(*InPinCase, *TagPin);
UEdGraphPin *ContainerTagsMatchTypePin = PinCallFunction->FindPinChecked(FString(TEXT("ContainerTagsMatchType")));
CompilerContext.CopyPinLinksToIntermediate(*InPinContainerMatchType, *ContainerTagsMatchTypePin);
UEdGraphPin *TagMatchTypePin = PinCallFunction->FindPinChecked(FString(TEXT("TagMatchType")));
CompilerContext.CopyPinLinksToIntermediate(*InPinTagsMatchType, *TagMatchTypePin);
UEdGraphPin *OutPin = PinCallFunction->FindPinChecked(K2Schema->PN_ReturnValue);
if (OutPinCase && OutPin)
{
OutPin->PinType = OutPinCase->PinType; // Copy type so it uses the right actor subclass
CompilerContext.MovePinLinksToIntermediate(*OutPinCase, *OutPin);
}
}
// Break any links to the expanded node
BreakAllNodeLinks();
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:49,代码来源:GameplayTagsK2Node_MultiCompareGameplayTagContainerSingleTags.cpp
示例6: while
HRESULT CSampleCGB::FindEncoder( IEnumMoniker *pEncoders, REGPINMEDIUM pinMedium, IBaseFilter **ppEncoder )
{
if( ! pEncoders )
{
return E_INVALIDARG;
}
if(IsEqualGUID(pinMedium.clsMedium,GUID_NULL) || IsEqualGUID(pinMedium.clsMedium,KSMEDIUMSETID_Standard))
{
return E_INVALIDARG;
}
HRESULT hr;
SmartPtr<IBaseFilter> pFilter;
SmartPtr<IMoniker> pMoniker;
ULONG cFetched;
SmartPtr<IPin> pPin;
while(pFilter.Release(),pMoniker.Release(),S_OK == pEncoders->Next(1,&pMoniker,&cFetched))
{
hr = pMoniker->BindToObject(0,0,IID_IBaseFilter,(void**)&pFilter);
if(FAILED(hr))continue;
hr = FindPin(pFilter,pinMedium,PINDIR_INPUT,TRUE,&pPin);
if(SUCCEEDED(hr))
{
*ppEncoder = pFilter.Detach();
return hr;
}
}
return E_FAIL;
}
示例7: CreatePin
void UK2Node_FunctionEntry::AllocateDefaultPins()
{
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
CreatePin(EGPD_Output, K2Schema->PC_Exec, TEXT(""), NULL, false, false, K2Schema->PN_Then);
UFunction* Function = FindField<UFunction>(SignatureClass, SignatureName);
if (Function == nullptr)
{
Function = FindDelegateSignature(SignatureName);
}
if (Function != NULL)
{
CreatePinsForFunctionEntryExit(Function, /*bIsFunctionEntry=*/ true);
}
Super::AllocateDefaultPins();
if (FFunctionEntryHelper::RequireWorldContextParameter(this)
&& ensure(!FindPin(FFunctionEntryHelper::GetWorldContextPinName())))
{
UEdGraphPin* WorldContextPin = CreatePin(
EGPD_Output,
K2Schema->PC_Object,
FString(),
UObject::StaticClass(),
false,
false,
FFunctionEntryHelper::GetWorldContextPinName());
WorldContextPin->bHidden = true;
}
}
示例8: FindPin
void UK2Node_Event::ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph)
{
Super::ExpandNode(CompilerContext, SourceGraph);
if (CompilerContext.bIsFullCompile)
{
UEdGraphPin* OrgDelegatePin = FindPin(UK2Node_Event::DelegateOutputName);
if (OrgDelegatePin && OrgDelegatePin->LinkedTo.Num() > 0)
{
const UEdGraphSchema_K2* Schema = CompilerContext.GetSchema();
const FName FunctionName = GetFunctionName();
if(FunctionName == NAME_None)
{
CompilerContext.MessageLog.Error(*FString::Printf(*LOCTEXT("EventDelegateName_Error", "Event node @@ has no name of function.").ToString()), this);
}
UK2Node_Self* SelfNode = CompilerContext.SpawnIntermediateNode<UK2Node_Self>(this, SourceGraph);
SelfNode->AllocateDefaultPins();
UK2Node_CreateDelegate* CreateDelegateNode = CompilerContext.SpawnIntermediateNode<UK2Node_CreateDelegate>(this, SourceGraph);
CreateDelegateNode->AllocateDefaultPins();
CompilerContext.MovePinLinksToIntermediate(*OrgDelegatePin, *CreateDelegateNode->GetDelegateOutPin());
Schema->TryCreateConnection(SelfNode->FindPinChecked(Schema->PN_Self), CreateDelegateNode->GetObjectInPin());
// When called UFunction is defined in the same class, it wasn't created yet (previously the Skeletal class was checked). So no "CreateDelegateNode->HandleAnyChangeWithoutNotifying();" is called.
CreateDelegateNode->SetFunction(FunctionName);
}
}
}
示例9: FindPin
void UAnimGraphNode_PoseByName::ValidateAnimNodeDuringCompilation(class USkeleton* ForSkeleton, class FCompilerResultsLog& MessageLog)
{
UPoseAsset* PoseAssetToCheck = Node.PoseAsset;
UEdGraphPin* PoseAssetPin = FindPin(GET_MEMBER_NAME_STRING_CHECKED(FAnimNode_PoseByName, PoseAsset));
if (PoseAssetPin != nullptr && PoseAssetToCheck == nullptr)
{
PoseAssetToCheck = Cast<UPoseAsset>(PoseAssetPin->DefaultObject);
}
if (PoseAssetToCheck == nullptr)
{
// we may have a connected node
if (PoseAssetPin == nullptr || PoseAssetPin->LinkedTo.Num() == 0)
{
MessageLog.Error(TEXT("@@ references an unknown pose asset"), this);
}
}
else
{
USkeleton* SeqSkeleton = PoseAssetToCheck->GetSkeleton();
if (SeqSkeleton&& // if anim sequence doesn't have skeleton, it might be due to anim sequence not loaded yet, @todo: wait with anim blueprint compilation until all assets are loaded?
!SeqSkeleton->IsCompatible(ForSkeleton))
{
MessageLog.Error(TEXT("@@ references sequence that uses different skeleton @@"), this, SeqSkeleton);
}
}
}
示例10: FindPin
UEdGraphPin* UK2Node_DynamicCast::GetBoolSuccessPin() const
{
UEdGraphPin* Pin = FindPin(UK2Node_DynamicCastImpl::CastSuccessPinName);
check(Pin != nullptr);
check(Pin->Direction == EGPD_Output);
return Pin;
}
示例11: SetEnum
void UK2Node_Select::AllocateDefaultPins()
{
const UEdGraphSchema_K2* Schema = GetDefault<UEdGraphSchema_K2>();
// To refresh, just in case it changed
SetEnum(Enum, true);
if (Enum)
{
NumOptionPins = EnumEntries.Num();
}
// Create the option pins
for (int32 Idx = 0; Idx < NumOptionPins; Idx++)
{
UEdGraphPin* NewPin = NULL;
if (Enum)
{
const FString PinName = EnumEntries[Idx].ToString();
UEdGraphPin* TempPin = FindPin(PinName);
if (!TempPin)
{
NewPin = CreatePin(EGPD_Input, Schema->PC_Wildcard, TEXT(""), NULL, false, false, PinName);
}
}
else
{
const FString PinName = FString::Printf(TEXT("Option %d"), Idx);
NewPin = CreatePin(EGPD_Input, Schema->PC_Wildcard, TEXT(""), NULL, false, false, PinName);
}
if (NewPin)
{
if (IndexPinType.PinCategory == UEdGraphSchema_K2::PC_Boolean)
{
NewPin->PinFriendlyName = (Idx == 0 ? GFalse : GTrue);
}
else if (Idx < EnumEntryFriendlyNames.Num())
{
if (EnumEntryFriendlyNames[Idx] != NAME_None)
{
NewPin->PinFriendlyName = FText::FromName(EnumEntryFriendlyNames[Idx]);
}
else
{
NewPin->PinFriendlyName = FText::GetEmpty();
}
}
}
}
// Create the index wildcard pin
CreatePin(EGPD_Input, IndexPinType.PinCategory, IndexPinType.PinSubCategory, IndexPinType.PinSubCategoryObject.Get(), false, false, "Index");
// Create the return value
CreatePin(EGPD_Output, Schema->PC_Wildcard, TEXT(""), NULL, false, false, Schema->PN_ReturnValue);
Super::AllocateDefaultPins();
}
示例12: GetSchema
bool UK2Node_EditablePinBase::ModifyUserDefinedPinDefaultValue(TSharedPtr<FUserPinInfo> PinInfo, const FString& InDefaultValue)
{
FString NewDefaultValue = InDefaultValue;
// Find and modify the current pin
if (UEdGraphPin* OldPin = FindPin(PinInfo->PinName))
{
FString SavedDefaultValue = OldPin->DefaultValue;
OldPin->DefaultValue = OldPin->AutogeneratedDefaultValue = NewDefaultValue;
// Validate the new default value
const UEdGraphSchema* Schema = GetSchema();
FString ErrorString = Schema->IsCurrentPinDefaultValid(OldPin);
if (!ErrorString.IsEmpty())
{
NewDefaultValue = SavedDefaultValue;
OldPin->DefaultValue = OldPin->AutogeneratedDefaultValue = SavedDefaultValue;
return false;
}
}
PinInfo->PinDefaultValue = NewDefaultValue;
return true;
}
示例13: GetPoseHandlerNode
void UAnimGraphNode_PoseHandler::ValidateAnimNodeDuringCompilation(USkeleton* ForSkeleton, FCompilerResultsLog& MessageLog)
{
UPoseAsset* PoseAssetToCheck = GetPoseHandlerNode()->PoseAsset;
UEdGraphPin* PoseAssetPin = FindPin(GET_MEMBER_NAME_STRING_CHECKED(FAnimNode_PoseHandler, PoseAsset));
if (PoseAssetPin != nullptr && PoseAssetToCheck == nullptr)
{
PoseAssetToCheck = Cast<UPoseAsset>(PoseAssetPin->DefaultObject);
}
if (PoseAssetToCheck == nullptr)
{
if (PoseAssetPin == nullptr || PoseAssetPin->LinkedTo.Num() == 0)
{
MessageLog.Error(TEXT("@@ references an unknown poseasset"), this);
}
}
else
{
USkeleton* SeqSkeleton = PoseAssetToCheck->GetSkeleton();
if (SeqSkeleton && // if PoseAsset doesn't have skeleton, it might be due to PoseAsset not loaded yet, @todo: wait with anim blueprint compilation until all assets are loaded?
!SeqSkeleton->IsCompatible(ForSkeleton))
{
MessageLog.Error(TEXT("@@ references poseasset that uses different skeleton @@"), this, SeqSkeleton);
}
}
Super::ValidateAnimNodeDuringCompilation(ForSkeleton, MessageLog);
}
示例14: FindPin
void UK2Node_ConvertAsset::RefreshPinTypes()
{
const UEdGraphSchema_K2* K2Schema = CastChecked<UEdGraphSchema_K2>(GetSchema());
auto InutPin = FindPin(UK2Node_ConvertAssetImpl::InputPinName);
auto OutputPin = FindPin(UK2Node_ConvertAssetImpl::OutputPinName);
ensure(InutPin && OutputPin);
if (InutPin && OutputPin)
{
const bool bIsConnected = InutPin->LinkedTo.Num() > 0;
UClass* TargetType = bIsConnected ? GetTargetClass() : nullptr;
const bool bIsAssetClass = bIsConnected ? IsAssetClassType() : false;
const FString InputCategory = bIsConnected
? (bIsAssetClass ? K2Schema->PC_AssetClass : K2Schema->PC_Asset)
: K2Schema->PC_Wildcard;
InutPin->PinType = FEdGraphPinType(InputCategory, FString(), TargetType, false, false);
const FString OutputCategory = bIsConnected
? (bIsAssetClass ? K2Schema->PC_Class : K2Schema->PC_Object)
: K2Schema->PC_Wildcard;
OutputPin->PinType = FEdGraphPinType(OutputCategory, FString(), TargetType, false, false);
PinTypeChanged(InutPin);
PinTypeChanged(OutputPin);
if (OutputPin->LinkedTo.Num())
{
UClass const* CallingContext = NULL;
if (UBlueprint const* Blueprint = GetBlueprint())
{
CallingContext = Blueprint->GeneratedClass;
if (CallingContext == NULL)
{
CallingContext = Blueprint->ParentClass;
}
}
for (auto TargetPin : OutputPin->LinkedTo)
{
if (TargetPin && !K2Schema->ArePinsCompatible(OutputPin, TargetPin, CallingContext))
{
OutputPin->BreakLinkTo(TargetPin);
}
}
}
}
}
示例15: FindPin
UEdGraphPin* UK2Node_IfThenElse::GetConditionPin() const
{
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
UEdGraphPin* Pin = FindPin(K2Schema->PN_Condition);
check(Pin != NULL);
return Pin;
}