bool UK2Node_MakeStruct::CanBeMade(const UScriptStruct* Struct) { if(!Struct->HasMetaData(TEXT("HasNativeMake"))) { for (TFieldIterator<UProperty> It(Struct); It; ++It) { if(CanBeExposed(*It)) { return true; } } } return false; }
bool UK2Node_MakeStruct::CanBeMade(const UScriptStruct* Struct, bool bIncludeEditOnly, bool bMustHaveValidProperties ) { if (Struct && !Struct->HasMetaData(TEXT("HasNativeMake"))) { if (!bMustHaveValidProperties && UEdGraphSchema_K2::IsAllowableBlueprintVariableType(Struct)) { return true; } for (TFieldIterator<UProperty> It(Struct); It; ++It) { if (CanBeExposed(*It, bIncludeEditOnly)) { return true; } } } return false; }
void UK2Node_MakeStruct::ValidateNodeDuringCompilation(class FCompilerResultsLog& MessageLog) const { if(!StructType) { MessageLog.Error(*LOCTEXT("NoStruct_Error", "No Struct in @@").ToString(), this); } else { bool bHasAnyBlueprintVisibleProperty = false; for (TFieldIterator<UProperty> It(StructType); It; ++It) { const UProperty* Property = *It; if (CanBeExposed(Property)) { const bool bIsBlueprintVisible = Property->HasAnyPropertyFlags(CPF_BlueprintVisible) || (Property->GetOwnerStruct() && Property->GetOwnerStruct()->IsA<UUserDefinedStruct>()); bHasAnyBlueprintVisibleProperty |= bIsBlueprintVisible; const UEdGraphPin* Pin = FindPin(Property->GetName()); if (Pin && !bIsBlueprintVisible) { MessageLog.Warning(*LOCTEXT("PropertyIsNotBPVisible_Warning", "@@ - the native property is not tagged as BlueprintReadWrite, the pin will be removed in a future release.").ToString(), Pin); } if (Property->ArrayDim > 1) { MessageLog.Warning(*LOCTEXT("StaticArray_Warning", "@@ - the native property is a static array, which is not supported by blueprints").ToString(), Pin); } } } if (!bHasAnyBlueprintVisibleProperty) { MessageLog.Warning(*LOCTEXT("StructHasNoBPVisibleProperties_Warning", "@@ has no property tagged as BlueprintReadWrite. The node will be removed in a future release.").ToString(), this); } } }
bool UK2Node_MakeStruct::FMakeStructPinManager::CanTreatPropertyAsOptional(UProperty* TestProperty) const { return CanBeExposed(TestProperty); }