From b7568cc6940bb5db4e4227b1d37c4146bf40fdb2 Mon Sep 17 00:00:00 2001 From: robert manuszewski Date: Sun, 15 Mar 2020 10:33:45 -0400 Subject: [PATCH] Fix for UE-90683: You can no longer delete conflicting variables Refactored FindField into FindUField and FindFProperty to avoid confusion caused by the fact that FindField will no longer return FProperties. #jira UE-90683 #rb Steve.Robb #tests Basic editor functionality test, cooked and ran PC client and server, bot soak tests for two hours #ROBOMERGE-OWNER: robert.manuszewski #ROBOMERGE-AUTHOR: robert.manuszewski #ROBOMERGE-SOURCE: CL 12190998 in //UE4/Release-4.25/... via CL 12190999 #ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v661-12148976) [CL 12191300 by robert manuszewski in Main branch] --- ...vieSceneLiveLinkStructPropertyBindings.cpp | 2 +- .../ConcertClientTransactionBridge.cpp | 6 +- .../Private/ConcertSyncClientUtil.cpp | 2 +- .../AssetTypeActions_GameplayTagAssetBase.cpp | 2 +- .../GameplayTagsK2Node_SwitchGameplayTag.cpp | 2 +- ...yTagsK2Node_SwitchGameplayTagContainer.cpp | 2 +- .../Private/SGameplayTagQueryGraphPin.cpp | 2 +- .../Private/VariantManagerUtils.cpp | 17 ++-- .../Private/PropertyValue.cpp | 2 +- .../Private/PropertyValueMaterial.cpp | 2 +- .../BlueprintStats/Private/BlueprintStats.cpp | 2 +- .../Private/ControlRigBlueprintUtils.cpp | 3 +- .../Private/ImagePlateComponent.cpp | 2 +- .../Private/ImagePlateTrackEditor.cpp | 2 +- .../USDImporter/Private/PropertyHelpers.cpp | 4 +- .../NetcodeUnitTest/Private/NUTActor.cpp | 6 +- .../Private/NUTUtilReflection.cpp | 4 +- .../Public/NUTUtilReflection.h | 12 +-- .../Private/AttributeSet.cpp | 4 +- .../Private/AttributeDetails.cpp | 2 +- .../UnrealEd/EditorBuildPromotionTests.cpp | 2 +- .../Private/UnrealEd/LightingTests.cpp | 2 +- .../Developer/AITestSuite/Public/BTBuilder.h | 18 ++-- .../Private/BPCompilerTests.cpp | 2 +- .../BlueprintCompilerCppBackendUtils.cpp | 2 +- ...BlueprintCompilerCppBackendValueHelper.cpp | 6 +- .../Private/AdvancedPreviewScene.cpp | 6 +- .../AnimGraph/Private/AnimGraphNode_Base.cpp | 8 +- .../Private/AnimGraphNode_CustomProperty.cpp | 2 +- .../Private/AnimationGraphSchema.cpp | 2 +- .../Private/SBehaviorTreeBlackboardEditor.cpp | 4 +- .../Private/SBehaviorTreeBlackboardView.cpp | 4 +- .../Classes/EdGraphSchema_K2_Actions.h | 4 +- .../Private/BlueprintActionDatabase.cpp | 2 +- .../Private/EdGraphSchema_K2.cpp | 4 +- .../Private/EdGraphSchema_K2_Actions.cpp | 2 +- .../Private/K2Node_ActorBoundEvent.cpp | 6 +- .../Private/K2Node_BreakStruct.cpp | 2 +- .../Private/K2Node_CallFunction.cpp | 22 ++--- .../Private/K2Node_ComponentBoundEvent.cpp | 2 +- .../Private/K2Node_CustomEvent.cpp | 8 +- .../Private/K2Node_DelegateSet.cpp | 4 +- .../Private/K2Node_FunctionEntry.cpp | 4 +- .../Private/K2Node_FunctionTerminator.cpp | 4 +- .../Private/K2Node_GetArrayItem.cpp | 2 +- .../Private/K2Node_GetClassDefaults.cpp | 4 +- .../Private/K2Node_LoadAsset.cpp | 2 +- .../Private/K2Node_MCDelegate.cpp | 2 +- .../Private/K2Node_MultiGate.cpp | 16 +-- .../BlueprintGraph/Private/K2Node_Switch.cpp | 6 +- .../Private/K2Node_Variable.cpp | 4 +- .../Private/K2Node_VariableSet.cpp | 2 +- .../Private/MakeStructHandler.cpp | 2 +- .../Private/StructMemberNodeHandlers.cpp | 2 +- .../Private/SplineComponentVisualizer.cpp | 6 +- .../Private/SplineGeneratorPanel.cpp | 4 +- .../Private/AssetViewWidgets.cpp | 2 +- .../Private/FrontendFilters.cpp | 2 +- .../ContentBrowser/Private/SAssetView.cpp | 2 +- .../Private/ComponentMaterialCategory.cpp | 8 +- .../ComponentReferenceCustomization.cpp | 2 +- .../Private/ComponentTransformDetails.cpp | 30 +++--- .../Private/SlateBrushCustomization.cpp | 2 +- .../Private/SplineComponentDetails.cpp | 2 +- .../Private/SProjectBrowser.cpp | 2 +- .../Private/K2Node_LatentGameplayTaskCall.cpp | 2 +- .../SGraphNodeK2CreateDelegate.cpp | 2 +- .../GraphEditor/Private/SGraphEditorImpl.cpp | 2 +- .../Private/BPDelegateDragDropAction.cpp | 2 +- .../Private/BPFunctionDragDropAction.cpp | 2 +- .../Kismet/Private/BPVariableDragDropAction.h | 2 +- .../Private/BlueprintCompilationManager.cpp | 2 +- .../Private/BlueprintDetailsCustomization.cpp | 14 +-- .../Editor/Kismet/Private/BlueprintEditor.cpp | 12 +-- .../Private/BlueprintPaletteFavorites.cpp | 4 +- .../Kismet/Private/FindInBlueprintManager.cpp | 2 +- .../Kismet/Private/SBlueprintActionMenu.cpp | 2 +- .../Kismet/Private/SBlueprintPalette.cpp | 14 +-- .../Kismet/Private/SBlueprintSubPalette.cpp | 2 +- .../Kismet/Private/SKismetInspector.cpp | 2 +- .../Editor/Kismet/Private/SMyBlueprint.cpp | 4 +- .../Editor/Kismet/Private/SSCSEditor.cpp | 12 +-- .../Private/AnimBlueprintCompiler.cpp | 6 +- .../KismetCompiler/Private/KismetCompiler.cpp | 8 +- .../Private/KismetCompilerMisc.cpp | 4 +- .../UserDefinedStructureCompilerUtils.cpp | 2 +- .../Private/TrackEditors/EventTrackEditor.cpp | 2 +- .../Persona/Private/PersonaMeshDetails.cpp | 4 +- .../Private/SAnimationSequenceBrowser.cpp | 2 +- .../Private/PhysicsAssetEditor.cpp | 2 +- .../Private/EditConditionContext.cpp | 4 +- .../Private/PropertyCustomizationHelpers.cpp | 2 +- .../Private/ComponentTreeItem.cpp | 2 +- .../Private/StaticMeshEditorTools.cpp | 2 +- .../StaticMeshEditorViewportClient.cpp | 4 +- .../Private/TranslationEditor.cpp | 98 +++++++++---------- .../UMGDetailCustomizations.cpp | 4 +- .../Details/DetailWidgetExtensionHandler.cpp | 2 +- .../UMGEditor/Private/WidgetBlueprint.cpp | 14 +-- .../Private/WidgetBlueprintCompiler.cpp | 2 +- .../Private/WidgetBlueprintEditorUtils.cpp | 2 +- .../UnrealEd/Private/AssetSelection.cpp | 2 +- .../UnrealEd/Private/ComponentVisualizer.cpp | 4 +- .../Source/Editor/UnrealEd/Private/EdMode.cpp | 4 +- .../Editor/UnrealEd/Private/EditorEngine.cpp | 3 +- .../Private/Kismet2/BlueprintEditorUtils.cpp | 35 +++---- .../Private/Kismet2/ComponentEditorUtils.cpp | 2 +- .../UnrealEd/Private/Kismet2/Kismet2.cpp | 4 +- .../Private/Kismet2/Kismet2NameValidators.cpp | 2 +- .../Kismet2/KismetReinstanceUtilities.cpp | 2 +- .../Private/Kismet2/StructureEditorUtils.cpp | 14 +-- .../UnrealEd/Private/LevelEditorViewport.cpp | 10 +- .../Private/MaterialGraphNode_Comment.cpp | 2 +- .../UnrealEd/Private/SSocketManager.cpp | 2 +- .../Private/Tests/AutomationEditorCommon.cpp | 2 +- .../Tests/AutomationEditorPromotionCommon.cpp | 4 +- .../ActorViewportTransformable.cpp | 6 +- .../StreamingLevels/StreamingLevelModel.cpp | 2 +- .../UnrealHeaderTool/Private/HeaderParser.cpp | 2 +- .../CoreUObject/Private/UObject/Class.cpp | 11 ++- .../CoreUObject/Private/UObject/Field.cpp | 4 +- .../CoreUObject/Private/UObject/FieldPath.cpp | 2 +- .../CoreUObject/Private/UObject/Obj.cpp | 12 +-- .../CoreUObject/Private/UObject/Property.cpp | 4 +- .../Private/UObject/PropertyHelper.h | 2 +- .../Private/UObject/PropertyNumeric.cpp | 2 +- .../CoreUObject/Public/UObject/Field.h | 8 +- .../CoreUObject/Public/UObject/UnrealType.h | 82 +++++++++++++++- .../Engine/Classes/Engine/MemberReference.h | 16 +-- .../Engine/Classes/Materials/Material.h | 2 +- .../AI/Navigation/NavigationModifier.cpp | 2 +- .../Runtime/Engine/Private/ActorEditor.cpp | 2 +- .../Animation/AnimNode_CustomProperty.cpp | 4 +- .../Private/Animation/AnimSequenceBase.cpp | 2 +- .../Runtime/Engine/Private/Blueprint.cpp | 4 +- .../Private/BlueprintGeneratedClass.cpp | 4 +- .../Engine/Private/BlueprintMapLibrary.cpp | 2 +- .../Engine/Private/BlueprintSetLibrary.cpp | 2 +- .../Private/Collision/CollisionProfile.cpp | 4 +- .../Private/ComponentDelegateBinding.cpp | 12 +-- .../Private/Components/SplineComponent.cpp | 2 +- .../Runtime/Engine/Private/DataTable.cpp | 4 +- .../Runtime/Engine/Private/EngineTypes.cpp | 2 +- .../Engine/Private/GameViewportClient.cpp | 4 +- .../InstancedReferenceSubobjectHelper.cpp | 2 +- .../Engine/Private/KismetArrayLibrary.cpp | 2 +- .../Engine/Private/KismetSystemLibrary.cpp | 40 ++++---- .../Private/Materials/MaterialExpressions.cpp | 28 +++--- .../Runtime/Engine/Private/MatineeUtils.cpp | 4 +- .../Engine/Private/MemberReference.cpp | 7 +- .../Private/Net/NetPushModelHelpers.cpp | 2 +- .../Runtime/Engine/Private/NetworkDriver.cpp | 2 +- .../Private/Particles/ParticleModules.cpp | 2 +- .../PhysicsEngine/PhysicalMaterialMask.cpp | 4 +- .../Runtime/Engine/Private/SCS_Node.cpp | 2 +- .../Private/SimpleConstructionScript.cpp | 2 +- .../Runtime/Engine/Private/StaticMesh.cpp | 2 +- .../Internationalization/TextPropertyTest.cpp | 4 +- .../Runtime/Engine/Private/Timeline.cpp | 10 +- .../Runtime/Engine/Private/UnrealEngine.cpp | 6 +- .../GeometryCollectionComponent.cpp | 2 +- .../Private/GameplayTagContainer.cpp | 2 +- .../Private/GameplayTagsManager.cpp | 2 +- .../Private/MovieSceneCommonHelpers.cpp | 4 +- .../NavAreas/NavAreaMeta_SwitchByAgent.cpp | 2 +- .../Private/NavigationSystem.cpp | 6 +- .../Private/PropertyPathHelpers.cpp | 6 +- .../Private/StructDeserializer.cpp | 6 +- .../WidgetAnimationDelegateBinding.cpp | 2 +- .../Runtime/UMG/Private/Components/Widget.cpp | 2 +- .../Source/Runtime/UMG/Private/UserWidget.cpp | 6 +- .../Private/WidgetBlueprintGeneratedClass.cpp | 10 +- 172 files changed, 547 insertions(+), 473 deletions(-) diff --git a/Engine/Plugins/Animation/LiveLink/Source/LiveLinkMovieScene/Private/MovieScene/MovieSceneLiveLinkStructPropertyBindings.cpp b/Engine/Plugins/Animation/LiveLink/Source/LiveLinkMovieScene/Private/MovieScene/MovieSceneLiveLinkStructPropertyBindings.cpp index 6cb6e949482e..98d6edc2e281 100644 --- a/Engine/Plugins/Animation/LiveLink/Source/LiveLinkMovieScene/Private/MovieScene/MovieSceneLiveLinkStructPropertyBindings.cpp +++ b/Engine/Plugins/Animation/LiveLink/Source/LiveLinkMovieScene/Private/MovieScene/MovieSceneLiveLinkStructPropertyBindings.cpp @@ -195,7 +195,7 @@ template<> void FLiveLinkStructPropertyBindings::SetCurrentValueAt(int32 I FLiveLinkStructPropertyBindings::FPropertyWrapper FLiveLinkStructPropertyBindings::FindPropertyRecursive(const UScriptStruct* InStruct, TArray& InPropertyNames, uint32 Index, void* ContainerAddress, int32 PreviousDelta) { FPropertyWrapper FoundProperty; - FoundProperty.Property = FindField(InStruct, *InPropertyNames[Index]); + FoundProperty.Property = FindFProperty(InStruct, *InPropertyNames[Index]); FoundProperty.DeltaAddress = PreviousDelta; if (FStructProperty* StructProp = CastField(FoundProperty.Property.Get())) diff --git a/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientTransactionBridge.cpp b/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientTransactionBridge.cpp index 386e41b3582a..a0590611beb4 100644 --- a/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientTransactionBridge.cpp +++ b/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientTransactionBridge.cpp @@ -259,7 +259,7 @@ void ProcessTransactionEvent(const FConcertTransactionEventBase& InEvent, const // For snapshot events this also triggers PreEditChange directly since we can skip the call to PreEditUndo for (const FConcertSerializedPropertyData& PropertyData : ObjectUpdate.PropertyDatas) { - FProperty* TransactionProp = FindField(TransactionObject->GetClass(), PropertyData.PropertyName); + FProperty* TransactionProp = FindFProperty(TransactionObject->GetClass(), PropertyData.PropertyName); if (TransactionProp) { if (bIsSnapshot) @@ -302,7 +302,7 @@ void ProcessTransactionEvent(const FConcertTransactionEventBase& InEvent, const { for (const FConcertSerializedPropertyData& PropertyData : ObjectUpdate.PropertyDatas) { - FProperty* TransactionProp = FindField(TransactionObject->GetClass(), PropertyData.PropertyName); + FProperty* TransactionProp = FindFProperty(TransactionObject->GetClass(), PropertyData.PropertyName); if (TransactionProp) { FConcertSyncObjectReader ObjectReader(InLocalIdentifierTablePtr, FConcertSyncWorldRemapper(), InVersionInfo, TransactionObject, PropertyData.SerializedData); @@ -338,7 +338,7 @@ void ProcessTransactionEvent(const FConcertTransactionEventBase& InEvent, const // For snapshot events this also triggers PostEditChange directly since we can skip the call to PostEditUndo for (const FConcertSerializedPropertyData& PropertyData : ObjectUpdate.PropertyDatas) { - FProperty* TransactionProp = FindField(TransactionObject->GetClass(), PropertyData.PropertyName); + FProperty* TransactionProp = FindFProperty(TransactionObject->GetClass(), PropertyData.PropertyName); if (TransactionProp) { if (bIsSnapshot) diff --git a/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertSyncClientUtil.cpp b/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertSyncClientUtil.cpp index 7bb984f93ed3..60905495d5c0 100644 --- a/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertSyncClientUtil.cpp +++ b/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertSyncClientUtil.cpp @@ -231,7 +231,7 @@ TArray GetRootProperties(const TArray& InChangedProperties) FProperty* GetExportedProperty(const UStruct* InStruct, const FName InPropertyName, const bool InIncludeEditorOnlyData) { - FProperty* Property = FindField(InStruct, InPropertyName); + FProperty* Property = FindFProperty(InStruct, InPropertyName); // Filter the property if (Property diff --git a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/AssetTypeActions_GameplayTagAssetBase.cpp b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/AssetTypeActions_GameplayTagAssetBase.cpp index bf7af4ce4fe3..7221561e9efd 100644 --- a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/AssetTypeActions_GameplayTagAssetBase.cpp +++ b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/AssetTypeActions_GameplayTagAssetBase.cpp @@ -29,7 +29,7 @@ void FAssetTypeActions_GameplayTagAssetBase::GetActions(const TArray& UObject* CurObj = InObjects[ObjIdx]; if (CurObj) { - FStructProperty* StructProp = FindField(CurObj->GetClass(), OwnedGameplayTagPropertyName); + FStructProperty* StructProp = FindFProperty(CurObj->GetClass(), OwnedGameplayTagPropertyName); if(StructProp != NULL) { ContainerObjectOwners.Add(CurObj); diff --git a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTag.cpp b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTag.cpp index d3b6cc95b58b..e85a64f92ca3 100644 --- a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTag.cpp +++ b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTag.cpp @@ -23,7 +23,7 @@ void UGameplayTagsK2Node_SwitchGameplayTag::CreateFunctionPin() FunctionPin->bNotConnectable = true; FunctionPin->bHidden = true; - UFunction* Function = FindField(FunctionClass, FunctionName); + UFunction* Function = FindUField(FunctionClass, FunctionName); const bool bIsStaticFunc = Function->HasAllFunctionFlags(FUNC_Static); if (bIsStaticFunc) { diff --git a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTagContainer.cpp b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTagContainer.cpp index 8fed9e63f438..8338d34975b8 100644 --- a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTagContainer.cpp +++ b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsK2Node_SwitchGameplayTagContainer.cpp @@ -23,7 +23,7 @@ void UGameplayTagsK2Node_SwitchGameplayTagContainer::CreateFunctionPin() FunctionPin->bNotConnectable = true; FunctionPin->bHidden = true; - UFunction* Function = FindField(FunctionClass, FunctionName); + UFunction* Function = FindUField(FunctionClass, FunctionName); const bool bIsStaticFunc = Function->HasAllFunctionFlags(FUNC_Static); if (bIsStaticFunc) { diff --git a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/SGameplayTagQueryGraphPin.cpp b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/SGameplayTagQueryGraphPin.cpp index acdb106adae9..94e5367d94a9 100644 --- a/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/SGameplayTagQueryGraphPin.cpp +++ b/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/SGameplayTagQueryGraphPin.cpp @@ -43,7 +43,7 @@ void SGameplayTagQueryGraphPin::ParseDefaultValueData() { FString const TagQueryString = GraphPinObj->GetDefaultAsString(); - FProperty* const TQProperty = FindField(UEditableGameplayTagQuery::StaticClass(), TEXT("TagQueryExportText_Helper")); + FProperty* const TQProperty = FindFProperty(UEditableGameplayTagQuery::StaticClass(), TEXT("TagQueryExportText_Helper")); if (TQProperty) { FGameplayTagQuery* const TQ = TagQuery.Get(); diff --git a/Engine/Plugins/Enterprise/VariantManager/Source/VariantManager/Private/VariantManagerUtils.cpp b/Engine/Plugins/Enterprise/VariantManager/Source/VariantManager/Private/VariantManagerUtils.cpp index b3c62082e09d..99a147310c69 100644 --- a/Engine/Plugins/Enterprise/VariantManager/Source/VariantManager/Private/VariantManagerUtils.cpp +++ b/Engine/Plugins/Enterprise/VariantManager/Source/VariantManager/Private/VariantManagerUtils.cpp @@ -87,7 +87,7 @@ FArrayProperty* FVariantManagerUtils::GetOverrideMaterialsProperty() { if (!OverrideMaterialsProperty) { - OverrideMaterialsProperty = FindField( UMeshComponent::StaticClass(), GET_MEMBER_NAME_CHECKED( UMeshComponent, OverrideMaterials ) ); + OverrideMaterialsProperty = FindFProperty( UMeshComponent::StaticClass(), GET_MEMBER_NAME_CHECKED( UMeshComponent, OverrideMaterials ) ); } return OverrideMaterialsProperty; @@ -97,7 +97,7 @@ FStructProperty* FVariantManagerUtils::GetRelativeLocationProperty() { if (!RelativeLocationProperty) { - RelativeLocationProperty = FindField( USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName() ); + RelativeLocationProperty = FindFProperty( USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName() ); } return RelativeLocationProperty; @@ -107,7 +107,7 @@ FStructProperty* FVariantManagerUtils::GetRelativeRotationProperty() { if (!RelativeRotationProperty) { - RelativeRotationProperty = FindField( USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName() ); + RelativeRotationProperty = FindFProperty( USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName() ); } return RelativeRotationProperty; @@ -117,7 +117,7 @@ FStructProperty* FVariantManagerUtils::GetRelativeScale3DProperty() { if (!RelativeScale3DProperty) { - RelativeScale3DProperty = FindField( USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName() ); + RelativeScale3DProperty = FindFProperty( USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName() ); } return RelativeScale3DProperty; @@ -127,7 +127,7 @@ FBoolProperty* FVariantManagerUtils::GetVisibilityProperty() { if (!VisiblityProperty) { - VisiblityProperty = FindField( USceneComponent::StaticClass(), USceneComponent::GetVisiblePropertyName() ); + VisiblityProperty = FindFProperty( USceneComponent::StaticClass(), USceneComponent::GetVisiblePropertyName() ); } return VisiblityProperty; @@ -137,7 +137,7 @@ FStructProperty* FVariantManagerUtils::GetLightColorProperty() { if (!LightColorProperty) { - LightColorProperty = FindField( ULightComponent::StaticClass(), GET_MEMBER_NAME_CHECKED( ULightComponent, LightColor ) ); + LightColorProperty = FindFProperty( ULightComponent::StaticClass(), GET_MEMBER_NAME_CHECKED( ULightComponent, LightColor ) ); } return LightColorProperty; @@ -147,7 +147,7 @@ FStructProperty* FVariantManagerUtils::GetDefaultLightColorProperty() { if (!DefaultLightColorProperty) { - DefaultLightColorProperty = FindField( UAtmosphericFogComponent::StaticClass(), GET_MEMBER_NAME_CHECKED( UAtmosphericFogComponent, DefaultLightColor) ); + DefaultLightColorProperty = FindFProperty( UAtmosphericFogComponent::StaticClass(), GET_MEMBER_NAME_CHECKED( UAtmosphericFogComponent, DefaultLightColor) ); } return DefaultLightColorProperty; @@ -162,5 +162,4 @@ void FVariantManagerUtils::InvalidateCache(UClass* OldClass, UClass* NewClass, E VisiblityProperty = nullptr; LightColorProperty = nullptr; DefaultLightColorProperty = nullptr; -} -#undef GET_MEMBER_NAME_CHECKED \ No newline at end of file +}#undef GET_MEMBER_NAME_CHECKED \ No newline at end of file diff --git a/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValue.cpp b/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValue.cpp index 3edaafc5df8e..d18766ea8b68 100644 --- a/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValue.cpp +++ b/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValue.cpp @@ -1439,7 +1439,7 @@ bool UPropertyValue::ResolvePropertiesRecursive(UStruct* ContainerClass, void* C ParentContainerAddress = ContainerAddress; } - FProperty* Property = FindField(ContainerClass, *Seg.PropertyName); + FProperty* Property = FindFProperty(ContainerClass, *Seg.PropertyName); if (Property) { // Not the last link in the chain --> Dig down deeper updating our class/address if we jump an UObjectProp/UStructProp diff --git a/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValueMaterial.cpp b/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValueMaterial.cpp index d729d39d0bc5..14b171927a7c 100644 --- a/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValueMaterial.cpp +++ b/Engine/Plugins/Enterprise/VariantManagerContent/Source/VariantManagerContent/Private/PropertyValueMaterial.cpp @@ -102,7 +102,7 @@ bool UPropertyValueMaterial::ContainsProperty(const FProperty* Prop) const { if (OverrideMaterialsProperty == nullptr) { - if (FArrayProperty* ArrayProp = FindField(UMeshComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(UMeshComponent, OverrideMaterials))) + if (FArrayProperty* ArrayProp = FindFProperty(UMeshComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(UMeshComponent, OverrideMaterials))) { OverrideMaterialsProperty = ArrayProp->Inner; } diff --git a/Engine/Plugins/Experimental/BlueprintStats/Source/BlueprintStats/Private/BlueprintStats.cpp b/Engine/Plugins/Experimental/BlueprintStats/Source/BlueprintStats/Private/BlueprintStats.cpp index a985bb8d23f5..5299dd6f8b93 100644 --- a/Engine/Plugins/Experimental/BlueprintStats/Source/BlueprintStats/Private/BlueprintStats.cpp +++ b/Engine/Plugins/Experimental/BlueprintStats/Source/BlueprintStats/Private/BlueprintStats.cpp @@ -34,7 +34,7 @@ void FBlueprintStatRecord::ReadStatsFromBlueprint() NumUserMacros += SourceBlueprint->MacroGraphs.Num(); for (const UEdGraph* FunctionGraph : SourceBlueprint->FunctionGraphs) { - if (UFunction* Function = FindField(SourceBlueprint->GeneratedClass, FunctionGraph->GetFName())) + if (UFunction* Function = FindUField(SourceBlueprint->GeneratedClass, FunctionGraph->GetFName())) { // Make sure we've got the native decl if it was an override Function = GetSupererestFunction(Function); diff --git a/Engine/Plugins/Experimental/ControlRig/Source/ControlRigDeveloper/Private/ControlRigBlueprintUtils.cpp b/Engine/Plugins/Experimental/ControlRig/Source/ControlRigDeveloper/Private/ControlRigBlueprintUtils.cpp index d48c022d3b03..7bf7092beba6 100644 --- a/Engine/Plugins/Experimental/ControlRig/Source/ControlRigDeveloper/Private/ControlRigBlueprintUtils.cpp +++ b/Engine/Plugins/Experimental/ControlRig/Source/ControlRigDeveloper/Private/ControlRigBlueprintUtils.cpp @@ -42,7 +42,8 @@ FName FControlRigBlueprintUtils::ValidateName(UBlueprint* InBlueprint, const FSt if (UClass* ParentClass = InBlueprint->ParentClass) { - if (UField* ExisingField = FindField(ParentClass, *Name)) + FFieldVariant ExistingField = FindUFieldOrFProperty(ParentClass, *Name); + if (ExistingField) { Name = FString::Printf(TEXT("%s_%d"), *Name, 0); } diff --git a/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlate/Private/ImagePlateComponent.cpp b/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlate/Private/ImagePlateComponent.cpp index ae1db72896e6..5df0d23fd20c 100644 --- a/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlate/Private/ImagePlateComponent.cpp +++ b/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlate/Private/ImagePlateComponent.cpp @@ -447,7 +447,7 @@ void UImagePlateComponent::PostEditUndo() FStructProperty* UImagePlateComponent::GetImagePlateProperty() { - return FindField(StaticClass(), GET_MEMBER_NAME_CHECKED(UImagePlateComponent, Plate)); + return FindFProperty(StaticClass(), GET_MEMBER_NAME_CHECKED(UImagePlateComponent, Plate)); } #endif \ No newline at end of file diff --git a/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlateEditor/Private/ImagePlateTrackEditor.cpp b/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlateEditor/Private/ImagePlateTrackEditor.cpp index 2832d4e36930..3cb685296b49 100644 --- a/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlateEditor/Private/ImagePlateTrackEditor.cpp +++ b/Engine/Plugins/Experimental/ImagePlate/Source/ImagePlateEditor/Private/ImagePlateTrackEditor.cpp @@ -288,7 +288,7 @@ void FImagePlateTrackEditor::BuildObjectBindingTrackMenu(FMenuBuilder& MenuBuild check(ImagePlateComponent); FStructProperty* ImagePlateProperty = ImagePlateComponent->GetImagePlateProperty(); - FProperty* RenderTargetProperty = FindField(FImagePlateParameters::StaticStruct(), GET_MEMBER_NAME_CHECKED(FImagePlateParameters, RenderTexture)); + FProperty* RenderTargetProperty = FindFProperty(FImagePlateParameters::StaticStruct(), GET_MEMBER_NAME_CHECKED(FImagePlateParameters, RenderTexture)); check(ImagePlateProperty); check(RenderTargetProperty); diff --git a/Engine/Plugins/Importers/USDImporter/Source/USDImporter/Private/PropertyHelpers.cpp b/Engine/Plugins/Importers/USDImporter/Source/USDImporter/Private/PropertyHelpers.cpp index ce7bafc18f6d..d9a309eff6cf 100644 --- a/Engine/Plugins/Importers/USDImporter/Source/USDImporter/Private/PropertyHelpers.cpp +++ b/Engine/Plugins/Importers/USDImporter/Source/USDImporter/Private/PropertyHelpers.cpp @@ -19,7 +19,7 @@ namespace PropertyHelpers if (PropertyName.FindLastChar('[', OpenIndex)) { FString TruncatedPropertyName(OpenIndex, *PropertyName); - PropertyAndIndex.Property = FindField(InStruct, *TruncatedPropertyName); + PropertyAndIndex.Property = FindFProperty(InStruct, *TruncatedPropertyName); if (PropertyAndIndex.Property) { const int32 NumberLength = PropertyName.Len() - OpenIndex - 2; @@ -35,7 +35,7 @@ namespace PropertyHelpers } } - PropertyAndIndex.Property = FindField(InStruct, *PropertyName); + PropertyAndIndex.Property = FindFProperty(InStruct, *PropertyName); return PropertyAndIndex; } diff --git a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTActor.cpp b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTActor.cpp index c024025b184a..685a7ff094f9 100644 --- a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTActor.cpp +++ b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTActor.cpp @@ -210,7 +210,7 @@ bool ANUTActor::NotifyControlMessage(UNetConnection* Connection, uint8 MessageTy { // Assign LocalPlayerOwner property, to the PC owning this NUTActor, using reflection (to avoid dependency) FObjectProperty* LocalPlayerOwnerProp = - FindField(NewActor->GetClass(), TEXT("LocalPlayerOwner")); + FindFProperty(NewActor->GetClass(), TEXT("LocalPlayerOwner")); if (LocalPlayerOwnerProp != NULL) { @@ -694,7 +694,7 @@ void ANUTActor::ExecuteOnServer(UObject* InTargetObj, FString InTargetFunc) // and then send it to the server TempDelegate.BindUFunction(TargetObjCDO, TargetFuncName); - FDelegateProperty* DelProp = FindField(GetClass(), TEXT("TempDelegate")); + FDelegateProperty* DelProp = FindFProperty(GetClass(), TEXT("TempDelegate")); FString DelString; DelProp->ExportTextItem(DelString, DelProp->ContainerPtrToValuePtr(this), nullptr, this, 0, nullptr); @@ -730,7 +730,7 @@ bool ANUTActor::ServerExecute_Validate(const FString& InDelegate) void ANUTActor::ServerExecute_Implementation(const FString& InDelegate) { // Convert the string back into a delegate, and execute - FDelegateProperty* DelProp = FindField(GetClass(), TEXT("TempDelegate")); + FDelegateProperty* DelProp = FindFProperty(GetClass(), TEXT("TempDelegate")); const TCHAR* InDelText = *InDelegate; diff --git a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTUtilReflection.cpp b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTUtilReflection.cpp index 9caeb101b4da..34c101efdf46 100644 --- a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTUtilReflection.cpp +++ b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTUtilReflection.cpp @@ -135,7 +135,7 @@ FVMReflection& FVMReflection::operator ->*(FString PropertyName) if (FieldInstance.IsA(UClass::StaticClass())) { const UClass* ClassInstance = Cast(FieldInstance.ToUObject()); - FProperty* FoundProperty = FindField(ClassInstance, *PropertyName); + FProperty* FoundProperty = FindFProperty(ClassInstance, *PropertyName); if (FoundProperty != nullptr) { @@ -156,7 +156,7 @@ FVMReflection& FVMReflection::operator ->*(FString PropertyName) if (!IsPropertyArray() || (bVerifiedFieldType && bSetArrayElement)) { const UStruct* InnerStruct = Cast(FieldInstance.ToUObject()); - FProperty* FoundProperty = (InnerStruct != nullptr ? FindField(InnerStruct, *PropertyName) : nullptr); + FProperty* FoundProperty = (InnerStruct != nullptr ? FindFProperty(InnerStruct, *PropertyName) : nullptr); if (FoundProperty != nullptr) { diff --git a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Public/NUTUtilReflection.h b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Public/NUTUtilReflection.h index 65f284f794b5..db0019e61eae 100644 --- a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Public/NUTUtilReflection.h +++ b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Public/NUTUtilReflection.h @@ -77,18 +77,18 @@ class FFuncReflection; * * Old code (manual reflection): * // Reflection for AFortPlayerController->QuickBars - * FObjectProperty* QuickBarsProp = FindField(UnitPC->GetClass(), TEXT("QuickBars")); + * FObjectProperty* QuickBarsProp = FindFProperty(UnitPC->GetClass(), TEXT("QuickBars")); * UObject** QuickBarsRef = (QuickBarsProp != NULL ? QuickBarsProp->ContainerPtrToValuePtr(UnitPC.Get()) : NULL); * AActor* QuickBars = (QuickBarsRef != NULL ? Cast(*QuickBarsRef) : NULL); * * * // Reflection for AFortPlayerController->WorldInventory->Inventory->Items->ItemGuid - * FObjectProperty* WorldInvProp = FindField(UnitPC->GetClass(), TEXT("WorldInventory")); + * FObjectProperty* WorldInvProp = FindFProperty(UnitPC->GetClass(), TEXT("WorldInventory")); * UObject** WorldInvRef = (WorldInvProp != NULL ? WorldInvProp->ContainerPtrToValuePtr(UnitPC.Get()) : NULL); * AActor* WorldInv = (WorldInvRef != NULL ? Cast(*WorldInvRef) : NULL); - * FStructProperty* WIInventoryProp = (WorldInv != NULL ? FindField(WorldInv->GetClass(), TEXT("Inventory")) : NULL); + * FStructProperty* WIInventoryProp = (WorldInv != NULL ? FindFProperty(WorldInv->GetClass(), TEXT("Inventory")) : NULL); * void* WIInventoryRef = (WIInventoryProp != NULL ? WIInventoryProp->ContainerPtrToValuePtr(WorldInv) : NULL); - * FArrayProperty* InvItemsProp = (WIInventoryProp != NULL ? FindField(WIInventoryProp->Struct, TEXT("Items")) : NULL); + * FArrayProperty* InvItemsProp = (WIInventoryProp != NULL ? FindFProperty(WIInventoryProp->Struct, TEXT("Items")) : NULL); * FScriptArrayHelper* InvItemsArray = ((InvItemsProp != NULL && WIInventoryRef != NULL) ? * new FScriptArrayHelper(InvItemsProp, InvItemsProp->ContainerPtrToValuePtr(WIInventoryRef)) : NULL); * @@ -96,7 +96,7 @@ class FFuncReflection; * InvItemsArray->GetRawPtr(0) : NULL); * FStructProperty* InvItemsEntryProp = CastField(InvItemsProp != NULL ? InvItemsProp->Inner : NULL); * FStructProperty* EntryItemGuidProp = (InvItemsEntryProp != NULL ? - * FindField(InvItemsEntryProp->Struct, TEXT("ItemGuid")) : NULL); + * FindFProperty(InvItemsEntryProp->Struct, TEXT("ItemGuid")) : NULL); * FGuid* EntryItemGuidRef = (EntryItemGuidProp != NULL ? InvItemsEntryProp->ContainerPtrToValuePtr(InvItemsEntryRef) : NULL); * * ... @@ -868,7 +868,7 @@ public: * @param InFuncName The name of the function */ FFuncReflection(const TCHAR* InClassName, const TCHAR* InFuncName) - : FFuncReflection(FindField(FindObject(ANY_PACKAGE, InClassName), InFuncName), InFuncName) + : FFuncReflection(FindUField(FindObject(ANY_PACKAGE, InClassName), InFuncName), InFuncName) { } diff --git a/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp b/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp index 4320ef59e4b8..d1c28fe3b55b 100644 --- a/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp +++ b/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp @@ -218,7 +218,7 @@ void FGameplayAttribute::PostSerialize(const FArchive& Ar) } else if (!AttributeName.IsEmpty() && AttributeOwner != nullptr) { - Attribute = FindField(AttributeOwner, *AttributeName); + Attribute = FindFProperty(AttributeOwner, *AttributeName); if (!Attribute.Get()) { @@ -623,7 +623,7 @@ void FAttributeSetInitterDiscreteLevels::PreloadAttributeSetData(const TArray(*Set, *AttributeName); + FProperty* Property = FindFProperty(*Set, *AttributeName); if (!IsSupportedProperty(Property)) { ABILITY_LOG(Verbose, TEXT("FAttributeSetInitterDiscreteLevels::PreloadAttributeSetData Unable to match Attribute from %s (row: %s)"), *AttributeName, *RowName); diff --git a/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilitiesEditor/Private/AttributeDetails.cpp b/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilitiesEditor/Private/AttributeDetails.cpp index bc229d32d399..1dce998b5afa 100644 --- a/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilitiesEditor/Private/AttributeDetails.cpp +++ b/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilitiesEditor/Private/AttributeDetails.cpp @@ -125,7 +125,7 @@ void FAttributePropertyDetails::OnChangeProperty(TSharedPtr ItemSelecte UClass *FoundClass = FindObject(ANY_PACKAGE, *ClassName); if (FoundClass) { - FProperty *Property = FindField(FoundClass, *PropertyName); + FProperty *Property = FindFProperty(FoundClass, *PropertyName); if (Property) { MyProperty->SetValue(Property); diff --git a/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/EditorBuildPromotionTests.cpp b/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/EditorBuildPromotionTests.cpp index 099b1de9e103..42c4f6c076d1 100644 --- a/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/EditorBuildPromotionTests.cpp +++ b/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/EditorBuildPromotionTests.cpp @@ -377,7 +377,7 @@ namespace EditorBuildPromotionTestUtils */ static FString GetPropertyByName(UObject* TargetObject, const FString& InVariableName) { - FProperty* FoundProperty = FindField(TargetObject->GetClass(), *InVariableName); + FProperty* FoundProperty = FindFProperty(TargetObject->GetClass(), *InVariableName); if (FoundProperty) { FString ValueString; diff --git a/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/LightingTests.cpp b/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/LightingTests.cpp index 282f05e45c75..f123d0ae3b18 100644 --- a/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/LightingTests.cpp +++ b/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/LightingTests.cpp @@ -93,7 +93,7 @@ namespace LightingTestHelpers */ void SetPropertyByName(UObject* TargetObject, const FString& InVariableName, const FString& NewValueString) { - FProperty* FoundProperty = FindField(TargetObject->GetClass(), *InVariableName); + FProperty* FoundProperty = FindFProperty(TargetObject->GetClass(), *InVariableName); if (FoundProperty) { const FScopedTransaction PropertyChanged(LOCTEXT("PropertyChanged", "Object Property Change")); diff --git a/Engine/Source/Developer/AITestSuite/Public/BTBuilder.h b/Engine/Source/Developer/AITestSuite/Public/BTBuilder.h index e09683f9d79f..2e151b2005f7 100644 --- a/Engine/Source/Developer/AITestSuite/Public/BTBuilder.h +++ b/Engine/Source/Developer/AITestSuite/Public/BTBuilder.h @@ -174,7 +174,7 @@ struct FBTBuilder { UBTTask_RunBehavior* TaskNode = NewObject(ParentNode.GetTreeAsset()); - FObjectProperty* SubtreeProp = FindField(UBTTask_RunBehavior::StaticClass(), TEXT("BehaviorAsset")); + FObjectProperty* SubtreeProp = FindFProperty(UBTTask_RunBehavior::StaticClass(), TEXT("BehaviorAsset")); uint8* SubtreePropData = SubtreeProp->ContainerPtrToValuePtr(TaskNode); SubtreeProp->SetObjectPropertyValue(SubtreePropData, TreeAsset); @@ -213,15 +213,15 @@ struct FBTBuilder { UBTDecorator_Blackboard& BBDecorator = WithDecorator(ParentNode); - FByteProperty* ConditionProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("OperationType")); + FByteProperty* ConditionProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("OperationType")); uint8* ConditionPropData = ConditionProp->ContainerPtrToValuePtr(&BBDecorator); ConditionProp->SetIntPropertyValue(ConditionPropData, (uint64)Condition); - FByteProperty* ObserverProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("FlowAbortMode")); + FByteProperty* ObserverProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("FlowAbortMode")); uint8* ObserverPropData = ObserverProp->ContainerPtrToValuePtr(&BBDecorator); ObserverProp->SetIntPropertyValue(ObserverPropData, (uint64)Observer); - FStructProperty* KeyProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("BlackboardKey")); + FStructProperty* KeyProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("BlackboardKey")); FBlackboardKeySelector* KeyPropData = KeyProp->ContainerPtrToValuePtr(&BBDecorator); KeyPropData->SelectedKeyName = BoolKeyName; } @@ -230,23 +230,23 @@ struct FBTBuilder { UBTDecorator_Blackboard& BBDecorator = WithDecorator(ParentNode); - FByteProperty* ConditionProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("OperationType")); + FByteProperty* ConditionProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("OperationType")); uint8* ConditionPropData = ConditionProp->ContainerPtrToValuePtr(&BBDecorator); ConditionProp->SetIntPropertyValue(ConditionPropData, (uint64)Condition); - FByteProperty* ObserverProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("FlowAbortMode")); + FByteProperty* ObserverProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("FlowAbortMode")); uint8* ObserverPropData = ObserverProp->ContainerPtrToValuePtr(&BBDecorator); ObserverProp->SetIntPropertyValue(ObserverPropData, (uint64)Observer); - FByteProperty* NotifyModeProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("NotifyObserver")); + FByteProperty* NotifyModeProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("NotifyObserver")); uint8* NotifyModePropData = NotifyModeProp->ContainerPtrToValuePtr(&BBDecorator); NotifyModeProp->SetIntPropertyValue(NotifyModePropData, (uint64)NotifyMode); - FIntProperty* ConditionValueProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("IntValue")); + FIntProperty* ConditionValueProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("IntValue")); uint8* ConditionValuePropData = ConditionValueProp->ContainerPtrToValuePtr(&BBDecorator); ConditionValueProp->SetIntPropertyValue(ConditionValuePropData, (uint64)Value); - FStructProperty* KeyProp = FindField(UBTDecorator_Blackboard::StaticClass(), TEXT("BlackboardKey")); + FStructProperty* KeyProp = FindFProperty(UBTDecorator_Blackboard::StaticClass(), TEXT("BlackboardKey")); FBlackboardKeySelector* KeyPropData = KeyProp->ContainerPtrToValuePtr(&BBDecorator); KeyPropData->SelectedKeyName = IntKeyName; } diff --git a/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BPCompilerTests.cpp b/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BPCompilerTests.cpp index 3ca0b20500ad..2554dc312761 100644 --- a/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BPCompilerTests.cpp +++ b/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BPCompilerTests.cpp @@ -248,7 +248,7 @@ bool FBPCompilerCDOTest::RunTest(const FString& Parameters) { continue; } - FProperty* BPProperty = FindField(GeneratedTestInstance->GetClass(), *NativeProperty->GetName()); + FProperty* BPProperty = FindFProperty(GeneratedTestInstance->GetClass(), *NativeProperty->GetName()); if (!BPProperty) { AddError(*FString::Printf(TEXT("Cannot find property %s in BPGC"), *NativeProperty->GetName())); diff --git a/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendUtils.cpp b/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendUtils.cpp index a81d78269e37..5891bcfc4d79 100644 --- a/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendUtils.cpp +++ b/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendUtils.cpp @@ -153,7 +153,7 @@ FString FEmitterLocalContext::FindGloballyMappedObject(const UObject* Object, co const UStruct* FieldOwnerStruct = Field ? GetFieldOwnerStruct(Field) : nullptr; if (FieldOwnerStruct && (Field != FieldOwnerStruct)) { - ensure(Field == FindField(FieldOwnerStruct, Field->GetFName())); + ensure(Field == FindUField(FieldOwnerStruct, Field->GetFName())); const FString MappedOwner = FindGloballyMappedObject(FieldOwnerStruct, UStruct::StaticClass(), bLoadIfNotFound, bTryUsedAssetsList); if (!MappedOwner.IsEmpty() && ensure(MappedOwner != TEXT("nullptr"))) { diff --git a/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendValueHelper.cpp b/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendValueHelper.cpp index bb6f3a013c0d..f0a42f74bbc2 100644 --- a/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendValueHelper.cpp +++ b/Engine/Source/Developer/BlueprintCompilerCppBackend/Private/BlueprintCompilerCppBackendValueHelper.cpp @@ -1070,7 +1070,7 @@ FString FEmitDefaultValueHelper::HandleNonNativeComponent(FEmitterLocalContext& { const FString VariableCleanName = Node->GetVariableName().ToString(); - const FObjectProperty* VariableProperty = FindField(BPGC, *VariableCleanName); + const FObjectProperty* VariableProperty = FindFProperty(BPGC, *VariableCleanName); if (VariableProperty) { NativeVariablePropertyName = FEmitHelper::GetCppName(VariableProperty); @@ -1119,7 +1119,7 @@ FString FEmitDefaultValueHelper::HandleNonNativeComponent(FEmitterLocalContext& if (ParentNode) { const FString CleanParentVariableName = ParentNode->GetVariableName().ToString(); - const FObjectProperty* ParentVariableProperty = FindField(BPGC, *CleanParentVariableName); + const FObjectProperty* ParentVariableProperty = FindFProperty(BPGC, *CleanParentVariableName); ParentVariableName = ParentVariableProperty ? FEmitHelper::GetCppName(ParentVariableProperty) : CleanParentVariableName; } else if (USceneComponent* ParentComponentTemplate = Node->GetParentComponentTemplate(CastChecked(BPGC->ClassGeneratedBy))) @@ -1901,7 +1901,7 @@ void FEmitDefaultValueHelper::GenerateConstructor(FEmitterLocalContext& Context) // Check for a valid RootComponent property value; mark it as handled if already set in the defaults. bool bNeedsRootComponentAssignment = false; static const FName RootComponentPropertyName(TEXT("RootComponent")); - const FObjectProperty* RootComponentProperty = FindField(BPGC, RootComponentPropertyName); + const FObjectProperty* RootComponentProperty = FindFProperty(BPGC, RootComponentPropertyName); if (RootComponentProperty) { if (RootComponentProperty->GetObjectPropertyValue_InContainer(CDO)) diff --git a/Engine/Source/Editor/AdvancedPreviewScene/Private/AdvancedPreviewScene.cpp b/Engine/Source/Editor/AdvancedPreviewScene/Private/AdvancedPreviewScene.cpp index b98234e34252..64e08e8ec8df 100644 --- a/Engine/Source/Editor/AdvancedPreviewScene/Private/AdvancedPreviewScene.cpp +++ b/Engine/Source/Editor/AdvancedPreviewScene/Private/AdvancedPreviewScene.cpp @@ -308,7 +308,7 @@ void FAdvancedPreviewScene::SetFloorVisibility(const bool bVisible, const bool b { FName PropertyName("bShowFloor"); - FProperty* FloorProperty = FindField(FPreviewSceneProfile::StaticStruct(), PropertyName); + FProperty* FloorProperty = FindFProperty(FPreviewSceneProfile::StaticStruct(), PropertyName); DefaultSettings->Profiles[CurrentProfileIndex].bShowFloor = bVisible; FPropertyChangedEvent PropertyEvent(FloorProperty); @@ -326,7 +326,7 @@ void FAdvancedPreviewScene::SetEnvironmentVisibility(const bool bVisible, const // If not direct set visibility in profile and refresh the scene if (!bDirect) { - FProperty* EnvironmentProperty = FindField(FPreviewSceneProfile::StaticStruct(), GET_MEMBER_NAME_CHECKED(FPreviewSceneProfile, bShowEnvironment)); + FProperty* EnvironmentProperty = FindFProperty(FPreviewSceneProfile::StaticStruct(), GET_MEMBER_NAME_CHECKED(FPreviewSceneProfile, bShowEnvironment)); DefaultSettings->Profiles[CurrentProfileIndex].bShowEnvironment = bVisible; FPropertyChangedEvent PropertyEvent(EnvironmentProperty); @@ -408,7 +408,7 @@ void FAdvancedPreviewScene::HandleTogglePostProcessing() bPostProcessing = Profile.bPostProcessingEnabled; FName PropertyName("bPostProcessingEnabled"); - FProperty* PostProcessingProperty = FindField(FPreviewSceneProfile::StaticStruct(), PropertyName); + FProperty* PostProcessingProperty = FindFProperty(FPreviewSceneProfile::StaticStruct(), PropertyName); FPropertyChangedEvent PropertyEvent(PostProcessingProperty); DefaultSettings->PostEditChangeProperty(PropertyEvent); } diff --git a/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_Base.cpp b/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_Base.cpp index f6ab11407a0a..5d858e2d4bbb 100644 --- a/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_Base.cpp +++ b/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_Base.cpp @@ -222,7 +222,7 @@ void UAnimGraphNode_Base::GetPinAssociatedProperty(const UScriptStruct* NodeType { const FString ArrayName = PinNameStr.Left(UnderscoreIndex); - if (FArrayProperty* ArrayProperty = FindField(NodeType, *ArrayName)) + if (FArrayProperty* ArrayProperty = FindFProperty(NodeType, *ArrayName)) { const int32 ArrayIndex = FCString::Atoi(*(PinNameStr.Mid(UnderscoreIndex + 1))); @@ -234,7 +234,7 @@ void UAnimGraphNode_Base::GetPinAssociatedProperty(const UScriptStruct* NodeType // If the array check failed or we have no underscores if(OutProperty == nullptr) { - if (FProperty* Property = FindField(NodeType, InputPin->PinName)) + if (FProperty* Property = FindFProperty(NodeType, InputPin->PinName)) { OutProperty = Property; OutIndex = INDEX_NONE; @@ -255,7 +255,7 @@ FPoseLinkMappingRecord UAnimGraphNode_Base::GetLinkIDLocation(const UScriptStruc { const FString ArrayName = SourcePinName.Left(UnderscoreIndex); - if (FArrayProperty* ArrayProperty = FindField(NodeType, *ArrayName)) + if (FArrayProperty* ArrayProperty = FindFProperty(NodeType, *ArrayName)) { if (FStructProperty* Property = CastField(ArrayProperty->Inner)) { @@ -269,7 +269,7 @@ FPoseLinkMappingRecord UAnimGraphNode_Base::GetLinkIDLocation(const UScriptStruc } else { - if (FStructProperty* Property = FindField(NodeType, SourcePin->PinName)) + if (FStructProperty* Property = FindFProperty(NodeType, SourcePin->PinName)) { if (Property->Struct->IsChildOf(FPoseLinkBase::StaticStruct())) { diff --git a/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_CustomProperty.cpp b/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_CustomProperty.cpp index dcf1622f6a51..042b619b4eb7 100644 --- a/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_CustomProperty.cpp +++ b/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_CustomProperty.cpp @@ -104,7 +104,7 @@ void UAnimGraphNode_CustomProperty::GetInstancePinProperty(const UClass* InOwner // The actual name of the instance property FString FullName = GetPinTargetVariableName(InInputPin); - if(FProperty* Property = FindField(InOwnerInstanceClass, *FullName)) + if(FProperty* Property = FindFProperty(InOwnerInstanceClass, *FullName)) { OutProperty = Property; } diff --git a/Engine/Source/Editor/AnimGraph/Private/AnimationGraphSchema.cpp b/Engine/Source/Editor/AnimGraph/Private/AnimationGraphSchema.cpp index 98b1be0a239f..41cbabd67de4 100644 --- a/Engine/Source/Editor/AnimGraph/Private/AnimationGraphSchema.cpp +++ b/Engine/Source/Editor/AnimGraph/Private/AnimationGraphSchema.cpp @@ -268,7 +268,7 @@ void UAnimationGraphSchema::CreateFunctionGraphTerminators(UEdGraph& Graph, UCla RootNodeCreator.Finalize(); SetNodeMetaData(RootNode, FNodeMetadata::DefaultGraphNode); - UFunction* InterfaceToImplement = FindField(Class, GraphName); + UFunction* InterfaceToImplement = FindUField(Class, GraphName); if (InterfaceToImplement) { // Propagate group from metadata diff --git a/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardEditor.cpp b/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardEditor.cpp index f10905244bee..2c23b3be5fd7 100644 --- a/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardEditor.cpp +++ b/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardEditor.cpp @@ -115,7 +115,7 @@ void SBehaviorTreeBlackboardEditor::HandleDeleteEntry() BlackboardData->SetFlags(RF_Transactional); BlackboardData->Modify(); - FProperty* KeysProperty = FindField(UBlackboardData::StaticClass(), GET_MEMBER_NAME_CHECKED(UBlackboardData, Keys)); + FProperty* KeysProperty = FindFProperty(UBlackboardData::StaticClass(), GET_MEMBER_NAME_CHECKED(UBlackboardData, Keys)); BlackboardData->PreEditChange(KeysProperty); for(int32 ItemIndex = 0; ItemIndex < BlackboardData->Keys.Num(); ItemIndex++) @@ -246,7 +246,7 @@ void SBehaviorTreeBlackboardEditor::HandleKeyClassPicked(UClass* InClass) BlackboardData->SetFlags(RF_Transactional); BlackboardData->Modify(); - FProperty* KeysProperty = FindField(UBlackboardData::StaticClass(), GET_MEMBER_NAME_CHECKED(UBlackboardData, Keys)); + FProperty* KeysProperty = FindFProperty(UBlackboardData::StaticClass(), GET_MEMBER_NAME_CHECKED(UBlackboardData, Keys)); BlackboardData->PreEditChange(KeysProperty); // create a name for this new key diff --git a/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardView.cpp b/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardView.cpp index 3e1f514e59f9..531b57470b3e 100644 --- a/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardView.cpp +++ b/Engine/Source/Editor/BehaviorTreeEditor/Private/SBehaviorTreeBlackboardView.cpp @@ -219,8 +219,8 @@ private: BlackboardEntryAction->BlackboardData->Modify(); BlackboardEntryAction->Key.EntryName = NewName; - FProperty* KeysArrayProperty = FindField(UBlackboardData::StaticClass(), GET_MEMBER_NAME_CHECKED(UBlackboardData, Keys)); - FProperty* NameProperty = FindField(FBlackboardEntry::StaticStruct(), GET_MEMBER_NAME_CHECKED(FBlackboardEntry, EntryName)); + FProperty* KeysArrayProperty = FindFProperty(UBlackboardData::StaticClass(), GET_MEMBER_NAME_CHECKED(UBlackboardData, Keys)); + FProperty* NameProperty = FindFProperty(FBlackboardEntry::StaticStruct(), GET_MEMBER_NAME_CHECKED(FBlackboardEntry, EntryName)); FEditPropertyChain PropertyChain; PropertyChain.AddHead(KeysArrayProperty); PropertyChain.AddTail(NameProperty); diff --git a/Engine/Source/Editor/BlueprintGraph/Classes/EdGraphSchema_K2_Actions.h b/Engine/Source/Editor/BlueprintGraph/Classes/EdGraphSchema_K2_Actions.h index 6880d0259d14..61e88d958cda 100644 --- a/Engine/Source/Editor/BlueprintGraph/Classes/EdGraphSchema_K2_Actions.h +++ b/Engine/Source/Editor/BlueprintGraph/Classes/EdGraphSchema_K2_Actions.h @@ -517,7 +517,7 @@ public: FProperty* GetProperty() const { - return FindField(GetVariableScope(), VarName); + return FindFProperty(GetVariableScope(), VarName); } // FEdGraphSchemaAction interface @@ -781,7 +781,7 @@ public: FMulticastDelegateProperty* GetDelegateProperty() const { - return FindField(GetVariableClass(), GetVariableName()); + return FindFProperty(GetVariableClass(), GetVariableName()); } }; diff --git a/Engine/Source/Editor/BlueprintGraph/Private/BlueprintActionDatabase.cpp b/Engine/Source/Editor/BlueprintGraph/Private/BlueprintActionDatabase.cpp index ea220936886d..9ad9ea8c82d5 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/BlueprintActionDatabase.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/BlueprintActionDatabase.cpp @@ -819,7 +819,7 @@ static void BlueprintActionDatabaseImpl::AddBlueprintGraphActions(UBlueprint con for (UK2Node_FunctionEntry* FunctionEntry : GraphEntryNodes) { - UFunction* SkeletonFunction = FindField(Blueprint->SkeletonGeneratedClass, FunctionGraph->GetFName()); + UFunction* SkeletonFunction = FindUField(Blueprint->SkeletonGeneratedClass, FunctionGraph->GetFName()); // Create entries for function parameters if (SkeletonFunction != nullptr) diff --git a/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2.cpp b/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2.cpp index 22f05a7b06c8..5a153bc7df4f 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2.cpp @@ -3318,7 +3318,7 @@ void UEdGraphSchema_K2::CreateFunctionGraphTerminators(UEdGraph& Graph, UClass* SetNodeMetaData(EntryNode, FNodeMetadata::DefaultGraphNode); // See if we need to implement a return node - UFunction* InterfaceToImplement = FindField(Class, GraphName); + UFunction* InterfaceToImplement = FindUField(Class, GraphName); if (InterfaceToImplement) { // Add modifier flags from the declaration @@ -6556,7 +6556,7 @@ UEdGraph* UEdGraphSchema_K2::DuplicateGraph(UEdGraph* GraphToDuplicate) const { bIsOverrideGraph = true; } - else if (FindField(Blueprint->ParentClass, GraphToDuplicate->GetFName())) + else if (FindUField(Blueprint->ParentClass, GraphToDuplicate->GetFName())) { bIsOverrideGraph = true; } diff --git a/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2_Actions.cpp b/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2_Actions.cpp index c0538f25d9e8..9529162a4efd 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2_Actions.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/EdGraphSchema_K2_Actions.cpp @@ -189,7 +189,7 @@ UFunction* FEdGraphSchemaAction_K2Graph::GetFunction() const { if (FuncName != NAME_None) { - return FindField(SourceBlueprint->SkeletonGeneratedClass, FuncName); + return FindUField(SourceBlueprint->SkeletonGeneratedClass, FuncName); } } } diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ActorBoundEvent.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ActorBoundEvent.cpp index 60933707fab8..a5c3ffde80b0 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ActorBoundEvent.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ActorBoundEvent.cpp @@ -231,17 +231,17 @@ void UK2Node_ActorBoundEvent::InitializeActorBoundEventParams(AActor* InEventOwn FMulticastDelegateProperty* UK2Node_ActorBoundEvent::GetTargetDelegateProperty() const { - return FindField(DelegateOwnerClass, DelegatePropertyName); + return FindFProperty(DelegateOwnerClass, DelegatePropertyName); } FMulticastDelegateProperty* UK2Node_ActorBoundEvent::GetTargetDelegatePropertyFromSkel() const { - return FindField(FBlueprintEditorUtils::GetMostUpToDateClass(DelegateOwnerClass), DelegatePropertyName); + return FindFProperty(FBlueprintEditorUtils::GetMostUpToDateClass(DelegateOwnerClass), DelegatePropertyName); } bool UK2Node_ActorBoundEvent::IsUsedByAuthorityOnlyDelegate() const { - const FMulticastDelegateProperty* TargetDelegateProp = FindField(DelegateOwnerClass, DelegatePropertyName); + const FMulticastDelegateProperty* TargetDelegateProp = FindFProperty(DelegateOwnerClass, DelegatePropertyName); return (TargetDelegateProp && TargetDelegateProp->HasAnyPropertyFlags(CPF_BlueprintAuthorityOnly)); } diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_BreakStruct.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_BreakStruct.cpp index 0f42f1c78311..d32295d93c04 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_BreakStruct.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_BreakStruct.cpp @@ -84,7 +84,7 @@ public: void RegisterOutputTerm(FKismetFunctionContext& Context, UScriptStruct* StructType, UEdGraphPin* Net, FBPTerminal* ContextTerm) { - if (FProperty* BoundProperty = FindField(StructType, Net->PinName)) + if (FProperty* BoundProperty = FindFProperty(StructType, Net->PinName)) { if (BoundProperty->HasAnyPropertyFlags(CPF_Deprecated) && Net->LinkedTo.Num()) { diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CallFunction.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CallFunction.cpp index 0dd838af305c..d6dadbc5d7b9 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CallFunction.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CallFunction.cpp @@ -637,7 +637,7 @@ void UK2Node_CallFunction::AllocateDefaultPins() UBlueprint* FunctionBlueprint = CastChecked(BpClassOwner->ClassGeneratedBy, ECastCheckedType::NullAllowed); if (FunctionBlueprint) { - if (UFunction* SkelFunction = FindField(FunctionBlueprint->SkeletonGeneratedClass, FunctionReference.GetMemberName())) + if (UFunction* SkelFunction = FindUField(FunctionBlueprint->SkeletonGeneratedClass, FunctionReference.GetMemberName())) { Function = SkelFunction; } @@ -670,7 +670,7 @@ void UK2Node_CallFunction::AllocateDefaultPins() UClass* TestClass = *ClassIt; if (TestClass->IsChildOf(UBlueprintFunctionLibrary::StaticClass())) { - Function = FindField(TestClass, FunctionReference.GetMemberName()); + Function = FindUField(TestClass, FunctionReference.GetMemberName()); if (Function != NULL) { UClass* OldClass = FunctionReference.GetMemberParentClass(GetBlueprintClassFromNode()); @@ -723,7 +723,7 @@ void UK2Node_CallFunction::ReallocatePinsDuringReconstruction(TArray(SelfPin->PinType.PinSubCategoryObject.Get())) { - if (UFunction* NewFunction = FindField(SelfPinClass, FunctionReference.GetMemberName())) + if (UFunction* NewFunction = FindUField(SelfPinClass, FunctionReference.GetMemberName())) { SetFromFunction(NewFunction); } @@ -802,12 +802,12 @@ void UK2Node_CallFunction::CreateExecPinsForFunctionCall(const UFunction* Functi FProperty* Prop = nullptr; UEnum* Enum = nullptr; - if (FByteProperty* ByteProp = FindField(Function, EnumParamName)) + if (FByteProperty* ByteProp = FindFProperty(Function, EnumParamName)) { Prop = ByteProp; Enum = ByteProp->Enum; } - else if (FEnumProperty* EnumProp = FindField(Function, EnumParamName)) + else if (FEnumProperty* EnumProp = FindFProperty(Function, EnumParamName)) { Prop = EnumProp; Enum = EnumProp->GetEnum(); @@ -933,8 +933,8 @@ void UK2Node_CallFunction::DetermineWantsEnumToExecExpansion(const UFunction* Fu { const FName& EnumParamName = EnumNamesToCheck[i]; - FByteProperty* EnumProp = FindField(Function, EnumParamName); - if ((EnumProp != NULL && EnumProp->Enum != NULL) || FindField(Function, EnumParamName)) + FByteProperty* EnumProp = FindFProperty(Function, EnumParamName); + if ((EnumProp != NULL && EnumProp->Enum != NULL) || FindFProperty(Function, EnumParamName)) { bWantsEnumToExecExpansion = true; EnumNamesToCheck.RemoveAt(i); @@ -1797,7 +1797,7 @@ FString UK2Node_CallFunction::GetDocumentationLink() const { if (HasValidBlueprint()) { - UFunction* Function = FindField(GetBlueprint()->GeneratedClass, FunctionReference.GetMemberName()); + UFunction* Function = FindUField(GetBlueprint()->GeneratedClass, FunctionReference.GetMemberName()); if (Function != NULL) { ParentClass = Function->GetOwnerClass(); @@ -2171,7 +2171,7 @@ void UK2Node_CallFunction::Serialize(FArchive& Ar) { if (Ar.UE4Ver() < VER_UE4_SWITCH_CALL_NODE_TO_USE_MEMBER_REFERENCE) { - UFunction* Function = FindField(CallFunctionClass_DEPRECATED, CallFunctionName_DEPRECATED); + UFunction* Function = FindUField(CallFunctionClass_DEPRECATED, CallFunctionName_DEPRECATED); const bool bProbablySelfCall = (CallFunctionClass_DEPRECATED == NULL) || ((Function != NULL) && (Function->GetOuterUClass()->ClassGeneratedBy == GetBlueprint())); FunctionReference.SetDirect(CallFunctionName_DEPRECATED, FGuid(), CallFunctionClass_DEPRECATED, bProbablySelfCall); @@ -2336,11 +2336,11 @@ void UK2Node_CallFunction::ExpandNode(class FKismetCompilerContext& CompilerCont { UEnum* Enum = nullptr; - if (FByteProperty* ByteProp = FindField(Function, EnumParamName)) + if (FByteProperty* ByteProp = FindFProperty(Function, EnumParamName)) { Enum = ByteProp->Enum; } - else if (FEnumProperty* EnumProp = FindField(Function, EnumParamName)) + else if (FEnumProperty* EnumProp = FindFProperty(Function, EnumParamName)) { Enum = EnumProp->GetEnum(); } diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ComponentBoundEvent.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ComponentBoundEvent.cpp index ec7f9e04c870..b67140a920e4 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ComponentBoundEvent.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_ComponentBoundEvent.cpp @@ -101,7 +101,7 @@ bool UK2Node_ComponentBoundEvent::IsUsedByAuthorityOnlyDelegate() const FMulticastDelegateProperty* UK2Node_ComponentBoundEvent::GetTargetDelegateProperty() const { - return FindField(DelegateOwnerClass, DelegatePropertyName); + return FindFProperty(DelegateOwnerClass, DelegatePropertyName); } diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CustomEvent.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CustomEvent.cpp index 762be9b1cded..bdbc05c613b9 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CustomEvent.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_CustomEvent.cpp @@ -80,7 +80,7 @@ public: UBlueprint* Blueprint = CustomEvent->GetBlueprint(); check(Blueprint != NULL); - UFunction* ParentFunction = FindField(Blueprint->ParentClass, *Name); + UFunction* ParentFunction = FindUField(Blueprint->ParentClass, *Name); // if this custom-event is overriding a function belonging to the blueprint's parent if (ParentFunction != NULL) { @@ -243,7 +243,7 @@ bool UK2Node_CustomEvent::IsOverride() const UBlueprint* Blueprint = GetBlueprint(); check(Blueprint != NULL); - UFunction* ParentFunction = FindField(Blueprint->ParentClass, CustomFunctionName); + UFunction* ParentFunction = FindUField(Blueprint->ParentClass, CustomFunctionName); UK2Node_CustomEvent const* OverriddenEvent = FindCustomEventNodeFromFunction(ParentFunction); return (OverriddenEvent != NULL); @@ -257,7 +257,7 @@ uint32 UK2Node_CustomEvent::GetNetFlags() const UBlueprint* Blueprint = GetBlueprint(); check(Blueprint != NULL); - UFunction* ParentFunction = FindField(Blueprint->ParentClass, CustomFunctionName); + UFunction* ParentFunction = FindUField(Blueprint->ParentClass, CustomFunctionName); check(ParentFunction != NULL); // inherited net flags take precedence @@ -282,7 +282,7 @@ void UK2Node_CustomEvent::ValidateNodeDuringCompilation(class FCompilerResultsLo UBlueprint* Blueprint = GetBlueprint(); check(Blueprint != NULL); - UFunction* ParentFunction = FindField(Blueprint->ParentClass, CustomFunctionName); + UFunction* ParentFunction = FindUField(Blueprint->ParentClass, CustomFunctionName); // if this custom-event is overriding a function belonging to the blueprint's parent if (ParentFunction != NULL) { diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_DelegateSet.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_DelegateSet.cpp index bae5e522bc70..2fff06756c0f 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_DelegateSet.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_DelegateSet.cpp @@ -192,7 +192,7 @@ UEdGraphPin* UK2Node_DelegateSet::GetDelegateOwner() const UFunction* UK2Node_DelegateSet::GetDelegateSignature() { - FMulticastDelegateProperty* DelegateProperty = FindField(DelegatePropertyClass, DelegatePropertyName); + FMulticastDelegateProperty* DelegateProperty = FindFProperty(DelegatePropertyClass, DelegatePropertyName); if( !DelegateProperty ) { @@ -212,7 +212,7 @@ UFunction* UK2Node_DelegateSet::GetDelegateSignature() UFunction* UK2Node_DelegateSet::GetDelegateSignature() const { - FMulticastDelegateProperty* DelegateProperty = FindField(DelegatePropertyClass, DelegatePropertyName); + FMulticastDelegateProperty* DelegateProperty = FindFProperty(DelegatePropertyClass, DelegatePropertyName); if( !DelegateProperty ) { diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionEntry.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionEntry.cpp index 5380caf00d85..1f49d8223e19 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionEntry.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionEntry.cpp @@ -51,7 +51,7 @@ public: //@TODO: Still doesn't handle/allow users to declare new pass by reference, this only helps inherited functions if( Function ) { - if (FProperty* ParentProperty = FindField(Function, Net->PinName)) + if (FProperty* ParentProperty = FindFProperty(Function, Net->PinName)) { if (ParentProperty->HasAnyPropertyFlags(CPF_ReferenceParm)) { @@ -755,7 +755,7 @@ void UK2Node_FunctionEntry::ExpandNode(class FKismetCompilerContext& CompilerCon check(OriginalNode->GetOuter()); // Find the associated UFunction - UFunction* Function = FindField(CompilerContext.Blueprint->SkeletonGeneratedClass, *OriginalNode->GetOuter()->GetName()); + UFunction* Function = FindUField(CompilerContext.Blueprint->SkeletonGeneratedClass, *OriginalNode->GetOuter()->GetName()); // When regenerating on load, we may need to import text on certain properties to force load the assets TSharedPtr LocalVarData; diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionTerminator.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionTerminator.cpp index 490780cfa5b1..cc489c0117e0 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionTerminator.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionTerminator.cpp @@ -43,7 +43,7 @@ FName UK2Node_FunctionTerminator::CreateUniquePinName(FName InSourcePinName) con FName ResultName = InSourcePinName; int UniqueNum = 0; // Prevent the unique name from being the same as another of the UFunction's properties - while(FindPin(ResultName) || FindField(FoundFunction, ResultName) != nullptr) + while(FindPin(ResultName) || FindFProperty(FoundFunction, ResultName) != nullptr) { ResultName = *FString::Printf(TEXT("%s%d"), *InSourcePinName.ToString(), ++UniqueNum); } @@ -134,7 +134,7 @@ UFunction* UK2Node_FunctionTerminator::FindSignatureFunction() const if (!FoundFunction && FoundClass && GetOuter()) { // The resolve will fail if this is a locally-created function, so search using the event graph name - FoundFunction = FindField(FoundClass, *GetOuter()->GetName()); + FoundFunction = FindUField(FoundClass, *GetOuter()->GetName()); } return FoundFunction; diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetArrayItem.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetArrayItem.cpp index e56a8d5faa5c..43cb40053873 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetArrayItem.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetArrayItem.cpp @@ -205,7 +205,7 @@ void UK2Node_GetArrayItem::GetNodeContextMenuActions(UToolMenu* Menu, UGraphNode FSlateIcon UK2Node_GetArrayItem::GetIconAndTint(FLinearColor& OutColor) const { // emulate the icon/color that we used when this was a UK2Node_CallArrayFunction node - if (UFunction* WrappedFunction = FindField(UKismetArrayLibrary::StaticClass(), GET_FUNCTION_NAME_CHECKED(UKismetArrayLibrary, Array_Get))) + if (UFunction* WrappedFunction = FindUField(UKismetArrayLibrary::StaticClass(), GET_FUNCTION_NAME_CHECKED(UKismetArrayLibrary, Array_Get))) { return UK2Node_CallFunction::GetPaletteIconForFunction(WrappedFunction, OutColor); } diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetClassDefaults.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetClassDefaults.cpp index 9867fa9fd8b4..16b281651b62 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetClassDefaults.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_GetClassDefaults.cpp @@ -148,7 +148,7 @@ namespace UEdGraphPin* Pin = Node->Pins[PinIndex]; if(Pin != nullptr && Pin->Direction == EGPD_Output) { - FProperty* BoundProperty = FindField(ClassType, Pin->PinName); + FProperty* BoundProperty = FindFProperty(ClassType, Pin->PinName); if(BoundProperty != nullptr) { FBPTerminal* OutputTerm = Context.CreateLocalTerminalFromPinAutoChooseScope(Pin, Pin->PinName.ToString()); @@ -369,7 +369,7 @@ void UK2Node_GetClassDefaults::ExpandNode(class FKismetCompilerContext& Compiler { if(OutputPin != nullptr && OutputPin->Direction == EGPD_Output && OutputPin->LinkedTo.Num() > 0) { - FProperty* BoundProperty = FindField(ClassType, OutputPin->PinName); + FProperty* BoundProperty = FindFProperty(ClassType, OutputPin->PinName); if(BoundProperty != nullptr && (BoundProperty->IsA() || BoundProperty->IsA() || BoundProperty->IsA())) { UK2Node_TemporaryVariable* LocalVariable = CompilerContext.SpawnIntermediateNode(this, SourceGraph); diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_LoadAsset.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_LoadAsset.cpp index 55ae02b573ac..c99e5d1edb77 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_LoadAsset.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_LoadAsset.cpp @@ -147,7 +147,7 @@ void UK2Node_LoadAsset::ExpandNode(class FKismetCompilerContext& CompilerContext OnLoadEventNode->AllocateDefaultPins(); { UFunction* LoadAssetFunction = CallLoadAssetNode->GetTargetFunction(); - FDelegateProperty* OnLoadDelegateProperty = LoadAssetFunction ? FindField(LoadAssetFunction, DelegateOnLoadedParamName) : nullptr; + FDelegateProperty* OnLoadDelegateProperty = LoadAssetFunction ? FindFProperty(LoadAssetFunction, DelegateOnLoadedParamName) : nullptr; UFunction* OnLoadedSignature = OnLoadDelegateProperty ? OnLoadDelegateProperty->SignatureFunction : nullptr; ensure(OnLoadedSignature); for (TFieldIterator PropIt(OnLoadedSignature); PropIt && (PropIt->PropertyFlags & CPF_Parm); ++PropIt) diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MCDelegate.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MCDelegate.cpp index 2984fe5b710a..3411979a26da 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MCDelegate.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MCDelegate.cpp @@ -128,7 +128,7 @@ FString UK2Node_BaseMCDelegate::GetDocumentationLink() const { if (HasValidBlueprint()) { - UField* Delegate = FindField(GetBlueprint()->GeneratedClass, DelegateReference.GetMemberName()); + UField* Delegate = FindUField(GetBlueprint()->GeneratedClass, DelegateReference.GetMemberName()); if (Delegate) { ParentClass = Delegate->GetOwnerClass(); diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MultiGate.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MultiGate.cpp index 29888143017e..2f715b9eed0d 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MultiGate.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MultiGate.cpp @@ -105,42 +105,42 @@ public: FName MarkBitFunctionName = ""; UClass* MarkBitFunctionClass = NULL; GateNode->GetMarkBitFunction(MarkBitFunctionName, &MarkBitFunctionClass); - UFunction* MarkBitFunction = FindField(MarkBitFunctionClass, MarkBitFunctionName); + UFunction* MarkBitFunction = FindUField(MarkBitFunctionClass, MarkBitFunctionName); FName HasUnmarkedBitFunctionName = ""; UClass* HasUnmarkedBitFunctionClass = NULL; GateNode->GetHasUnmarkedBitFunction(HasUnmarkedBitFunctionName, &HasUnmarkedBitFunctionClass); - UFunction* HasUnmarkedBitFunction = FindField(HasUnmarkedBitFunctionClass, HasUnmarkedBitFunctionName); + UFunction* HasUnmarkedBitFunction = FindUField(HasUnmarkedBitFunctionClass, HasUnmarkedBitFunctionName); FName GetUnmarkedBitFunctionName = ""; UClass* GetUnmarkedBitFunctionClass = NULL; GateNode->GetUnmarkedBitFunction(GetUnmarkedBitFunctionName, &GetUnmarkedBitFunctionClass); - UFunction* GetUnmarkedBitFunction = FindField(GetUnmarkedBitFunctionClass, GetUnmarkedBitFunctionName); + UFunction* GetUnmarkedBitFunction = FindUField(GetUnmarkedBitFunctionClass, GetUnmarkedBitFunctionName); FName ConditionalFunctionName = ""; UClass* ConditionalFunctionClass = NULL; GateNode->GetConditionalFunction(ConditionalFunctionName, &ConditionalFunctionClass); - UFunction* ConditionFunction = FindField(ConditionalFunctionClass, ConditionalFunctionName); + UFunction* ConditionFunction = FindUField(ConditionalFunctionClass, ConditionalFunctionName); FName EqualityFunctionName = ""; UClass* EqualityFunctionClass = NULL; GateNode->GetEqualityFunction(EqualityFunctionName, &EqualityFunctionClass); - UFunction* EqualityFunction = FindField(EqualityFunctionClass, EqualityFunctionName); + UFunction* EqualityFunction = FindUField(EqualityFunctionClass, EqualityFunctionName); FName BoolNotEqualFunctionName = ""; UClass* BoolNotEqualFunctionClass = NULL; GateNode->GetBoolNotEqualFunction(BoolNotEqualFunctionName, &BoolNotEqualFunctionClass); - UFunction* BoolNotEqualFunction = FindField(BoolNotEqualFunctionClass, BoolNotEqualFunctionName); + UFunction* BoolNotEqualFunction = FindUField(BoolNotEqualFunctionClass, BoolNotEqualFunctionName); FName PrintStringFunctionName = ""; UClass* PrintStringFunctionClass = NULL; GateNode->GetPrintStringFunction(PrintStringFunctionName, &PrintStringFunctionClass); - UFunction* PrintFunction = FindField(PrintStringFunctionClass, PrintStringFunctionName); + UFunction* PrintFunction = FindUField(PrintStringFunctionClass, PrintStringFunctionName); FName ClearBitsFunctionName = ""; UClass* ClearBitsFunctionClass = NULL; GateNode->GetClearAllBitsFunction(ClearBitsFunctionName, &ClearBitsFunctionClass); - UFunction* ClearBitsFunction = FindField(ClearBitsFunctionClass, ClearBitsFunctionName); + UFunction* ClearBitsFunction = FindUField(ClearBitsFunctionClass, ClearBitsFunctionName); // Find the data terms if there is already a data node from expansion phase FBPTerminal* DataTerm = NULL; diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Switch.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Switch.cpp index 2b6cb719e747..70c267eedd52 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Switch.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Switch.cpp @@ -91,7 +91,7 @@ public: // Pull out function to use UClass* FuncClass = Cast(FuncPin->PinType.PinSubCategoryObject.Get()); - UFunction* FunctionPtr = FindField(FuncClass, FuncPin->PinName); + UFunction* FunctionPtr = FindUField(FuncClass, FuncPin->PinName); check(FunctionPtr); // Run thru all the output pins except for the default label @@ -248,7 +248,7 @@ void UK2Node_Switch::RemovePinFromSwitchNode(UEdGraphPin* TargetPin) // If removing the default pin, we'll need to reconstruct the node, so send a property changed event to handle that if(bHasDefaultPin && TargetPin == GetDefaultPin()) { - FProperty* HasDefaultPinProperty = FindField(GetClass(), "bHasDefaultPin"); + FProperty* HasDefaultPinProperty = FindFProperty(GetClass(), "bHasDefaultPin"); if(HasDefaultPinProperty) { PreEditChange(HasDefaultPinProperty); @@ -299,7 +299,7 @@ void UK2Node_Switch::CreateFunctionPin() FunctionPin->bNotConnectable = true; FunctionPin->bHidden = true; - UFunction* Function = FindField(FunctionClass, FunctionName); + UFunction* Function = FindUField(FunctionClass, FunctionName); const bool bIsStaticFunc = Function->HasAllFunctionFlags(FUNC_Static); if (bIsStaticFunc) { diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Variable.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Variable.cpp index e32d2954acaf..1769ed816d07 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Variable.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_Variable.cpp @@ -388,7 +388,7 @@ FProperty* UK2Node_Variable::GetPropertyForVariable_Internal(UClass* OwningClass UScriptStruct* SparseClassDataStruct = Scope ? Scope->GetSparseClassDataStruct() : nullptr; if (SparseClassDataStruct) { - VariableProperty = FindField(SparseClassDataStruct, VarName); + VariableProperty = FindFProperty(SparseClassDataStruct, VarName); } if (!VariableProperty) { @@ -638,7 +638,7 @@ FSlateIcon UK2Node_Variable::GetVariableIconAndColor(const UStruct* VarScope, FN { if(VarScope != NULL) { - FProperty* Property = FindField(VarScope, VarName); + FProperty* Property = FindFProperty(VarScope, VarName); if(Property != NULL) { const UEdGraphSchema_K2* K2Schema = GetDefault(); diff --git a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_VariableSet.cpp b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_VariableSet.cpp index 61575d101674..20d9e02e0158 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_VariableSet.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/K2Node_VariableSet.cpp @@ -302,7 +302,7 @@ bool UK2Node_VariableSet::ShouldFlushDormancyOnSet() const } // Flush net dormancy before setting a replicated property - FProperty *Property = FindField(GetVariableSourceClass(), GetVarName()); + FProperty *Property = FindFProperty(GetVariableSourceClass(), GetVarName()); return (Property != NULL && (Property->PropertyFlags & CPF_Net)); } diff --git a/Engine/Source/Editor/BlueprintGraph/Private/MakeStructHandler.cpp b/Engine/Source/Editor/BlueprintGraph/Private/MakeStructHandler.cpp index 110b2a318749..9c1044dc2b7d 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/MakeStructHandler.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/MakeStructHandler.cpp @@ -111,7 +111,7 @@ void FKCHandler_MakeStruct::Compile(FKismetFunctionContext& Context, UEdGraphNod { if (Pin && !Pin->bOrphanedPin && (Pin != StructPin) && (Pin->Direction == EGPD_Input) && !CompilerContext.GetSchema()->IsMetaPin(*Pin)) { - FProperty* BoundProperty = FindField(Node->StructType, Pin->PinName); + FProperty* BoundProperty = FindFProperty(Node->StructType, Pin->PinName); check(BoundProperty); // If the pin is not connectible, do not forward the net diff --git a/Engine/Source/Editor/BlueprintGraph/Private/StructMemberNodeHandlers.cpp b/Engine/Source/Editor/BlueprintGraph/Private/StructMemberNodeHandlers.cpp index a244a1201ba9..c025f3b865f8 100644 --- a/Engine/Source/Editor/BlueprintGraph/Private/StructMemberNodeHandlers.cpp +++ b/Engine/Source/Editor/BlueprintGraph/Private/StructMemberNodeHandlers.cpp @@ -60,7 +60,7 @@ static FBPTerminal* RegisterStructVar(FCompilerResultsLog& MessageLog, FKismetFu static void ResolveAndRegisterScopedStructTerm(FCompilerResultsLog& MessageLog, FKismetFunctionContext& Context, UScriptStruct* StructType, UEdGraphPin* Net, FBPTerminal* ContextTerm) { // Find the property for the struct - if (FProperty* BoundProperty = FindField(StructType, Net->PinName)) + if (FProperty* BoundProperty = FindFProperty(StructType, Net->PinName)) { // Create the term in the list FBPTerminal* Term = new FBPTerminal(); diff --git a/Engine/Source/Editor/ComponentVisualizers/Private/SplineComponentVisualizer.cpp b/Engine/Source/Editor/ComponentVisualizers/Private/SplineComponentVisualizer.cpp index 8019687fa1b7..d24dd42004d5 100644 --- a/Engine/Source/Editor/ComponentVisualizers/Private/SplineComponentVisualizer.cpp +++ b/Engine/Source/Editor/ComponentVisualizers/Private/SplineComponentVisualizer.cpp @@ -163,7 +163,7 @@ FSplineComponentVisualizer::FSplineComponentVisualizer() SplineComponentVisualizerActions = MakeShareable(new FUICommandList); - SplineCurvesProperty = FindField(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); + SplineCurvesProperty = FindFProperty(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); } void FSplineComponentVisualizer::OnRegister() @@ -2361,7 +2361,7 @@ void FSplineComponentVisualizer::OnSetVisualizeRollAndScale() SplineComp->bShouldVisualizeScale = !SplineComp->bShouldVisualizeScale; - NotifyPropertyModified(SplineComp, FindField(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, bShouldVisualizeScale))); + NotifyPropertyModified(SplineComp, FindFProperty(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, bShouldVisualizeScale))); GEditor->RedrawLevelEditingViewports(true); } @@ -2399,7 +2399,7 @@ void FSplineComponentVisualizer::OnSetDiscontinuousSpline() TArray Properties; Properties.Add(SplineCurvesProperty); - Properties.Add(FindField(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, bAllowDiscontinuousSpline))); + Properties.Add(FindFProperty(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, bAllowDiscontinuousSpline))); NotifyPropertiesModified(SplineComp, Properties); GEditor->RedrawLevelEditingViewports(true); diff --git a/Engine/Source/Editor/ComponentVisualizers/Private/SplineGeneratorPanel.cpp b/Engine/Source/Editor/ComponentVisualizers/Private/SplineGeneratorPanel.cpp index 8a8838309ab0..43aeab3db27f 100644 --- a/Engine/Source/Editor/ComponentVisualizers/Private/SplineGeneratorPanel.cpp +++ b/Engine/Source/Editor/ComponentVisualizers/Private/SplineGeneratorPanel.cpp @@ -50,7 +50,7 @@ void USplineGeneratorBase::Reset() SelectedSplineComponent->UpdateSpline(); SelectedSplineComponent->bSplineHasBeenEdited = true; - FProperty* SplineCurvesProperty = FindField(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); + FProperty* SplineCurvesProperty = FindFProperty(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); FComponentVisualizer::NotifyPropertyModified(SelectedSplineComponent.Get(), SplineCurvesProperty); GEditor->RedrawLevelEditingViewports(true); @@ -80,7 +80,7 @@ void USplineGeneratorBase::PreviewCurve() SelectedSplineComponent->UpdateSpline(); SelectedSplineComponent->bSplineHasBeenEdited = true; - FProperty* SplineCurvesProperty = FindField(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); + FProperty* SplineCurvesProperty = FindFProperty(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); FComponentVisualizer::NotifyPropertyModified(SelectedSplineComponent.Get(), SplineCurvesProperty); GEditor->RedrawLevelEditingViewports(true); diff --git a/Engine/Source/Editor/ContentBrowser/Private/AssetViewWidgets.cpp b/Engine/Source/Editor/ContentBrowser/Private/AssetViewWidgets.cpp index e7d0c48b48a8..ce53a7758937 100644 --- a/Engine/Source/Editor/ContentBrowser/Private/AssetViewWidgets.cpp +++ b/Engine/Source/Editor/ContentBrowser/Private/AssetViewWidgets.cpp @@ -1259,7 +1259,7 @@ void SAssetViewItem::CacheDisplayTags() continue; } - FProperty* TagField = FindField(AssetClass, TagAndValuePair.Key); + FProperty* TagField = FindFProperty(AssetClass, TagAndValuePair.Key); // Build the display name for this tag FText DisplayName; diff --git a/Engine/Source/Editor/ContentBrowser/Private/FrontendFilters.cpp b/Engine/Source/Editor/ContentBrowser/Private/FrontendFilters.cpp index b528ef00d898..97f5fc1080dc 100644 --- a/Engine/Source/Editor/ContentBrowser/Private/FrontendFilters.cpp +++ b/Engine/Source/Editor/ContentBrowser/Private/FrontendFilters.cpp @@ -106,7 +106,7 @@ public: for (const auto& KeyValuePair : InAssetData.TagsAndValues) { - if (FProperty* Field = FindField(AssetClass, KeyValuePair.Key)) + if (FProperty* Field = FindFProperty(AssetClass, KeyValuePair.Key)) { if (Field->HasMetaData(NAME_DisplayName)) { diff --git a/Engine/Source/Editor/ContentBrowser/Private/SAssetView.cpp b/Engine/Source/Editor/ContentBrowser/Private/SAssetView.cpp index 0a94dae7f442..784c8ea2c62c 100644 --- a/Engine/Source/Editor/ContentBrowser/Private/SAssetView.cpp +++ b/Engine/Source/Editor/ContentBrowser/Private/SAssetView.cpp @@ -2571,7 +2571,7 @@ void SAssetView::SetMajorityAssetType(FName NewMajorityAssetType) else { // If the tag name corresponds to a property name, use the property tooltip - FProperty* Property = FindField(TypeClass, TagName); + FProperty* Property = FindFProperty(TypeClass, TagName); TooltipText = (Property != nullptr) ? Property->GetToolTipText() : FText::FromString(FName::NameToDisplayString(TagName.ToString(), false)); } diff --git a/Engine/Source/Editor/DetailCustomizations/Private/ComponentMaterialCategory.cpp b/Engine/Source/Editor/DetailCustomizations/Private/ComponentMaterialCategory.cpp index e9df56e3435b..1300995a7706 100644 --- a/Engine/Source/Editor/DetailCustomizations/Private/ComponentMaterialCategory.cpp +++ b/Engine/Source/Editor/DetailCustomizations/Private/ComponentMaterialCategory.cpp @@ -293,19 +293,19 @@ void FComponentMaterialCategory::OnMaterialChanged( UMaterialInterface* NewMater UObject* EditChangeObject = CurrentComponent; if( CurrentComponent->IsA( UMeshComponent::StaticClass() ) ) { - MaterialProperty = FindField( UMeshComponent::StaticClass(), "OverrideMaterials" ); + MaterialProperty = FindFProperty( UMeshComponent::StaticClass(), "OverrideMaterials" ); } else if( CurrentComponent->IsA( UDecalComponent::StaticClass() ) ) { - MaterialProperty = FindField( UDecalComponent::StaticClass(), "DecalMaterial" ); + MaterialProperty = FindFProperty( UDecalComponent::StaticClass(), "DecalMaterial" ); } else if( CurrentComponent->IsA( UTextRenderComponent::StaticClass() ) ) { - MaterialProperty = FindField( UTextRenderComponent::StaticClass(), "TextMaterial" ); + MaterialProperty = FindFProperty( UTextRenderComponent::StaticClass(), "TextMaterial" ); } else if (CurrentComponent->IsA() ) { - MaterialProperty = FindField( ALandscapeProxy::StaticClass(), "LandscapeMaterial" ); + MaterialProperty = FindFProperty( ALandscapeProxy::StaticClass(), "LandscapeMaterial" ); EditChangeObject = CastChecked(CurrentComponent)->GetLandscapeProxy(); } diff --git a/Engine/Source/Editor/DetailCustomizations/Private/ComponentReferenceCustomization.cpp b/Engine/Source/Editor/DetailCustomizations/Private/ComponentReferenceCustomization.cpp index 8976f81cc8e7..139b8dd359c7 100644 --- a/Engine/Source/Editor/DetailCustomizations/Private/ComponentReferenceCustomization.cpp +++ b/Engine/Source/Editor/DetailCustomizations/Private/ComponentReferenceCustomization.cpp @@ -509,7 +509,7 @@ FText FComponentReferenceCustomization::OnGetComponentName() const if (UActorComponent* ActorComponent = CachedComponent.Get()) { const FName ComponentName = FComponentEditorUtils::FindVariableNameGivenComponentInstance(ActorComponent); - const bool bIsArrayVariable = !ComponentName.IsNone() && ActorComponent->GetOwner() != nullptr && FindField(ActorComponent->GetOwner()->GetClass(), ComponentName); + const bool bIsArrayVariable = !ComponentName.IsNone() && ActorComponent->GetOwner() != nullptr && FindFProperty(ActorComponent->GetOwner()->GetClass(), ComponentName); if (!ComponentName.IsNone() && !bIsArrayVariable) { diff --git a/Engine/Source/Editor/DetailCustomizations/Private/ComponentTransformDetails.cpp b/Engine/Source/Editor/DetailCustomizations/Private/ComponentTransformDetails.cpp index 4cbb4caee21c..61ce588526c1 100644 --- a/Engine/Source/Editor/DetailCustomizations/Private/ComponentTransformDetails.cpp +++ b/Engine/Source/Editor/DetailCustomizations/Private/ComponentTransformDetails.cpp @@ -606,15 +606,15 @@ void FComponentTransformDetails::OnSetAbsoluteTransform(ETransformField::Type Tr switch (TransformField) { case ETransformField::Location: - AbsoluteProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetAbsoluteLocationPropertyName()); + AbsoluteProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetAbsoluteLocationPropertyName()); TransactionText = LOCTEXT("ToggleAbsoluteLocation", "Toggle Absolute Location"); break; case ETransformField::Rotation: - AbsoluteProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetAbsoluteRotationPropertyName()); + AbsoluteProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetAbsoluteRotationPropertyName()); TransactionText = LOCTEXT("ToggleAbsoluteRotation", "Toggle Absolute Rotation"); break; case ETransformField::Scale: - AbsoluteProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetAbsoluteScalePropertyName()); + AbsoluteProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetAbsoluteScalePropertyName()); TransactionText = LOCTEXT("ToggleAbsoluteScale", "Toggle Absolute Scale"); break; default: @@ -968,56 +968,56 @@ void FComponentTransformDetails::OnSetTransform(ETransformField::Type TransformF { case ETransformField::Location: TransactionText = LOCTEXT("OnSetLocation", "Set Location"); - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); // Only set axis property for single axis set if (Axis == EAxisList::X) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, X)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, X)); } else if (Axis == EAxisList::Y) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Y)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Y)); } else if (Axis == EAxisList::Z) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Z)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Z)); } break; case ETransformField::Rotation: TransactionText = LOCTEXT("OnSetRotation", "Set Rotation"); - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName()); // Only set axis property for single axis set if (Axis == EAxisList::X) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FRotator, Roll)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FRotator, Roll)); } else if (Axis == EAxisList::Y) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FRotator, Pitch)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FRotator, Pitch)); } else if (Axis == EAxisList::Z) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FRotator, Yaw)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FRotator, Yaw)); } break; case ETransformField::Scale: TransactionText = LOCTEXT("OnSetScale", "Set Scale"); - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName()); // If keep scale is set, don't set axis property if (!bPreserveScaleRatio && Axis == EAxisList::X) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, X)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, X)); } else if (!bPreserveScaleRatio && Axis == EAxisList::Y) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Y)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Y)); } else if (!bPreserveScaleRatio && Axis == EAxisList::Z) { - AxisProperty = FindField(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Z)); + AxisProperty = FindFProperty(TBaseStructure::Get(), GET_MEMBER_NAME_CHECKED(FVector, Z)); } break; default: diff --git a/Engine/Source/Editor/DetailCustomizations/Private/SlateBrushCustomization.cpp b/Engine/Source/Editor/DetailCustomizations/Private/SlateBrushCustomization.cpp index bd07ececefd6..7502a45c7308 100644 --- a/Engine/Source/Editor/DetailCustomizations/Private/SlateBrushCustomization.cpp +++ b/Engine/Source/Editor/DetailCustomizations/Private/SlateBrushCustomization.cpp @@ -1223,7 +1223,7 @@ private: UMaterial* BaseMaterial = MaterialInterface->GetBaseMaterial(); if ( BaseMaterial && !BaseMaterial->IsUIMaterial() ) { - FProperty* MaterialDomainProp = FindField(UMaterial::StaticClass(), GET_MEMBER_NAME_CHECKED(UMaterial,MaterialDomain) ); + FProperty* MaterialDomainProp = FindFProperty(UMaterial::StaticClass(), GET_MEMBER_NAME_CHECKED(UMaterial,MaterialDomain) ); FScopedTransaction Transaction( FText::Format( NSLOCTEXT("FSlateBrushStructCustomization", "ChangeMaterialDomainTransaction", "Changed {0} to use the UI material domain"), FText::FromString( BaseMaterial->GetName() ) ) ); FMaterialUpdateContext MaterialUpdateContext; diff --git a/Engine/Source/Editor/DetailCustomizations/Private/SplineComponentDetails.cpp b/Engine/Source/Editor/DetailCustomizations/Private/SplineComponentDetails.cpp index 502f0eab6dd1..4806e64b8840 100644 --- a/Engine/Source/Editor/DetailCustomizations/Private/SplineComponentDetails.cpp +++ b/Engine/Source/Editor/DetailCustomizations/Private/SplineComponentDetails.cpp @@ -203,7 +203,7 @@ FSplinePointDetails::FSplinePointDetails(USplineComponent* InOwningSplineCompone SplineVisualizer = (FSplineComponentVisualizer*)Visualizer.Get(); check(SplineVisualizer); - SplineCurvesProperty = FindField(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); + SplineCurvesProperty = FindFProperty(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves)); UEnum* SplinePointTypeEnum = StaticEnum(); check(SplinePointTypeEnum); diff --git a/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp b/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp index c4528ff77ba6..970f7caa8630 100644 --- a/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp +++ b/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp @@ -1450,7 +1450,7 @@ void SProjectBrowser::OnAutoloadLastProjectChanged(ECheckBoxState NewState) UEditorSettings *Settings = GetMutableDefault(); Settings->bLoadTheMostRecentlyLoadedProjectAtStartup = (NewState == ECheckBoxState::Checked); - FProperty* AutoloadProjectProperty = FindField(Settings->GetClass(), "bLoadTheMostRecentlyLoadedProjectAtStartup"); + FProperty* AutoloadProjectProperty = FindFProperty(Settings->GetClass(), "bLoadTheMostRecentlyLoadedProjectAtStartup"); if (AutoloadProjectProperty != NULL) { FPropertyChangedEvent PropertyUpdateStruct(AutoloadProjectProperty); diff --git a/Engine/Source/Editor/GameplayTasksEditor/Private/K2Node_LatentGameplayTaskCall.cpp b/Engine/Source/Editor/GameplayTasksEditor/Private/K2Node_LatentGameplayTaskCall.cpp index 4890af3ad02a..160e730c733c 100644 --- a/Engine/Source/Editor/GameplayTasksEditor/Private/K2Node_LatentGameplayTaskCall.cpp +++ b/Engine/Source/Editor/GameplayTasksEditor/Private/K2Node_LatentGameplayTaskCall.cpp @@ -420,7 +420,7 @@ bool UK2Node_LatentGameplayTaskCall::ConnectSpawnProperties(UClass* ClassToSpawn { if (SpawnVarPin->LinkedTo.Num() == 0) { - FProperty* Property = FindField(ClassToSpawn, SpawnVarPin->PinName); + FProperty* Property = FindFProperty(ClassToSpawn, SpawnVarPin->PinName); // NULL property indicates that this pin was part of the original node, not the // class we're assigning to: if (!Property) diff --git a/Engine/Source/Editor/GraphEditor/Private/KismetNodes/SGraphNodeK2CreateDelegate.cpp b/Engine/Source/Editor/GraphEditor/Private/KismetNodes/SGraphNodeK2CreateDelegate.cpp index 4024ed05c19b..410e3aae6919 100644 --- a/Engine/Source/Editor/GraphEditor/Private/KismetNodes/SGraphNodeK2CreateDelegate.cpp +++ b/Engine/Source/Editor/GraphEditor/Private/KismetNodes/SGraphNodeK2CreateDelegate.cpp @@ -129,7 +129,7 @@ FText SGraphNodeK2CreateDelegate::GetCurrentFunctionDescription() const return FText::GetEmpty(); } - if (const UFunction* Func = FindField(ScopeClass, Node->GetFunctionName())) + if (const UFunction* Func = FindUField(ScopeClass, Node->GetFunctionName())) { return FunctionDescription(Func); } diff --git a/Engine/Source/Editor/GraphEditor/Private/SGraphEditorImpl.cpp b/Engine/Source/Editor/GraphEditor/Private/SGraphEditorImpl.cpp index 6b5522d0df2c..f6c82ab8390f 100644 --- a/Engine/Source/Editor/GraphEditor/Private/SGraphEditorImpl.cpp +++ b/Engine/Source/Editor/GraphEditor/Private/SGraphEditorImpl.cpp @@ -561,7 +561,7 @@ void SGraphEditorImpl::AddContextMenuCommentSection(UToolMenu* InMenu) // send property changed events const FScopedTransaction Transaction(LOCTEXT("EditNodeComment", "Change Node Comment")); SelectedNode->Modify(); - FProperty* NodeCommentProperty = FindField(SelectedNode->GetClass(), "NodeComment"); + FProperty* NodeCommentProperty = FindFProperty(SelectedNode->GetClass(), "NodeComment"); if (NodeCommentProperty != nullptr) { SelectedNode->PreEditChange(NodeCommentProperty); diff --git a/Engine/Source/Editor/Kismet/Private/BPDelegateDragDropAction.cpp b/Engine/Source/Editor/Kismet/Private/BPDelegateDragDropAction.cpp index 127eff459950..773ae6df9dab 100644 --- a/Engine/Source/Editor/Kismet/Private/BPDelegateDragDropAction.cpp +++ b/Engine/Source/Editor/Kismet/Private/BPDelegateDragDropAction.cpp @@ -146,7 +146,7 @@ bool FKismetDelegateDragDropAction::IsValid() const { return VariableSource.IsValid() && (VariableName != NAME_None) && - (NULL != FindField(VariableSource.Get(), VariableName)); + (NULL != FindFProperty(VariableSource.Get(), VariableName)); } bool FKismetDelegateDragDropAction::IsSupportedBySchema(const class UEdGraphSchema* Schema) const diff --git a/Engine/Source/Editor/Kismet/Private/BPFunctionDragDropAction.cpp b/Engine/Source/Editor/Kismet/Private/BPFunctionDragDropAction.cpp index e4662a3e4c1d..940a6a28166a 100644 --- a/Engine/Source/Editor/Kismet/Private/BPFunctionDragDropAction.cpp +++ b/Engine/Source/Editor/Kismet/Private/BPFunctionDragDropAction.cpp @@ -282,7 +282,7 @@ UFunction const* FKismetFunctionDragDropAction::GetFunctionProperty() const check(OwningClass != nullptr); check(FunctionName != NAME_None); - UFunction* Function = FindField(OwningClass, FunctionName); + UFunction* Function = FindUField(OwningClass, FunctionName); return Function; } diff --git a/Engine/Source/Editor/Kismet/Private/BPVariableDragDropAction.h b/Engine/Source/Editor/Kismet/Private/BPVariableDragDropAction.h index a203b6d8e743..25df08555cc4 100644 --- a/Engine/Source/Editor/Kismet/Private/BPVariableDragDropAction.h +++ b/Engine/Source/Editor/Kismet/Private/BPVariableDragDropAction.h @@ -42,7 +42,7 @@ public: { if (VariableSource.IsValid() && VariableName != NAME_None) { - return FindField(VariableSource.Get(), VariableName); + return FindFProperty(VariableSource.Get(), VariableName); } return nullptr; } diff --git a/Engine/Source/Editor/Kismet/Private/BlueprintCompilationManager.cpp b/Engine/Source/Editor/Kismet/Private/BlueprintCompilationManager.cpp index b014e2e4f515..bd091dfa0c2e 100644 --- a/Engine/Source/Editor/Kismet/Private/BlueprintCompilationManager.cpp +++ b/Engine/Source/Editor/Kismet/Private/BlueprintCompilationManager.cpp @@ -2586,7 +2586,7 @@ UClass* FBlueprintCompilationManagerImpl::FastGenerateSkeletonClass(UBlueprint* // __WorldContext: if(bIsStaticFunction) { - if( FindField(NewFunction, TEXT("__WorldContext")) == nullptr ) + if( FindFProperty(NewFunction, TEXT("__WorldContext")) == nullptr ) { FEdGraphPinType WorldContextPinType(UEdGraphSchema_K2::PC_Object, NAME_None, UObject::StaticClass(), EPinContainerType::None, false, FEdGraphTerminalType()); FProperty* Param = FKismetCompilerUtilities::CreatePropertyOnScope(NewFunction, TEXT("__WorldContext"), WorldContextPinType, Ret, CPF_None, Schema, MessageLog); diff --git a/Engine/Source/Editor/Kismet/Private/BlueprintDetailsCustomization.cpp b/Engine/Source/Editor/Kismet/Private/BlueprintDetailsCustomization.cpp index 655ada8727b8..23bbe8b5eabd 100644 --- a/Engine/Source/Editor/Kismet/Private/BlueprintDetailsCustomization.cpp +++ b/Engine/Source/Editor/Kismet/Private/BlueprintDetailsCustomization.cpp @@ -180,7 +180,7 @@ FReply FBlueprintDetails::HandleAddOrViewEventForVariable(const FName EventName, UBlueprint* BlueprintObj = GetBlueprintObj(); // Find the corresponding variable property in the Blueprint - FObjectProperty* VariableProperty = FindField(BlueprintObj->SkeletonGeneratedClass, PropertyName); + FObjectProperty* VariableProperty = FindFProperty(BlueprintObj->SkeletonGeneratedClass, PropertyName); if ( VariableProperty ) { @@ -773,7 +773,7 @@ void FBlueprintVarActionDetails::CustomizeDetails( IDetailLayoutBuilder& DetailL if(!IsALocalVariable(VariableProperty)) { - OriginalProperty = FindField(BlueprintObj->GeneratedClass, VariableProperty->GetFName()); + OriginalProperty = FindFProperty(BlueprintObj->GeneratedClass, VariableProperty->GetFName()); } else { @@ -2166,7 +2166,7 @@ void FBlueprintVarActionDetails::OnBitmaskChanged(ECheckBoxState InNewState) if (LocalBlueprint->GeneratedClass) { UObject* CDO = LocalBlueprint->GeneratedClass->GetDefaultObject(false); - FProperty* VarProperty = FindField(LocalBlueprint->GeneratedClass, VarName); + FProperty* VarProperty = FindFProperty(LocalBlueprint->GeneratedClass, VarName); if (CDO != nullptr && VarProperty != nullptr) { @@ -2233,7 +2233,7 @@ void FBlueprintVarActionDetails::OnBitmaskEnumTypeChanged(TSharedPtr It if (LocalBlueprint->GeneratedClass) { UObject* CDO = LocalBlueprint->GeneratedClass->GetDefaultObject(false); - FProperty* VarProperty = FindField(LocalBlueprint->GeneratedClass, VarName); + FProperty* VarProperty = FindFProperty(LocalBlueprint->GeneratedClass, VarName); if (CDO != nullptr && VarProperty != nullptr) { @@ -3883,7 +3883,7 @@ FText FBlueprintGraphActionDetails::GetCurrentReplicatedEventString() const uint32 NetFlags = CustomEvent->FunctionFlags & ReplicatedNetMask; if (CustomEvent->IsOverride()) { - UFunction* SuperFunction = FindField(CustomEvent->GetBlueprint()->ParentClass, CustomEvent->CustomFunctionName); + UFunction* SuperFunction = FindUField(CustomEvent->GetBlueprint()->ParentClass, CustomEvent->CustomFunctionName); check(SuperFunction != NULL); NetFlags = SuperFunction->FunctionFlags & ReplicatedNetMask; @@ -4349,7 +4349,7 @@ bool FBaseBlueprintGraphActionDetails::OnVerifyPinRename(UK2Node_EditablePinBase { // Check if the name conflicts with any of the other internal UFunction's property names (local variables and parameters). const UFunction* FoundFunction = FFunctionFromNodeHelper::FunctionFromNode(InTargetNode); - const FProperty* ExistingProperty = FindField(FoundFunction, *InNewName); + const FProperty* ExistingProperty = FindFProperty(FoundFunction, *InNewName); if (ExistingProperty) { OutErrorMessage = LOCTEXT("ConflictsWithProperty", "Conflicts with another local variable or function parameter!"); @@ -5881,7 +5881,7 @@ void FBlueprintComponentDetails::CustomizeDetails(IDetailLayoutBuilder& DetailLa if ( FBlueprintEditorUtils::DoesSupportEventGraphs(BlueprintObj) && Nodes.Num() == 1 ) { FName PropertyName = CachedNodePtr->GetVariableName(); - FObjectProperty* VariableProperty = FindField(BlueprintObj->SkeletonGeneratedClass, PropertyName); + FObjectProperty* VariableProperty = FindFProperty(BlueprintObj->SkeletonGeneratedClass, PropertyName); AddEventsCategory(DetailLayout, VariableProperty); } diff --git a/Engine/Source/Editor/Kismet/Private/BlueprintEditor.cpp b/Engine/Source/Editor/Kismet/Private/BlueprintEditor.cpp index 337ffe983951..efeac30dbf41 100644 --- a/Engine/Source/Editor/Kismet/Private/BlueprintEditor.cpp +++ b/Engine/Source/Editor/Kismet/Private/BlueprintEditor.cpp @@ -576,7 +576,7 @@ FSlateBrush const* FBlueprintEditor::GetVarIconAndColor(const UStruct* VarScope, { if (VarScope != NULL) { - FProperty* Property = FindField(VarScope, VarName); + FProperty* Property = FindFProperty(VarScope, VarName); if (Property != NULL) { const UEdGraphSchema_K2* K2Schema = GetDefault(); @@ -5557,7 +5557,7 @@ void FBlueprintEditor::ConvertFunctionToEvent(UK2Node_FunctionEntry* SelectedCal FVector2D SpawnPos = EventGraph->GetGoodPlaceForNewNode(); // Was this function implemented in as an override? - UFunction* ParentFunction = FindField(NodeBP->ParentClass, EventName); + UFunction* ParentFunction = FindUField(NodeBP->ParentClass, EventName); bool bIsOverrideFunc = Func->GetSuperFunction() || (ParentFunction != nullptr); const UEdGraphSchema_K2* K2Schema = GetDefault(); @@ -5738,7 +5738,7 @@ void FBlueprintEditor::ConvertEventToFunction(UK2Node_Event* SelectedEventNode) SourceGraph->Modify(); // Check if this is an override function - UFunction* ParentFunction = FindField(NodeBP->ParentClass, OriginalEventName); + UFunction* ParentFunction = FindUField(NodeBP->ParentClass, OriginalEventName); const bool bIsOverrideFunc = FunctionSig->GetSuperFunction() || (ParentFunction != nullptr); UClass* const OverrideFuncClass = FBlueprintEditorUtils::GetOverrideFunctionClass(NodeBP, OriginalEventName); @@ -5868,7 +5868,7 @@ void FBlueprintEditor::ConvertEventToFunction(UK2Node_Event* SelectedEventNode) FBlueprintEditorUtils::RenameGraph(NewGraph, *OriginalEventNameString); // If this function is blueprint callable, then spawn a function call node to it in place of the old event - UFunction* const NewFunction = FindField(NodeBP->SkeletonGeneratedClass, OriginalEventName); + UFunction* const NewFunction = FindUField(NodeBP->SkeletonGeneratedClass, OriginalEventName); if (NewFunction && NewFunction->HasAllFunctionFlags(FUNC_BlueprintCallable)) { IBlueprintNodeBinder::FBindingSet Bindings; @@ -7755,7 +7755,7 @@ UEdGraph* FBlueprintEditor::CollapseSelectionToFunction(TSharedPtr TempListBuilder.OwnerOfTemporaries->SetFlags(RF_Transient); IBlueprintNodeBinder::FBindingSet Bindings; - OutFunctionNode = UBlueprintFunctionNodeSpawner::Create(FindField(GetBlueprintObj()->SkeletonGeneratedClass, DocumentName))->Invoke(SourceGraph, Bindings, FVector2D::ZeroVector); + OutFunctionNode = UBlueprintFunctionNodeSpawner::Create(FindUField(GetBlueprintObj()->SkeletonGeneratedClass, DocumentName))->Invoke(SourceGraph, Bindings, FVector2D::ZeroVector); check(OutFunctionNode); @@ -8192,7 +8192,7 @@ void FBlueprintEditor::OnAddNewLocalVariable() UEdGraph* TargetGraph = FBlueprintEditorUtils::GetTopLevelGraph(FocusedGraphEdPtr.Pin()->GetCurrentGraph()); check(TargetGraph->GetSchema()->GetGraphType(TargetGraph) == GT_Function); - FName VarName = FBlueprintEditorUtils::FindUniqueKismetName(GetBlueprintObj(), TEXT("NewLocalVar"), FindField(GetBlueprintObj()->SkeletonGeneratedClass, TargetGraph->GetFName())); + FName VarName = FBlueprintEditorUtils::FindUniqueKismetName(GetBlueprintObj(), TEXT("NewLocalVar"), FindUField(GetBlueprintObj()->SkeletonGeneratedClass, TargetGraph->GetFName())); bool bSuccess = MyBlueprintWidget.IsValid() && FBlueprintEditorUtils::AddLocalVariable(GetBlueprintObj(), TargetGraph, VarName, MyBlueprintWidget->GetLastPinTypeUsed()); diff --git a/Engine/Source/Editor/Kismet/Private/BlueprintPaletteFavorites.cpp b/Engine/Source/Editor/Kismet/Private/BlueprintPaletteFavorites.cpp index 731a4d6990c2..8380d8ec20fa 100644 --- a/Engine/Source/Editor/Kismet/Private/BlueprintPaletteFavorites.cpp +++ b/Engine/Source/Editor/Kismet/Private/BlueprintPaletteFavorites.cpp @@ -401,7 +401,7 @@ void UBlueprintPaletteFavorites::RemoveFavorites(TArray< TSharedPtr(GetClass(), TEXT("CurrentProfile"))); + PreEditChange(FindFProperty(GetClass(), TEXT("CurrentProfile"))); { CurrentProfile = ProfileName; LoadSetProfile(); @@ -490,7 +490,7 @@ void UBlueprintPaletteFavorites::LoadCustomFavorites() //------------------------------------------------------------------------------ void UBlueprintPaletteFavorites::SetProfile(FString const& ProfileName) { - PreEditChange(FindField(GetClass(), TEXT("CurrentProfile"))); + PreEditChange(FindFProperty(GetClass(), TEXT("CurrentProfile"))); { CurrentProfile = ProfileName; } diff --git a/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp b/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp index 068701ff2127..9e8078cb4f13 100644 --- a/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp +++ b/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp @@ -758,7 +758,7 @@ namespace BlueprintSearchMetaDataHelpers SavePinTypeToJson(InWriter, VariableType); // Find the FProperty and convert it into a Json value. - FProperty* VariableProperty = FindField(InBlueprint->GeneratedClass, InVariableDescription.VarName); + FProperty* VariableProperty = FindFProperty(InBlueprint->GeneratedClass, InVariableDescription.VarName); if(VariableProperty) { const uint8* PropData = VariableProperty->ContainerPtrToValuePtr(InBlueprint->GeneratedClass->GetDefaultObject()); diff --git a/Engine/Source/Editor/Kismet/Private/SBlueprintActionMenu.cpp b/Engine/Source/Editor/Kismet/Private/SBlueprintActionMenu.cpp index f09336b5ce3d..d8311ab59e79 100644 --- a/Engine/Source/Editor/Kismet/Private/SBlueprintActionMenu.cpp +++ b/Engine/Source/Editor/Kismet/Private/SBlueprintActionMenu.cpp @@ -496,7 +496,7 @@ void SBlueprintActionMenu::ConstructActionContext(FBlueprintActionContext& Conte if (Nodes.Num() == 1 && Nodes[0]->GetNodeType() == FSCSEditorTreeNode::ComponentNode) { FName PropertyName = Nodes[0]->GetVariableName(); - FObjectProperty* VariableProperty = FindField(Blueprint->SkeletonGeneratedClass, PropertyName); + FObjectProperty* VariableProperty = FindFProperty(Blueprint->SkeletonGeneratedClass, PropertyName); ContextDescOut.SelectedObjects.Add(VariableProperty); } } diff --git a/Engine/Source/Editor/Kismet/Private/SBlueprintPalette.cpp b/Engine/Source/Editor/Kismet/Private/SBlueprintPalette.cpp index 5e7c1967d2ba..2901a4906df5 100644 --- a/Engine/Source/Editor/Kismet/Private/SBlueprintPalette.cpp +++ b/Engine/Source/Editor/Kismet/Private/SBlueprintPalette.cpp @@ -86,7 +86,7 @@ static FString GetVarType(UStruct* VarScope, FName VarName, bool bUseObjToolTip, if (VarScope) { - if (FProperty* Property = FindField(VarScope, VarName)) + if (FProperty* Property = FindFProperty(VarScope, VarName)) { // If it is an object property, see if we can get a nice class description instead of just the name FObjectProperty* ObjProp = CastField(Property); @@ -127,7 +127,7 @@ static FString GetVarTooltip(UBlueprint* InBlueprint, UClass* VarClass, FName Va if (VarClass) { - if (FProperty* Property = FindField(VarClass, VarName)) + if (FProperty* Property = FindFProperty(VarClass, VarName)) { // discover if the variable property is a non blueprint user variable UClass* SourceClass = Property->GetOwnerClass(); @@ -221,7 +221,7 @@ static void GetSubGraphIcon(FEdGraphSchemaAction_K2Graph const* const ActionIn, { // Need to see if this is a function overriding something in the parent, or ; - if (UFunction* OverrideFunc = FindField(BlueprintIn->ParentClass, ActionIn->FuncName)) + if (UFunction* OverrideFunc = FindUField(BlueprintIn->ParentClass, ActionIn->FuncName)) { ToolTipOut = LOCTEXT("Override_Tooltip", "Override"); } @@ -239,7 +239,7 @@ static void GetSubGraphIcon(FEdGraphSchemaAction_K2Graph const* const ActionIn, FFormatNamedArguments Args; Args.Add(TEXT("InterfaceName"), FText::FromName(ActionIn->FuncName)); ToolTipOut = FText::Format(LOCTEXT("FunctionFromInterface_Tooltip", "Function (from Interface '{InterfaceName}')"), Args); - if (UFunction* OverrideFunc = FindField(BlueprintIn->SkeletonGeneratedClass, ActionIn->FuncName)) + if (UFunction* OverrideFunc = FindUField(BlueprintIn->SkeletonGeneratedClass, ActionIn->FuncName)) { if (UEdGraphSchema_K2::FunctionCanBePlacedAsEvent(OverrideFunc)) { @@ -262,7 +262,7 @@ static void GetSubGraphIcon(FEdGraphSchemaAction_K2Graph const* const ActionIn, { IconOut = FEditorStyle::GetBrush(TEXT("GraphEditor.Animation_16x")); } - else if (UFunction* OverrideFunc = FindField(BlueprintIn->ParentClass, ActionIn->FuncName)) + else if (UFunction* OverrideFunc = FindUField(BlueprintIn->ParentClass, ActionIn->FuncName)) { const bool bIsPureFunction = OverrideFunc && OverrideFunc->HasAnyFunctionFlags(FUNC_BlueprintPure); IconOut = FEditorStyle::GetBrush(bIsPureFunction ? TEXT("GraphEditor.OverridePureFunction_16x") : TEXT("GraphEditor.OverrideFunction_16x")); @@ -270,7 +270,7 @@ static void GetSubGraphIcon(FEdGraphSchemaAction_K2Graph const* const ActionIn, } else { - UFunction* Function = FindField(BlueprintIn->SkeletonGeneratedClass, ActionIn->FuncName); + UFunction* Function = FindUField(BlueprintIn->SkeletonGeneratedClass, ActionIn->FuncName); const bool bIsPureFunction = Function && Function->HasAnyFunctionFlags(FUNC_BlueprintPure); IconOut = FEditorStyle::GetBrush(bIsPureFunction ? TEXT("GraphEditor.PureFunction_16x") : TEXT("GraphEditor.Function_16x")); @@ -1096,7 +1096,7 @@ void SBlueprintPaletteItem::Construct(const FArguments& InArgs, FCreateWidgetFor if (FEdGraphSchemaAction_K2Graph* FuncGraphAction = (FEdGraphSchemaAction_K2Graph*)(GraphAction.Get())) { - FunctionToCheck = FindField(Blueprint->SkeletonGeneratedClass, FuncGraphAction->FuncName); + FunctionToCheck = FindUField(Blueprint->SkeletonGeneratedClass, FuncGraphAction->FuncName); // Handle override/interface functions if(!FunctionToCheck) diff --git a/Engine/Source/Editor/Kismet/Private/SBlueprintSubPalette.cpp b/Engine/Source/Editor/Kismet/Private/SBlueprintSubPalette.cpp index eee6e2b1427d..c45d0b0c38e1 100644 --- a/Engine/Source/Editor/Kismet/Private/SBlueprintSubPalette.cpp +++ b/Engine/Source/Editor/Kismet/Private/SBlueprintSubPalette.cpp @@ -84,7 +84,7 @@ static bool CanPaletteItemBePlaced(TSharedPtr DropActionIn UClass const* const FuncOwner = CallFuncNode->FunctionReference.GetMemberParentClass(CallFuncNode->GetBlueprintClassFromNode()); check(FuncOwner != nullptr); - UFunction* const Function = FindField(FuncOwner, FuncName); + UFunction* const Function = FindUField(FuncOwner, FuncName); UEdGraphSchema_K2 const* const K2Schema = Cast(GraphSchema); if (Function == nullptr) diff --git a/Engine/Source/Editor/Kismet/Private/SKismetInspector.cpp b/Engine/Source/Editor/Kismet/Private/SKismetInspector.cpp index 60ba99f13adc..a0baadbf9317 100644 --- a/Engine/Source/Editor/Kismet/Private/SKismetInspector.cpp +++ b/Engine/Source/Editor/Kismet/Private/SKismetInspector.cpp @@ -703,7 +703,7 @@ void SKismetInspector::UpdateFromObjects(const TArray& PropertyObjects if (Object != EditableComponentTemplate) { - if (FObjectProperty* ObjectProperty = FindField(Object->GetClass(), EditableComponentTemplate->GetFName())) + if (FObjectProperty* ObjectProperty = FindFProperty(Object->GetClass(), EditableComponentTemplate->GetFName())) { SelectedObjectProperties.Add(ObjectProperty); } diff --git a/Engine/Source/Editor/Kismet/Private/SMyBlueprint.cpp b/Engine/Source/Editor/Kismet/Private/SMyBlueprint.cpp index c230fcd20bc0..2c6e84d58005 100644 --- a/Engine/Source/Editor/Kismet/Private/SMyBlueprint.cpp +++ b/Engine/Source/Editor/Kismet/Private/SMyBlueprint.cpp @@ -1103,7 +1103,7 @@ void SMyBlueprint::GetLocalVariables(FGraphActionSort& SortList) const Category = FText::GetEmpty(); } - UFunction* Func = FindField(GetBlueprintObj()->SkeletonGeneratedClass, TopLevelGraph->GetFName()); + UFunction* Func = FindUField(GetBlueprintObj()->SkeletonGeneratedClass, TopLevelGraph->GetFName()); if (Func) { TSharedPtr NewVarAction = MakeShareable(new FEdGraphSchemaAction_K2LocalVar(Category, FText::FromName(Variable.VarName), FText::GetEmpty(), 0, NodeSectionID::LOCAL_VARIABLE)); @@ -2747,7 +2747,7 @@ struct FDeleteEntryHelper { check(NULL != Blueprint); - const FProperty* VariableProperty = FindField(Blueprint->SkeletonGeneratedClass, VarName); + const FProperty* VariableProperty = FindFProperty(Blueprint->SkeletonGeneratedClass, VarName); const UClass* VarSourceClass = VariableProperty->GetOwnerChecked(); const bool bIsBlueprintVariable = (VarSourceClass == Blueprint->SkeletonGeneratedClass); const int32 VarInfoIndex = FBlueprintEditorUtils::FindNewVariableIndex(Blueprint, VariableProperty->GetFName()); diff --git a/Engine/Source/Editor/Kismet/Private/SSCSEditor.cpp b/Engine/Source/Editor/Kismet/Private/SSCSEditor.cpp index 02a121609152..f4690ec1cb70 100644 --- a/Engine/Source/Editor/Kismet/Private/SSCSEditor.cpp +++ b/Engine/Source/Editor/Kismet/Private/SSCSEditor.cpp @@ -964,7 +964,7 @@ FString FSCSEditorTreeNodeComponentBase::GetDisplayString() const bool const bHasValidVarName = (VariableName != NAME_None); bool const bIsArrayVariable = bHasValidVarName && (VariableOwner != nullptr) && - FindField(VariableOwner, VariableName); + FindFProperty(VariableOwner, VariableName); // Only display SCS node variable names in the tree if they have not been autogenerated if ((VariableName != NAME_None) && !bIsArrayVariable) @@ -1309,7 +1309,7 @@ UActorComponent* FSCSEditorTreeNode::FindComponentInstanceInActor(const AActor* if (VariableName != NAME_None) { UWorld* World = InActor->GetWorld(); - FObjectPropertyBase* Property = FindField(InActor->GetClass(), VariableName); + FObjectPropertyBase* Property = FindFProperty(InActor->GetClass(), VariableName); if (Property != NULL) { // Return the component instance that's stored in the property with the given variable name @@ -4083,7 +4083,7 @@ void SSCSEditor::BuildMenuEventsSection(FMenuBuilder& Menu, UBlueprint* Blueprin if( NodeIter->Component.IsValid() ) { FName VariableName = NodeIter->VariableName; - FObjectProperty* VariableProperty = FindField( Blueprint->SkeletonGeneratedClass, VariableName ); + FObjectProperty* VariableProperty = FindFProperty( Blueprint->SkeletonGeneratedClass, VariableName ); if( VariableProperty && FKismetEditorUtilities::FindBoundEventForComponent( Blueprint, EventName, VariableProperty->GetFName() )) { @@ -4138,7 +4138,7 @@ void SSCSEditor::CreateEventsForSelection(UBlueprint* Blueprint, FName EventName void SSCSEditor::ConstructEvent(UBlueprint* Blueprint, const FName EventName, const FComponentEventConstructionData EventData) { // Find the corresponding variable property in the Blueprint - FObjectProperty* VariableProperty = FindField(Blueprint->SkeletonGeneratedClass, EventData.VariableName ); + FObjectProperty* VariableProperty = FindFProperty(Blueprint->SkeletonGeneratedClass, EventData.VariableName ); if( VariableProperty ) { @@ -4152,7 +4152,7 @@ void SSCSEditor::ConstructEvent(UBlueprint* Blueprint, const FName EventName, co void SSCSEditor::ViewEvent(UBlueprint* Blueprint, const FName EventName, const FComponentEventConstructionData EventData) { // Find the corresponding variable property in the Blueprint - FObjectProperty* VariableProperty = FindField(Blueprint->SkeletonGeneratedClass, EventData.VariableName ); + FObjectProperty* VariableProperty = FindFProperty(Blueprint->SkeletonGeneratedClass, EventData.VariableName ); if( VariableProperty ) { @@ -4548,7 +4548,7 @@ void SSCSEditor::HighlightTreeNode(const USCS_Node* Node, FName Property) if( Property != FName() ) { UActorComponent* Component = TreeNode->GetComponentTemplate(); - FProperty* CurrentProp = FindField(Component->GetClass(), Property); + FProperty* CurrentProp = FindFProperty(Component->GetClass(), Property); FPropertyPath Path; if( CurrentProp ) { diff --git a/Engine/Source/Editor/KismetCompiler/Private/AnimBlueprintCompiler.cpp b/Engine/Source/Editor/KismetCompiler/Private/AnimBlueprintCompiler.cpp index fe1e030c0cb4..69d49596064d 100644 --- a/Engine/Source/Editor/KismetCompiler/Private/AnimBlueprintCompiler.cpp +++ b/Engine/Source/Editor/KismetCompiler/Private/AnimBlueprintCompiler.cpp @@ -769,7 +769,7 @@ void FAnimBlueprintCompilerContext::ProcessUseCachedPose(UAnimGraphNode_UseCache { if (UAnimGraphNode_SaveCachedPose* AssociatedSaveNode = SaveCachedPoseNodes.FindRef(UseCachedPose->SaveCachedPoseNode->CacheName)) { - FStructProperty* LinkProperty = FindField(FAnimNode_UseCachedPose::StaticStruct(), TEXT("LinkToCachingNode")); + FStructProperty* LinkProperty = FindFProperty(FAnimNode_UseCachedPose::StaticStruct(), TEXT("LinkToCachingNode")); check(LinkProperty); FPoseLinkMappingRecord LinkRecord = FPoseLinkMappingRecord::MakeFromMember(UseCachedPose, AssociatedSaveNode, LinkProperty); @@ -828,7 +828,7 @@ void FAnimBlueprintCompilerContext::ProcessCustomPropertyNode(UAnimGraphNode_Cus if (!bGenerateLinkedAnimGraphVariables) { UClass* InstClass = CustomPropNode->GetTargetSkeletonClass(); - if (FProperty* FoundProperty = FindField(InstClass, Pin->PinName)) + if (FProperty* FoundProperty = FindFProperty(InstClass, Pin->PinName)) { CustomPropNode->AddSourceTargetProperties(NewProperty->GetFName(), FoundProperty->GetFName()); } @@ -1793,7 +1793,7 @@ void FAnimBlueprintCompilerContext::CopyTermDefaultsToDefaultObject(UObject* Def { if (RootStructProp->Struct->IsChildOf(FAnimNode_Base::StaticStruct())) { - FStructProperty* ChildStructProp = FindField(NewAnimBlueprintClass, *RootStructProp->GetName()); + FStructProperty* ChildStructProp = FindFProperty(NewAnimBlueprintClass, *RootStructProp->GetName()); check(ChildStructProp); uint8* SourcePtr = RootStructProp->ContainerPtrToValuePtr(RootDefaultObject); uint8* DestPtr = ChildStructProp->ContainerPtrToValuePtr(DefaultAnimInstance); diff --git a/Engine/Source/Editor/KismetCompiler/Private/KismetCompiler.cpp b/Engine/Source/Editor/KismetCompiler/Private/KismetCompiler.cpp index f892624b1b26..a655390de975 100644 --- a/Engine/Source/Editor/KismetCompiler/Private/KismetCompiler.cpp +++ b/Engine/Source/Editor/KismetCompiler/Private/KismetCompiler.cpp @@ -572,7 +572,7 @@ void FKismetCompilerContext::ValidateVariableNames() else if (ParentClass->IsNative()) // the above case handles when the parent is a blueprint { FFieldVariant ExisingField = FindUFieldOrFProperty(ParentClass, *VarNameStr); - if (ExisingField.IsValid()) + if (ExisingField) { UE_LOG(LogK2Compiler, Warning, TEXT("ValidateVariableNames name %s (used in %s) is already taken by %s") , *VarNameStr, *Blueprint->GetPathName(), *ExisingField.GetPathName()); @@ -694,7 +694,7 @@ void FKismetCompilerContext::CreateClassVariablesFromBlueprint() { if(FMulticastDelegateProperty* AsDelegate = CastField(NewProperty)) { - AsDelegate->SignatureFunction = FindField(NewClass, *(Variable.VarName.ToString() + HEADER_GENERATED_DELEGATE_SIGNATURE_SUFFIX)); + AsDelegate->SignatureFunction = FindUField(NewClass, *(Variable.VarName.ToString() + HEADER_GENERATED_DELEGATE_SIGNATURE_SUFFIX)); // Skeleton compilation phase may run when the delegate has been created but the function has not: ensureAlways(AsDelegate->SignatureFunction || !bIsFullCompile); } @@ -1674,7 +1674,7 @@ void FKismetCompilerContext::PrecompileFunction(FKismetFunctionContext& Context, ); return; } - else if (NULL != FindField(NewClass, NewFunctionName)) + else if (NULL != FindFProperty(NewClass, NewFunctionName)) { MessageLog.Error( *FText::Format( @@ -1964,7 +1964,7 @@ void FKismetCompilerContext::PrecompileFunction(FKismetFunctionContext& Context, { Context.Function->FunctionFlags |= FUNC_Delegate; - if (FMulticastDelegateProperty* Property = FindField(NewClass, Context.DelegateSignatureName)) + if (FMulticastDelegateProperty* Property = FindFProperty(NewClass, Context.DelegateSignatureName)) { Property->SignatureFunction = Context.Function; } diff --git a/Engine/Source/Editor/KismetCompiler/Private/KismetCompilerMisc.cpp b/Engine/Source/Editor/KismetCompiler/Private/KismetCompilerMisc.cpp index ce86eb3065e4..b0a298611402 100644 --- a/Engine/Source/Editor/KismetCompiler/Private/KismetCompilerMisc.cpp +++ b/Engine/Source/Editor/KismetCompiler/Private/KismetCompilerMisc.cpp @@ -743,7 +743,7 @@ UEdGraphPin* FKismetCompilerUtilities::GenerateAssignmentNodes(class FKismetComp { if( OrgPin->LinkedTo.Num() == 0 ) { - FProperty* Property = FindField(ForClass, OrgPin->PinName); + FProperty* Property = FindFProperty(ForClass, OrgPin->PinName); // NULL property indicates that this pin was part of the original node, not the // class we're assigning to: if( !Property ) @@ -1290,7 +1290,7 @@ FFieldVariant FKismetCompilerUtilities::CheckPropertyNameOnScope(UStruct* Scope, if (Scope && !Scope->IsA() && (UBlueprintGeneratedClass::GetUberGraphFrameName() != PropertyName)) { - if (FProperty* Field = FindField(Scope->GetSuperStruct(), *NameStr)) + if (FProperty* Field = FindFProperty(Scope->GetSuperStruct(), *NameStr)) { return Field; } diff --git a/Engine/Source/Editor/KismetCompiler/Private/UserDefinedStructureCompilerUtils.cpp b/Engine/Source/Editor/KismetCompiler/Private/UserDefinedStructureCompilerUtils.cpp index ccf12f296bdf..a81233b03ddc 100644 --- a/Engine/Source/Editor/KismetCompiler/Private/UserDefinedStructureCompilerUtils.cpp +++ b/Engine/Source/Editor/KismetCompiler/Private/UserDefinedStructureCompilerUtils.cpp @@ -211,7 +211,7 @@ struct FUserDefinedStructureCompilerInner bool bIsNewVariable = false; if (FStructureEditorUtils::FStructEditorManager::ActiveChange == FStructureEditorUtils::EStructureEditorChangeInfo::DefaultValueChanged) { - VarProperty = FindField(Struct, VarDesc.VarName); + VarProperty = FindFProperty(Struct, VarDesc.VarName); if (!ensureMsgf(VarProperty, TEXT("Could not find the expected property (%s); was the struct (%s) unexpectedly sanitized?"), *VarDesc.VarName.ToString(), *Struct->GetName())) { VarProperty = FKismetCompilerUtilities::CreatePropertyOnScope(Struct, VarDesc.VarName, VarType, NULL, CPF_None, Schema, MessageLog); diff --git a/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/EventTrackEditor.cpp b/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/EventTrackEditor.cpp index 72b319ab1a77..6373b3d870f0 100644 --- a/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/EventTrackEditor.cpp +++ b/Engine/Source/Editor/MovieSceneTools/Private/TrackEditors/EventTrackEditor.cpp @@ -171,7 +171,7 @@ TSharedPtr FEventTrackEditor::BuildOutlinerEditWidget(const FGuid& Obje void FEventTrackEditor::BuildTrackContextMenu(FMenuBuilder& MenuBuilder, UMovieSceneTrack* Track) { UMovieSceneEventTrack* EventTrack = CastChecked(Track); - FProperty* EventPositionProperty = FindField(Track->GetClass(), GET_MEMBER_NAME_STRING_CHECKED(UMovieSceneEventTrack, EventPosition)); + FProperty* EventPositionProperty = FindFProperty(Track->GetClass(), GET_MEMBER_NAME_STRING_CHECKED(UMovieSceneEventTrack, EventPosition)); FGuid ObjectBinding; EventTrack->GetTypedOuter()->FindTrackBinding(*EventTrack, ObjectBinding); diff --git a/Engine/Source/Editor/Persona/Private/PersonaMeshDetails.cpp b/Engine/Source/Editor/Persona/Private/PersonaMeshDetails.cpp index b392b4d4241f..c095ea460b63 100644 --- a/Engine/Source/Editor/Persona/Private/PersonaMeshDetails.cpp +++ b/Engine/Source/Editor/Persona/Private/PersonaMeshDetails.cpp @@ -3940,7 +3940,7 @@ void FPersonaMeshDetails::OnMaterialArrayChanged(UMaterialInterface* NewMaterial // Whether or not we made a transaction and need to end it bool bMadeTransaction = false; - FProperty* MaterialProperty = FindField(USkeletalMesh::StaticClass(), "Materials"); + FProperty* MaterialProperty = FindFProperty(USkeletalMesh::StaticClass(), "Materials"); check(MaterialProperty); Mesh->PreEditChange(MaterialProperty); check(Mesh->Materials.Num() > SlotIndex) @@ -4118,7 +4118,7 @@ void FPersonaMeshDetails::OnMaterialNameCommitted(const FText& InValue, ETextCom { FScopedTransaction ScopeTransaction(LOCTEXT("PersonaMaterialSlotNameChanged", "Persona editor: Material slot name change")); - FProperty* ChangedProperty = FindField(USkeletalMesh::StaticClass(), "Materials"); + FProperty* ChangedProperty = FindFProperty(USkeletalMesh::StaticClass(), "Materials"); check(ChangedProperty); SkeletalMeshPtr->PreEditChange(ChangedProperty); diff --git a/Engine/Source/Editor/Persona/Private/SAnimationSequenceBrowser.cpp b/Engine/Source/Editor/Persona/Private/SAnimationSequenceBrowser.cpp index 1ba9e96681ae..09676ce022ab 100644 --- a/Engine/Source/Editor/Persona/Private/SAnimationSequenceBrowser.cpp +++ b/Engine/Source/Editor/Persona/Private/SAnimationSequenceBrowser.cpp @@ -1250,7 +1250,7 @@ TSharedRef SAnimationSequenceBrowser::CreateCustomAssetToolTip(FAssetD { // Check for DisplayName metadata FText DisplayName; - if (FProperty* Field = FindField(AssetClass, TagPair.Key)) + if (FProperty* Field = FindFProperty(AssetClass, TagPair.Key)) { DisplayName = Field->GetDisplayNameText(); } diff --git a/Engine/Source/Editor/PhysicsAssetEditor/Private/PhysicsAssetEditor.cpp b/Engine/Source/Editor/PhysicsAssetEditor/Private/PhysicsAssetEditor.cpp index 5520ea3ab7a4..ce94111b492d 100644 --- a/Engine/Source/Editor/PhysicsAssetEditor/Private/PhysicsAssetEditor.cpp +++ b/Engine/Source/Editor/PhysicsAssetEditor/Private/PhysicsAssetEditor.cpp @@ -1380,7 +1380,7 @@ bool FPhysicsAssetEditor::ShouldFilterAssetBasedOnSkeleton( const FAssetData& As void FPhysicsAssetEditor::CreateOrConvertConstraint(EPhysicsAssetEditorConstraintType ConstraintType) { //we have to manually call PostEditChange to ensure profiles are updated correctly - FProperty* DefaultInstanceProperty = FindField(UPhysicsConstraintTemplate::StaticClass(), GET_MEMBER_NAME_CHECKED(UPhysicsConstraintTemplate, DefaultInstance)); + FProperty* DefaultInstanceProperty = FindFProperty(UPhysicsConstraintTemplate::StaticClass(), GET_MEMBER_NAME_CHECKED(UPhysicsConstraintTemplate, DefaultInstance)); const FScopedTransaction Transaction( LOCTEXT( "CreateConvertConstraint", "Create Or Convert Constraint" ) ); diff --git a/Engine/Source/Editor/PropertyEditor/Private/EditConditionContext.cpp b/Engine/Source/Editor/PropertyEditor/Private/EditConditionContext.cpp index 61ad673a9333..70f1e2593068 100644 --- a/Engine/Source/Editor/PropertyEditor/Private/EditConditionContext.cpp +++ b/Engine/Source/Editor/PropertyEditor/Private/EditConditionContext.cpp @@ -39,7 +39,7 @@ const FBoolProperty* FEditConditionContext::GetSingleBoolProperty(const TSharedP return nullptr; } - const FProperty* Field = FindField(Property->GetOwnerStruct(), *PropertyToken->PropertyName); + const FProperty* Field = FindFProperty(Property->GetOwnerStruct(), *PropertyToken->PropertyName); BoolProperty = CastField(Field); // not a bool @@ -63,7 +63,7 @@ T* FindTypedField(const TWeakPtr& PropertyNode, const FString& Pr TSharedPtr PinnedNode = PropertyNode.Pin(); const FProperty* Property = PinnedNode->GetProperty(); - FProperty* Field = FindField(Property->GetOwnerStruct(), *PropertyName); + FProperty* Field = FindFProperty(Property->GetOwnerStruct(), *PropertyName); if (Field == nullptr) { if (!AlreadyLogged.Find(Field)) diff --git a/Engine/Source/Editor/PropertyEditor/Private/PropertyCustomizationHelpers.cpp b/Engine/Source/Editor/PropertyEditor/Private/PropertyCustomizationHelpers.cpp index 99e925bb078e..c63215b64acc 100644 --- a/Engine/Source/Editor/PropertyEditor/Private/PropertyCustomizationHelpers.cpp +++ b/Engine/Source/Editor/PropertyEditor/Private/PropertyCustomizationHelpers.cpp @@ -408,7 +408,7 @@ namespace PropertyCustomizationHelpers if ( ConditionPropertyName.Len() > 0 && !ConditionPropertyName.Contains(TEXT(".")) ) { UStruct* Scope = InProperty->GetOwnerStruct(); - EditConditionProperty = FindField(Scope, *ConditionPropertyName); + EditConditionProperty = FindFProperty(Scope, *ConditionPropertyName); } } diff --git a/Engine/Source/Editor/SceneOutliner/Private/ComponentTreeItem.cpp b/Engine/Source/Editor/SceneOutliner/Private/ComponentTreeItem.cpp index 95000b42d00e..2f45a5783c23 100644 --- a/Engine/Source/Editor/SceneOutliner/Private/ComponentTreeItem.cpp +++ b/Engine/Source/Editor/SceneOutliner/Private/ComponentTreeItem.cpp @@ -37,7 +37,7 @@ FComponentTreeItem::FComponentTreeItem(UActorComponent* InComponent) bExistsInCurrentWorldAndPIE = GEditor->ObjectsThatExistInEditorWorld.Get(OwningActor); const FName VariableName = FComponentEditorUtils::FindVariableNameGivenComponentInstance(InComponent); - const bool bIsArrayVariable = !VariableName.IsNone() && InComponent->GetOwner() != nullptr && FindField(InComponent->GetOwner()->GetClass(), VariableName); + const bool bIsArrayVariable = !VariableName.IsNone() && InComponent->GetOwner() != nullptr && FindFProperty(InComponent->GetOwner()->GetClass(), VariableName); if (!VariableName.IsNone() && !bIsArrayVariable) { diff --git a/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorTools.cpp b/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorTools.cpp index 3e816c7f0af7..ef56340c248b 100644 --- a/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorTools.cpp +++ b/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorTools.cpp @@ -2819,7 +2819,7 @@ void FMeshMaterialsLayout::OnMaterialNameCommitted(const FText& InValue, ETextCo FScopedTransaction ScopeTransaction(LOCTEXT("StaticMeshEditorMaterialSlotNameChanged", "Staticmesh editor: Material slot name change")); FProperty* ChangedProperty = NULL; - ChangedProperty = FindField(UStaticMesh::StaticClass(), "StaticMaterials"); + ChangedProperty = FindFProperty(UStaticMesh::StaticClass(), "StaticMaterials"); check(ChangedProperty); StaticMesh.PreEditChange(ChangedProperty); diff --git a/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorViewportClient.cpp b/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorViewportClient.cpp index fd0f07a0f0aa..263a2e58dc17 100644 --- a/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorViewportClient.cpp +++ b/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorViewportClient.cpp @@ -179,7 +179,7 @@ bool FStaticMeshEditorViewportClient::InputWidgetDelta( FViewport* InViewport, E const FWidget::EWidgetMode MoveMode = GetWidgetMode(); if(MoveMode == FWidget::WM_Rotate) { - ChangedProperty = FindField( UStaticMeshSocket::StaticClass(), "RelativeRotation" ); + ChangedProperty = FindFProperty( UStaticMeshSocket::StaticClass(), "RelativeRotation" ); SelectedSocket->PreEditChange(ChangedProperty); FRotator CurrentRot = SelectedSocket->RelativeRotation; @@ -198,7 +198,7 @@ bool FStaticMeshEditorViewportClient::InputWidgetDelta( FViewport* InViewport, E } else if(MoveMode == FWidget::WM_Translate) { - ChangedProperty = FindField( UStaticMeshSocket::StaticClass(), "RelativeLocation" ); + ChangedProperty = FindFProperty( UStaticMeshSocket::StaticClass(), "RelativeLocation" ); SelectedSocket->PreEditChange(ChangedProperty); //FRotationMatrix SocketRotTM( SelectedSocket->RelativeRotation ); diff --git a/Engine/Source/Editor/TranslationEditor/Private/TranslationEditor.cpp b/Engine/Source/Editor/TranslationEditor/Private/TranslationEditor.cpp index c9504646b41b..3f87a0246d19 100644 --- a/Engine/Source/Editor/TranslationEditor/Private/TranslationEditor.cpp +++ b/Engine/Source/Editor/TranslationEditor/Private/TranslationEditor.cpp @@ -251,8 +251,8 @@ TSharedRef FTranslationEditor::SpawnTab_Untranslated( const FSpawnTabA FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked( "PropertyEditor" ); - FProperty* SourceProperty = FindField( UTranslationUnit::StaticClass(), "Source"); - FProperty* TranslationProperty = FindField( UTranslationUnit::StaticClass(), "Translation"); + FProperty* SourceProperty = FindFProperty( UTranslationUnit::StaticClass(), "Source"); + FProperty* TranslationProperty = FindFProperty( UTranslationUnit::StaticClass(), "Translation"); // create empty property table UntranslatedPropertyTable = PropertyEditorModule.CreatePropertyTable(); @@ -307,8 +307,8 @@ TSharedRef FTranslationEditor::SpawnTab_Review( const FSpawnTabArgs& A { check( Args.GetTabId().TabType == ReviewTabId ); - FProperty* SourceProperty = FindField( UTranslationUnit::StaticClass(), "Source"); - FProperty* TranslationProperty = FindField( UTranslationUnit::StaticClass(), "Translation"); + FProperty* SourceProperty = FindFProperty( UTranslationUnit::StaticClass(), "Source"); + FProperty* TranslationProperty = FindFProperty( UTranslationUnit::StaticClass(), "Translation"); FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked( "PropertyEditor" ); @@ -330,9 +330,9 @@ TSharedRef FTranslationEditor::SpawnTab_Review( const FSpawnTabArgs& A ReviewPropertyTable->SetObjects((TArray&)DataManager->GetReviewArray()); // Add the columns we want to display - ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindField( UTranslationUnit::StaticClass(), "Source")); - ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindField( UTranslationUnit::StaticClass(), "Translation")); - ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindField( UTranslationUnit::StaticClass(), "HasBeenReviewed")); + ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty( UTranslationUnit::StaticClass(), "Source")); + ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty( UTranslationUnit::StaticClass(), "Translation")); + ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty( UTranslationUnit::StaticClass(), "HasBeenReviewed")); TArray> Columns = ReviewPropertyTable->GetColumns(); for (TSharedRef Column : Columns) @@ -372,8 +372,8 @@ TSharedRef FTranslationEditor::SpawnTab_Completed( const FSpawnTabArgs { check( Args.GetTabId().TabType == CompletedTabId ); - FProperty* SourceProperty = FindField( UTranslationUnit::StaticClass(), "Source"); - FProperty* TranslationProperty = FindField( UTranslationUnit::StaticClass(), "Translation"); + FProperty* SourceProperty = FindFProperty( UTranslationUnit::StaticClass(), "Source"); + FProperty* TranslationProperty = FindFProperty( UTranslationUnit::StaticClass(), "Translation"); FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked( "PropertyEditor" ); @@ -395,8 +395,8 @@ TSharedRef FTranslationEditor::SpawnTab_Completed( const FSpawnTabArgs CompletedPropertyTable->SetObjects((TArray&)DataManager->GetCompleteArray()); // Add the columns we want to display - CompletedPropertyTable->AddColumn((TWeakFieldPtr)FindField( UTranslationUnit::StaticClass(), "Source")); - CompletedPropertyTable->AddColumn((TWeakFieldPtr)FindField( UTranslationUnit::StaticClass(), "Translation")); + CompletedPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty( UTranslationUnit::StaticClass(), "Source")); + CompletedPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty( UTranslationUnit::StaticClass(), "Translation")); // Freeze columns, don't want user to remove them TArray> Columns = CompletedPropertyTable->GetColumns(); @@ -430,8 +430,8 @@ TSharedRef FTranslationEditor::SpawnTab_Search(const FSpawnTabArgs& Ar { check(Args.GetTabId().TabType == SearchTabId); - FProperty* SourceProperty = FindField(UTranslationUnit::StaticClass(), "Source"); - FProperty* TranslationProperty = FindField(UTranslationUnit::StaticClass(), "Translation"); + FProperty* SourceProperty = FindFProperty(UTranslationUnit::StaticClass(), "Source"); + FProperty* TranslationProperty = FindFProperty(UTranslationUnit::StaticClass(), "Translation"); FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked("PropertyEditor"); @@ -453,8 +453,8 @@ TSharedRef FTranslationEditor::SpawnTab_Search(const FSpawnTabArgs& Ar SearchPropertyTable->SetObjects((TArray&)DataManager->GetSearchResultsArray()); // Add the columns we want to display - SearchPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Source")); - SearchPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Translation")); + SearchPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Source")); + SearchPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Translation")); // Freeze columns, don't want user to remove them TArray> Columns = SearchPropertyTable->GetColumns(); @@ -508,9 +508,9 @@ TSharedRef FTranslationEditor::SpawnTab_ChangedOnImport(const FSpawnTa { check(Args.GetTabId().TabType == ChangedOnImportTabId); - FProperty* SourceProperty = FindField(UTranslationUnit::StaticClass(), "Source"); - FProperty* TranslationBeforeImportProperty = FindField(UTranslationUnit::StaticClass(), "TranslationBeforeImport"); - FProperty* TranslationProperty = FindField(UTranslationUnit::StaticClass(), "Translation"); + FProperty* SourceProperty = FindFProperty(UTranslationUnit::StaticClass(), "Source"); + FProperty* TranslationBeforeImportProperty = FindFProperty(UTranslationUnit::StaticClass(), "TranslationBeforeImport"); + FProperty* TranslationProperty = FindFProperty(UTranslationUnit::StaticClass(), "Translation"); FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked("PropertyEditor"); @@ -532,9 +532,9 @@ TSharedRef FTranslationEditor::SpawnTab_ChangedOnImport(const FSpawnTa ChangedOnImportPropertyTable->SetObjects((TArray&)DataManager->GetSearchResultsArray()); // Add the columns we want to display - ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Source")); - ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "TranslationBeforeImport")); - ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Translation")); + ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Source")); + ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "TranslationBeforeImport")); + ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Translation")); // Freeze columns, don't want user to remove them TArray> Columns = ChangedOnImportPropertyTable->GetColumns(); @@ -612,7 +612,7 @@ TSharedRef FTranslationEditor::SpawnTab_Context( const FSpawnTabArgs& } // Build the Path to the data we want to show - FProperty* ContextProp = FindField( UTranslationUnit::StaticClass(), "Contexts" ); + FProperty* ContextProp = FindFProperty( UTranslationUnit::StaticClass(), "Contexts" ); FPropertyInfo ContextPropInfo; ContextPropInfo.Property = ContextProp; ContextPropInfo.ArrayIndex = INDEX_NONE; @@ -621,8 +621,8 @@ TSharedRef FTranslationEditor::SpawnTab_Context( const FSpawnTabArgs& ContextPropertyTable->SetRootPath(Path); // Add the columns we want to display - ContextPropertyTable->AddColumn((TWeakFieldPtr)FindField( FTranslationContextInfo::StaticStruct(), "Key")); - ContextPropertyTable->AddColumn((TWeakFieldPtr)FindField( FTranslationContextInfo::StaticStruct(), "Context")); + ContextPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty( FTranslationContextInfo::StaticStruct(), "Key")); + ContextPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty( FTranslationContextInfo::StaticStruct(), "Context")); // Freeze columns, don't want user to remove them TArray> Columns = ContextPropertyTable->GetColumns(); @@ -674,8 +674,8 @@ TSharedRef FTranslationEditor::SpawnTab_History(const FSpawnTabArgs& A FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked("PropertyEditor"); - FProperty* SourceProperty = FindField(FTranslationChange::StaticStruct(), "Source"); - FProperty* TranslationProperty = FindField(FTranslationChange::StaticStruct(), "Translation"); + FProperty* SourceProperty = FindFProperty(FTranslationChange::StaticStruct(), "Source"); + FProperty* TranslationProperty = FindFProperty(FTranslationChange::StaticStruct(), "Translation"); // create empty property table HistoryPropertyTable = PropertyEditorModule.CreatePropertyTable(); @@ -700,14 +700,14 @@ TSharedRef FTranslationEditor::SpawnTab_History(const FSpawnTabArgs& A // Build the Path to the data we want to show TSharedRef Path = FPropertyPath::CreateEmpty(); - FArrayProperty* ContextsProp = FindField(UTranslationUnit::StaticClass(), "Contexts"); + FArrayProperty* ContextsProp = FindFProperty(UTranslationUnit::StaticClass(), "Contexts"); Path = Path->ExtendPath(FPropertyPath::Create(ContextsProp)); FPropertyInfo ContextsPropInfo; ContextsPropInfo.Property = ContextsProp->Inner; ContextsPropInfo.ArrayIndex = 0; Path = Path->ExtendPath(ContextsPropInfo); - FProperty* ChangesProp = FindField(FTranslationContextInfo::StaticStruct(), "Changes"); + FProperty* ChangesProp = FindFProperty(FTranslationContextInfo::StaticStruct(), "Changes"); FPropertyInfo ChangesPropInfo; ChangesPropInfo.Property = ChangesProp; ChangesPropInfo.ArrayIndex = INDEX_NONE; @@ -715,8 +715,8 @@ TSharedRef FTranslationEditor::SpawnTab_History(const FSpawnTabArgs& A HistoryPropertyTable->SetRootPath(Path); // Add the columns we want to display - HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationChange::StaticStruct(), "Version")); - HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationChange::StaticStruct(), "DateAndTime")); + HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationChange::StaticStruct(), "Version")); + HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationChange::StaticStruct(), "DateAndTime")); HistoryPropertyTable->AddColumn((TWeakFieldPtr)SourceProperty); HistoryPropertyTable->AddColumn((TWeakFieldPtr)TranslationProperty); @@ -994,7 +994,7 @@ void FTranslationEditor::UpdateTranslationUnitSelection(TSetSetText(FText::Format(LOCTEXT("TranslationNamespace", "Namespace: {0}"), FText::FromString(SelectedTranslationUnit->Namespace))); // Add the ContextPropertyTable-specific path - FArrayProperty* ContextArrayProp = FindField(UTranslationUnit::StaticClass(), "Contexts"); + FArrayProperty* ContextArrayProp = FindFProperty(UTranslationUnit::StaticClass(), "Contexts"); FPropertyInfo ContextArrayPropInfo; ContextArrayPropInfo.Property = ContextArrayProp; ContextArrayPropInfo.ArrayIndex = INDEX_NONE; @@ -1010,8 +1010,8 @@ void FTranslationEditor::UpdateTranslationUnitSelection(TSetSetRootPath(ContextPath); // Need to re-add the columns we want to display - ContextPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationContextInfo::StaticStruct(), "Key")); - ContextPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationContextInfo::StaticStruct(), "Context")); + ContextPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationContextInfo::StaticStruct(), "Key")); + ContextPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationContextInfo::StaticStruct(), "Context")); TArray> Columns = ContextPropertyTable->GetColumns(); for (TSharedRef Column : Columns) @@ -1085,12 +1085,12 @@ void FTranslationEditor::UpdateContextSelection() // Add the HistoryPropertyTable-specific path TSharedRef HistoryPath = ContextPropertyTable->GetRootPath(); - FArrayProperty* ContextArrayProp = FindField(UTranslationUnit::StaticClass(), "Contexts"); + FArrayProperty* ContextArrayProp = FindFProperty(UTranslationUnit::StaticClass(), "Contexts"); FPropertyInfo ContextPropInfo; ContextPropInfo.Property = ContextArrayProp->Inner; ContextPropInfo.ArrayIndex = PartialPath->GetLeafMostProperty().ArrayIndex; HistoryPath = HistoryPath->ExtendPath(ContextPropInfo); - FArrayProperty* ChangesProp = FindField(FTranslationContextInfo::StaticStruct(), "Changes"); + FArrayProperty* ChangesProp = FindFProperty(FTranslationContextInfo::StaticStruct(), "Changes"); FPropertyInfo ChangesPropInfo; ChangesPropInfo.Property = ChangesProp; ChangesPropInfo.ArrayIndex = INDEX_NONE; @@ -1103,10 +1103,10 @@ void FTranslationEditor::UpdateContextSelection() HistoryPropertyTable->SetRootPath(HistoryPath); // Need to re-add the columns we want to display - HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationChange::StaticStruct(), "Version")); - HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationChange::StaticStruct(), "DateAndTime")); - HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationChange::StaticStruct(), "Source")); - HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindField(FTranslationChange::StaticStruct(), "Translation")); + HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationChange::StaticStruct(), "Version")); + HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationChange::StaticStruct(), "DateAndTime")); + HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationChange::StaticStruct(), "Source")); + HistoryPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(FTranslationChange::StaticStruct(), "Translation")); TArray> Columns = HistoryPropertyTable->GetColumns(); for (TSharedRef Column : Columns) @@ -1342,9 +1342,9 @@ void FTranslationEditor::ImportFromPoFile(FString FileToImport) TabManager->TryInvokeTab(ChangedOnImportTabId); ChangedOnImportPropertyTable->SetObjects((TArray&)DataManager->GetChangedOnImportArray()); // Need to re-add the columns we want to display - ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Source")); - ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "TranslationBeforeImport")); - ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Translation")); + ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Source")); + ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "TranslationBeforeImport")); + ChangedOnImportPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Translation")); } } else @@ -1382,8 +1382,8 @@ void FTranslationEditor::OnFilterTextCommitted(const FText& InFilterText, ETextC SearchPropertyTable->SetObjects((TArray&)DataManager->GetSearchResultsArray()); // Need to re-add the columns we want to display - SearchPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Source")); - SearchPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Translation")); + SearchPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Source")); + SearchPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Translation")); TArray> Columns = SearchPropertyTable->GetColumns(); for (TSharedRef Column : Columns) @@ -1411,8 +1411,8 @@ FReply FTranslationEditor::OnGetHistoryButtonClicked() UntranslatedPropertyTable->SetObjects((TArray&)DataManager->GetUntranslatedArray()); // Need to re-add the columns we want to display - UntranslatedPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Source")); - UntranslatedPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Translation")); + UntranslatedPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Source")); + UntranslatedPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Translation")); TArray> Columns = UntranslatedPropertyTable->GetColumns(); for (TSharedRef Column : Columns) @@ -1426,9 +1426,9 @@ FReply FTranslationEditor::OnGetHistoryButtonClicked() ReviewPropertyTable->SetObjects((TArray&)DataManager->GetReviewArray()); // Need to re-add the columns we want to display - ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Source")); - ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "Translation")); - ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindField(UTranslationUnit::StaticClass(), "HasBeenReviewed")); + ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Source")); + ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "Translation")); + ReviewPropertyTable->AddColumn((TWeakFieldPtr)FindFProperty(UTranslationUnit::StaticClass(), "HasBeenReviewed")); TArray> Columns = ReviewPropertyTable->GetColumns(); for (TSharedRef Column : Columns) diff --git a/Engine/Source/Editor/UMGEditor/Private/Customizations/UMGDetailCustomizations.cpp b/Engine/Source/Editor/UMGEditor/Private/Customizations/UMGDetailCustomizations.cpp index 195e0a4678eb..7af57a0951c1 100644 --- a/Engine/Source/Editor/UMGEditor/Private/Customizations/UMGDetailCustomizations.cpp +++ b/Engine/Source/Editor/UMGEditor/Private/Customizations/UMGDetailCustomizations.cpp @@ -167,7 +167,7 @@ FReply FBlueprintWidgetCustomization::HandleAddOrViewEventForVariable(const FNam UBlueprint* BlueprintObj = Blueprint; // Find the corresponding variable property in the Blueprint - FObjectProperty* VariableProperty = FindField(BlueprintObj->SkeletonGeneratedClass, PropertyName); + FObjectProperty* VariableProperty = FindFProperty(BlueprintObj->SkeletonGeneratedClass, PropertyName); if (VariableProperty) { @@ -218,7 +218,7 @@ void FBlueprintWidgetCustomization::CreateMulticastEventCustomization(IDetailLay PropertyTooltip = FText::FromString(DelegateProperty->GetName()); } - FObjectProperty* ComponentProperty = FindField(Blueprint->SkeletonGeneratedClass, ThisComponentName); + FObjectProperty* ComponentProperty = FindFProperty(Blueprint->SkeletonGeneratedClass, ThisComponentName); if ( !ComponentProperty ) { diff --git a/Engine/Source/Editor/UMGEditor/Private/Details/DetailWidgetExtensionHandler.cpp b/Engine/Source/Editor/UMGEditor/Private/Details/DetailWidgetExtensionHandler.cpp index a32755a38acf..97ce696e0e95 100644 --- a/Engine/Source/Editor/UMGEditor/Private/Details/DetailWidgetExtensionHandler.cpp +++ b/Engine/Source/Editor/UMGEditor/Private/Details/DetailWidgetExtensionHandler.cpp @@ -31,7 +31,7 @@ bool FDetailWidgetExtensionHandler::IsPropertyExtendable(const UClass* InObjectC if ( UClass* ContainerClass = Property->GetOwner() ) { - FDelegateProperty* DelegateProperty = FindField(ContainerClass, FName(*DelegateName)); + FDelegateProperty* DelegateProperty = FindFProperty(ContainerClass, FName(*DelegateName)); if ( DelegateProperty ) { return true; diff --git a/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprint.cpp b/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprint.cpp index 60dc55cf683d..bed0e72dd221 100644 --- a/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprint.cpp +++ b/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprint.cpp @@ -203,11 +203,7 @@ FFieldVariant FEditorPropertyPathSegment::GetMember() const FName FieldName = GetMemberName(); if ( FieldName != NAME_None ) { - FFieldVariant Field = FindField(Struct, FieldName); - if (!Field.IsValid()) - { - Field = FindField(Struct, FieldName); - } + FFieldVariant Field = FindUFieldOrFProperty(Struct, FieldName); //if ( Field == nullptr ) //{ // if ( UClass* Class = Cast(Struct) ) @@ -216,7 +212,7 @@ FFieldVariant FEditorPropertyPathSegment::GetMember() const // { // if ( UClass* SkeletonClass = Blueprint->SkeletonGeneratedClass ) // { - // Field = FindField(SkeletonClass, FieldName); + // Field = FindUField(SkeletonClass, FieldName); // } // } // } @@ -414,7 +410,7 @@ bool FDelegateEditorBinding::IsAttributePropertyBinding(UWidgetBlueprint* Bluepr { // Next find the underlying delegate we're actually binding to, if it's an event the name will be the same, // for properties we need to lookup the delegate property we're actually going to be binding to. - FDelegateProperty* BindableProperty = FindField(TargetWidget->GetClass(), FName(*(PropertyName.ToString() + TEXT("Delegate")))); + FDelegateProperty* BindableProperty = FindFProperty(TargetWidget->GetClass(), FName(*(PropertyName.ToString() + TEXT("Delegate")))); return BindableProperty != nullptr; } @@ -441,8 +437,8 @@ bool FDelegateEditorBinding::IsBindingValid(UClass* BlueprintGeneratedClass, UWi { // Next find the underlying delegate we're actually binding to, if it's an event the name will be the same, // for properties we need to lookup the delegate property we're actually going to be binding to. - FDelegateProperty* BindableProperty = FindField(TargetWidget->GetClass(), FName(*( PropertyName.ToString() + TEXT("Delegate") ))); - FDelegateProperty* EventProperty = FindField(TargetWidget->GetClass(), PropertyName); + FDelegateProperty* BindableProperty = FindFProperty(TargetWidget->GetClass(), FName(*( PropertyName.ToString() + TEXT("Delegate") ))); + FDelegateProperty* EventProperty = FindFProperty(TargetWidget->GetClass(), PropertyName); bool bNeedsToBePure = BindableProperty ? true : false; FDelegateProperty* DelegateProperty = BindableProperty ? BindableProperty : EventProperty; diff --git a/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintCompiler.cpp b/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintCompiler.cpp index 2e71c6a040e1..0365bca17c4d 100644 --- a/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintCompiler.cpp +++ b/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintCompiler.cpp @@ -120,7 +120,7 @@ void FWidgetBlueprintCompilerContext::CreateFunctionList() { const FName PropertyName = EditorBinding.SourceProperty; - FProperty* Property = FindField(Blueprint->SkeletonGeneratedClass, PropertyName); + FProperty* Property = FindFProperty(Blueprint->SkeletonGeneratedClass, PropertyName); if ( Property ) { // Create the function graph. diff --git a/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintEditorUtils.cpp b/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintEditorUtils.cpp index cc3eb4d633e4..7402c78bc15b 100644 --- a/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintEditorUtils.cpp +++ b/Engine/Source/Editor/UMGEditor/Private/WidgetBlueprintEditorUtils.cpp @@ -1515,7 +1515,7 @@ void FWidgetBlueprintEditorUtils::ImportPropertiesFromText(UObject* Object, cons { for ( const auto& Entry : ExportedProperties ) { - if ( FProperty* Property = FindField(Object->GetClass(), Entry.Key) ) + if ( FProperty* Property = FindFProperty(Object->GetClass(), Entry.Key) ) { FEditPropertyChain PropertyChain; PropertyChain.AddHead(Property); diff --git a/Engine/Source/Editor/UnrealEd/Private/AssetSelection.cpp b/Engine/Source/Editor/UnrealEd/Private/AssetSelection.cpp index 61c91fc0d9ef..b994bf5b1228 100644 --- a/Engine/Source/Editor/UnrealEd/Private/AssetSelection.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/AssetSelection.cpp @@ -912,7 +912,7 @@ bool FActorFactoryAssetProxy::ApplyMaterialToActor( AActor* TargetActor, UMateri ALandscapeProxy* Landscape = Cast(TargetActor); if (Landscape != NULL) { - FProperty* MaterialProperty = FindField(ALandscapeProxy::StaticClass(), "LandscapeMaterial"); + FProperty* MaterialProperty = FindFProperty(ALandscapeProxy::StaticClass(), "LandscapeMaterial"); Landscape->PreEditChange(MaterialProperty); Landscape->LandscapeMaterial = MaterialToApply; FPropertyChangedEvent PropertyChangedEvent(MaterialProperty); diff --git a/Engine/Source/Editor/UnrealEd/Private/ComponentVisualizer.cpp b/Engine/Source/Editor/UnrealEd/Private/ComponentVisualizer.cpp index 33e3dc7c19b2..0cb91bda9a7d 100644 --- a/Engine/Source/Editor/UnrealEd/Private/ComponentVisualizer.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/ComponentVisualizer.cpp @@ -121,7 +121,7 @@ UActorComponent* FComponentPropertyPath::GetComponent() const UClass* ActorClass = Actor->GetClass(); check(ActorClass); - FProperty* Prop = FindField(ActorClass, PropertyName); + FProperty* Prop = FindFProperty(ActorClass, PropertyName); if (FObjectProperty* ObjectProp = CastField(Prop)) { @@ -207,7 +207,7 @@ UActorComponent* FComponentVisualizer::GetComponentFromPropertyName(const AActor if(CompOwner && Property.IsValid()) { UClass* ActorClass = CompOwner->GetClass(); - FProperty* Prop = FindField(ActorClass, Property.Name); + FProperty* Prop = FindFProperty(ActorClass, Property.Name); if (FObjectProperty* ObjectProp = CastField(Prop)) { UObject* Object = ObjectProp->GetObjectPropertyValue(ObjectProp->ContainerPtrToValuePtr(CompOwner, Property.Index)); diff --git a/Engine/Source/Editor/UnrealEd/Private/EdMode.cpp b/Engine/Source/Editor/UnrealEd/Private/EdMode.cpp index fbc69c9c95f6..4bcf0587ecc6 100644 --- a/Engine/Source/Editor/UnrealEd/Private/EdMode.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/EdMode.cpp @@ -73,7 +73,7 @@ namespace } // Obtain the property info from the given structure definition - FProperty* CurrentProp = FindField(InStruct, FName(*NameToken)); + FProperty* CurrentProp = FindFProperty(InStruct, FName(*NameToken)); // Check first to see if this is a simple structure (i.e. not an array of structures) FStructProperty* StructProp = CastField(CurrentProp); @@ -104,7 +104,7 @@ namespace } else { - FProperty* Prop = FindField(InStruct, FName(*PropertyName)); + FProperty* Prop = FindFProperty(InStruct, FName(*PropertyName)); if(Prop != NULL) { if( FArrayProperty* ArrayProp = CastField(Prop) ) diff --git a/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp b/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp index e4211d4932bb..b8e12ab7ba89 100644 --- a/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp @@ -219,6 +219,7 @@ #include "Subsystems/AssetEditorSubsystem.h" #include "StudioAnalytics.h" #include "Engine/LevelScriptActor.h" +#include "UObject/UnrealType.h" #if WITH_CHAOS #include "ChaosSolversModule.h" @@ -3465,7 +3466,7 @@ struct FConvertStaticMeshActorInfo bool PropsDiffer(const TCHAR* PropertyPath, UObject* Obj) { - const FProperty* PartsProp = FindField( PropertyPath ); + const FProperty* PartsProp = FindFProperty( PropertyPath ); check(PartsProp); uint8* ClassDefaults = (uint8*)Obj->GetClass()->GetDefaultObject(); diff --git a/Engine/Source/Editor/UnrealEd/Private/Kismet2/BlueprintEditorUtils.cpp b/Engine/Source/Editor/UnrealEd/Private/Kismet2/BlueprintEditorUtils.cpp index 8c2d48d82b4f..869399df3b30 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Kismet2/BlueprintEditorUtils.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Kismet2/BlueprintEditorUtils.cpp @@ -2194,7 +2194,8 @@ bool FBlueprintEditorUtils::IsGraphNameUnique(UBlueprint* Blueprint, const FName if( !FindObject(Blueprint, *InName.ToString()) ) { // Next, check for functions with that name in the blueprint's class scope - if( !FindField(Blueprint->SkeletonGeneratedClass, InName) ) + FFieldVariant ExistingField = FindUFieldOrFProperty(Blueprint->SkeletonGeneratedClass, InName); + if( !ExistingField ) { // Finally, check function entry points TArray AllEvents; @@ -2334,7 +2335,7 @@ UClass* const FBlueprintEditorUtils::GetOverrideFunctionClass(UBlueprint* Bluepr if (OverrideFunc == nullptr) { - OverrideFunc = FindField(Blueprint->SkeletonGeneratedClass, FuncName); + OverrideFunc = FindUField(Blueprint->SkeletonGeneratedClass, FuncName); // search up the class hierarchy, we want to find the original declaration of the function to match FBlueprintEventNodeSpawner. // Doing so ensures that we can find the existing node if there is one: const UClass* Iter = Blueprint->SkeletonGeneratedClass->GetSuperClass(); @@ -3770,12 +3771,12 @@ void FBlueprintEditorUtils::SetBlueprintVariableMetaData(UBlueprint* Blueprint, else { Blueprint->NewVariables[VarIndex].SetMetaData(MetaDataKey, MetaDataValue); - FProperty* Property = FindField(Blueprint->SkeletonGeneratedClass, VarName); + FProperty* Property = FindFProperty(Blueprint->SkeletonGeneratedClass, VarName); if (Property) { Property->SetMetaData(MetaDataKey, *MetaDataValue); } - Property = FindField(Blueprint->GeneratedClass, VarName); + Property = FindFProperty(Blueprint->GeneratedClass, VarName); if (Property) { Property->SetMetaData(MetaDataKey, *MetaDataValue); @@ -3894,12 +3895,12 @@ void FBlueprintEditorUtils::RemoveBlueprintVariableMetaData(UBlueprint* Blueprin else { Blueprint->NewVariables[VarIndex].RemoveMetaData(MetaDataKey); - FProperty* Property = FindField(Blueprint->SkeletonGeneratedClass, VarName); + FProperty* Property = FindFProperty(Blueprint->SkeletonGeneratedClass, VarName); if (Property) { Property->RemoveMetaData(MetaDataKey); } - Property = FindField(Blueprint->GeneratedClass, VarName); + Property = FindFProperty(Blueprint->GeneratedClass, VarName); if (Property) { Property->RemoveMetaData(MetaDataKey); @@ -3936,7 +3937,7 @@ void FBlueprintEditorUtils::SetBlueprintVariableCategory(UBlueprint* Blueprint, Blueprint->Modify(); UClass* SkeletonGeneratedClass = Blueprint->SkeletonGeneratedClass; - if (FProperty* TargetProperty = FindField(SkeletonGeneratedClass, VarName)) + if (FProperty* TargetProperty = FindFProperty(SkeletonGeneratedClass, VarName)) { UClass* OuterClass = TargetProperty->GetOwnerChecked(); const bool bIsNativeVar = (OuterClass->ClassGeneratedBy == nullptr); @@ -4152,7 +4153,7 @@ FText FBlueprintEditorUtils::GetBlueprintVariableCategory(UBlueprint* Blueprint, { FText CategoryName; UClass* SkeletonGeneratedClass = Blueprint->SkeletonGeneratedClass; - FProperty* TargetProperty = FindField(SkeletonGeneratedClass, VarName); + FProperty* TargetProperty = FindFProperty(SkeletonGeneratedClass, VarName); if(TargetProperty != nullptr) { CategoryName = FObjectEditorUtils::GetCategoryText(TargetProperty); @@ -4693,7 +4694,7 @@ void FBlueprintEditorUtils::RenameMemberVariable(UBlueprint* Blueprint, const FN UObject* GeneratedCDO = GeneratedClass ? GeneratedClass->GetDefaultObject(false) : nullptr; if (GeneratedCDO) { - FProperty* TargetProperty = FindField(GeneratedCDO->GetClass(), OldName); // GeneratedCDO->GetClass() is used instead of GeneratedClass, because CDO could use REINST class. + FProperty* TargetProperty = FindFProperty(GeneratedCDO->GetClass(), OldName); // GeneratedCDO->GetClass() is used instead of GeneratedClass, because CDO could use REINST class. // Grab the address of where the property is actually stored (UObject* base, plus the offset defined in the property) void* OldPropertyAddr = TargetProperty ? TargetProperty->ContainerPtrToValuePtr(GeneratedCDO) : nullptr; if (OldPropertyAddr) @@ -5012,7 +5013,7 @@ FName FBlueprintEditorUtils::DuplicateVariable(UBlueprint* InBlueprint, const US //Grab property of blueprint's current CDO UClass* GeneratedClass = InBlueprint->GeneratedClass; UObject* GeneratedCDO = GeneratedClass->GetDefaultObject(); - FProperty* TargetProperty = FindField(GeneratedClass, Variable.VarName); + FProperty* TargetProperty = FindFProperty(GeneratedClass, Variable.VarName); if( TargetProperty ) { @@ -5238,8 +5239,8 @@ void FBlueprintEditorUtils::RenameLocalVariable(UBlueprint* InBlueprint, const U { UK2Node_FunctionEntry* FunctionEntry = nullptr; FBPVariableDescription* LocalVariable = FindLocalVariable(InBlueprint, InScope, InOldName, &FunctionEntry); - const FProperty* OldProperty = FindField(InScope, InOldName); - const FProperty* ExistingProperty = FindField(InScope, InNewName); + const FProperty* OldProperty = FindFProperty(InScope, InOldName); + const FProperty* ExistingProperty = FindFProperty(InScope, InNewName); const bool bHasExistingProperty = ExistingProperty && ExistingProperty != OldProperty; if (bHasExistingProperty) { @@ -6028,7 +6029,7 @@ UFunction* FBlueprintEditorUtils::GetInterfaceFunction(UBlueprint* Blueprint, co { if (I.Interface) { - Function = FindField(I.Interface, FuncName); + Function = FindUField(I.Interface, FuncName); if (Function) { // found it, done @@ -6042,7 +6043,7 @@ UFunction* FBlueprintEditorUtils::GetInterfaceFunction(UBlueprint* Blueprint, co { for (const FImplementedInterface& I : TempClass->Interfaces) { - Function = FindField(I.Class, FuncName); + Function = FindUField(I.Class, FuncName); if (Function) { // found it, done @@ -6823,7 +6824,7 @@ static void ConformInterfaceByName(UBlueprint* Blueprint, FBPInterfaceDescriptio } // We perform the check here to avoid creating a graph if it isnt implemented in the full interface (note not the skeleton interface that we are iterating over) // this is to avoid creating it then removing the graph below if it isnt present in the full class, which will cause a name conflict second time around - else if(FindField(CurrentInterfaceDesc.Interface, FunctionName)) + else if(FindUField(CurrentInterfaceDesc.Interface, FunctionName)) { UEdGraph* NewGraph = FBlueprintEditorUtils::CreateNewGraph(Blueprint, FunctionName, UAnimationGraph::StaticClass(), UAnimationGraphSchema::StaticClass()); NewGraph->bAllowDeletion = false; @@ -6853,7 +6854,7 @@ static void ConformInterfaceByName(UBlueprint* Blueprint, FBPInterfaceDescriptio // If we can't find the function associated with the graph, delete it const UEdGraph* CurrentGraph = CurrentInterfaceDesc.Graphs[GraphIndex]; - if (!CurrentGraph || !FindField(CurrentInterfaceDesc.Interface, CurrentGraph->GetFName())) + if (!CurrentGraph || !FindUField(CurrentInterfaceDesc.Interface, CurrentGraph->GetFName())) { CurrentInterfaceDesc.Graphs.RemoveAt(GraphIndex, 1); GraphIndex--; @@ -8740,7 +8741,7 @@ bool FBlueprintEditorUtils::IsPaletteActionReadOnly(TSharedPtrGraphType == EEdGraphSchemaAction_K2Graph::Function) { // Check if the function is an override - UFunction* OverrideFunc = FindField(BlueprintObj->ParentClass, GraphAction->FuncName); + UFunction* OverrideFunc = FindUField(BlueprintObj->ParentClass, GraphAction->FuncName); if ( OverrideFunc != nullptr ) { bIsReadOnly = true; diff --git a/Engine/Source/Editor/UnrealEd/Private/Kismet2/ComponentEditorUtils.cpp b/Engine/Source/Editor/UnrealEd/Private/Kismet2/ComponentEditorUtils.cpp index 93f642c51e8a..a7a86f4ed8c1 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Kismet2/ComponentEditorUtils.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Kismet2/ComponentEditorUtils.cpp @@ -997,7 +997,7 @@ FName FComponentEditorUtils::FindVariableNameGivenComponentInstance(const UActor if (AActor* OwnerActor = ComponentInstance->GetOwner()) { UClass* OwnerActorClass = OwnerActor->GetClass(); - if (FObjectProperty* TestProperty = FindField(OwnerActorClass, ComponentInstance->GetFName())) + if (FObjectProperty* TestProperty = FindFProperty(OwnerActorClass, ComponentInstance->GetFName())) { if (ComponentInstance->GetClass()->IsChildOf(TestProperty->PropertyClass)) { diff --git a/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2.cpp b/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2.cpp index 28b154c725cd..cca54353b981 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2.cpp @@ -2029,7 +2029,7 @@ void FKismetEditorUtilities::CreateNewBoundEventForActor(AActor* Actor, FName Ev if ((Actor != nullptr) && (EventName != NAME_None)) { // First, find the property we want to bind to - if (FMulticastDelegateProperty* DelegateProperty = FindField(Actor->GetClass(), EventName)) + if (FMulticastDelegateProperty* DelegateProperty = FindFProperty(Actor->GetClass(), EventName)) { // Get the correct level script blueprint if (ULevelScriptBlueprint* LSB = Actor->GetLevel()->GetLevelScriptBlueprint()) @@ -2073,7 +2073,7 @@ void FKismetEditorUtilities::CreateNewBoundEventForClass(UClass* Class, FName Ev if ( ( Class != nullptr ) && ( EventName != NAME_None ) && ( Blueprint != nullptr ) && ( ComponentProperty != nullptr ) ) { // First, find the property we want to bind to - FMulticastDelegateProperty* DelegateProperty = FindField(Class, EventName); + FMulticastDelegateProperty* DelegateProperty = FindFProperty(Class, EventName); if ( DelegateProperty != nullptr ) { UEdGraph* TargetGraph = Blueprint->GetLastEditedUberGraph(); diff --git a/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2NameValidators.cpp b/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2NameValidators.cpp index 618cd3278306..c96eb1c4c08b 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2NameValidators.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Kismet2/Kismet2NameValidators.cpp @@ -183,7 +183,7 @@ EValidatorResult FKismetNameValidator::IsValid(const FName& Name, bool /* bOrigi } else { - if(FindField(Scope, *Name.ToString()) != NULL) + if(FindFProperty(Scope, *Name.ToString()) != NULL) { ValidatorResult = EValidatorResult::LocallyInUse; } diff --git a/Engine/Source/Editor/UnrealEd/Private/Kismet2/KismetReinstanceUtilities.cpp b/Engine/Source/Editor/UnrealEd/Private/Kismet2/KismetReinstanceUtilities.cpp index 9d9f32b6ba86..8ae55400e8f3 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Kismet2/KismetReinstanceUtilities.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Kismet2/KismetReinstanceUtilities.cpp @@ -394,7 +394,7 @@ void FBlueprintCompileReinstancer::GenerateFieldMappings(TMap& Prop : PropertyMap) { - FieldMapping.Add(Prop.Value, FindField(ClassToReinstance, *Prop.Key.ToString())); + FieldMapping.Add(Prop.Value, FindFProperty(ClassToReinstance, *Prop.Key.ToString())); } for (TPair& Func : FunctionMap) diff --git a/Engine/Source/Editor/UnrealEd/Private/Kismet2/StructureEditorUtils.cpp b/Engine/Source/Editor/UnrealEd/Private/Kismet2/StructureEditorUtils.cpp index 612529a2ae5f..b04990dc629b 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Kismet2/StructureEditorUtils.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Kismet2/StructureEditorUtils.cpp @@ -444,7 +444,7 @@ bool FStructureEditorUtils::ChangeVariableDefaultValue(UUserDefinedStruct* Struc bool bAdvancedValidation = true; if (!NewDefaultValue.IsEmpty()) { - const FProperty* Property = FindField(Struct, VarDesc->VarName); + const FProperty* Property = FindFProperty(Struct, VarDesc->VarName); FStructOnScope StructDefaultMem(Struct); bAdvancedValidation = StructDefaultMem.IsValid() && Property && FBlueprintEditorUtils::PropertyValueFromString(Property, NewDefaultValue, StructDefaultMem.GetStructMemory(), Struct); @@ -513,7 +513,7 @@ FProperty* FStructureEditorUtils::GetPropertyByFriendlyName(const UUserDefinedSt { if (VarDesc.FriendlyName == DisplayName) { - return FindField(Struct, VarDesc.VarName); + return FindFProperty(Struct, VarDesc.VarName); } } } @@ -709,7 +709,7 @@ bool FStructureEditorUtils::ChangeVariableTooltip(UUserDefinedStruct* Struct, FG ModifyStructData(Struct); VarDesc->ToolTip = InTooltip; - FProperty* Property = FindField(Struct, VarDesc->VarName); + FProperty* Property = FindFProperty(Struct, VarDesc->VarName); if (Property) { Property->SetMetaData(FBlueprintMetadata::MD_Tooltip, *VarDesc->ToolTip); @@ -792,7 +792,7 @@ bool FStructureEditorUtils::CanEnableMultiLineText(const UUserDefinedStruct* Str const FStructVariableDescription* VarDesc = GetVarDescByGuid(Struct, VarGuid); if (VarDesc) { - FProperty* Property = FindField(Struct, VarDesc->VarName); + FProperty* Property = FindFProperty(Struct, VarDesc->VarName); // If this is an array, we need to test its inner property as that's the real type if (FArrayProperty* ArrayProperty = CastField(Property)) @@ -819,7 +819,7 @@ bool FStructureEditorUtils::ChangeMultiLineTextEnabled(UUserDefinedStruct* Struc ModifyStructData(Struct); VarDesc->bEnableMultiLineText = bIsEnabled; - FProperty* Property = FindField(Struct, VarDesc->VarName); + FProperty* Property = FindFProperty(Struct, VarDesc->VarName); if (Property) { if (VarDesc->bEnableMultiLineText) @@ -869,7 +869,7 @@ bool FStructureEditorUtils::Change3dWidgetEnabled(UUserDefinedStruct* Struct, FG ModifyStructData(Struct); VarDesc->bEnable3dWidget = bIsEnabled; - FProperty* Property = FindField(Struct, VarDesc->VarName); + FProperty* Property = FindFProperty(Struct, VarDesc->VarName); if (Property) { if (VarDesc->bEnable3dWidget) @@ -903,7 +903,7 @@ FGuid FStructureEditorUtils::GetGuidForProperty(const FProperty* Property) FProperty* FStructureEditorUtils::GetPropertyByGuid(const UUserDefinedStruct* Struct, const FGuid VarGuid) { const FStructVariableDescription* VarDesc = GetVarDescByGuid(Struct, VarGuid); - return VarDesc ? FindField(Struct, VarDesc->VarName) : nullptr; + return VarDesc ? FindFProperty(Struct, VarDesc->VarName) : nullptr; } FGuid FStructureEditorUtils::GetGuidFromPropertyName(const FName Name) diff --git a/Engine/Source/Editor/UnrealEd/Private/LevelEditorViewport.cpp b/Engine/Source/Editor/UnrealEd/Private/LevelEditorViewport.cpp index 38850f79cb03..65da25b9b722 100644 --- a/Engine/Source/Editor/UnrealEd/Private/LevelEditorViewport.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/LevelEditorViewport.cpp @@ -236,19 +236,19 @@ namespace LevelEditorViewportClientHelper switch (WidgetMode) { case FWidget::WM_Translate: - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); break; case FWidget::WM_Rotate: - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName()); break; case FWidget::WM_Scale: - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName()); break; case FWidget::WM_TranslateRotateZ: - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); break; case FWidget::WM_2D: - ValueProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); + ValueProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); break; default: break; diff --git a/Engine/Source/Editor/UnrealEd/Private/MaterialGraphNode_Comment.cpp b/Engine/Source/Editor/UnrealEd/Private/MaterialGraphNode_Comment.cpp index 0ccc977e67e4..21bc7f07808c 100644 --- a/Engine/Source/Editor/UnrealEd/Private/MaterialGraphNode_Comment.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/MaterialGraphNode_Comment.cpp @@ -106,7 +106,7 @@ void UMaterialGraphNode_Comment::PostPlacedNewNode() void UMaterialGraphNode_Comment::OnRenameNode(const FString& NewName) { // send property changed events - FProperty* NodeCommentProperty = FindField(GetClass(), "NodeComment"); + FProperty* NodeCommentProperty = FindFProperty(GetClass(), "NodeComment"); if(NodeCommentProperty != NULL) { PreEditChange(NodeCommentProperty); diff --git a/Engine/Source/Editor/UnrealEd/Private/SSocketManager.cpp b/Engine/Source/Editor/UnrealEd/Private/SSocketManager.cpp index 2805f6b7074c..31a04aa94038 100644 --- a/Engine/Source/Editor/UnrealEd/Private/SSocketManager.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/SSocketManager.cpp @@ -140,7 +140,7 @@ private: { FScopedTransaction Transaction( LOCTEXT("SetSocketName", "Set Socket Name") ); - FProperty* ChangedProperty = FindField( UStaticMeshSocket::StaticClass(), "SocketName" ); + FProperty* ChangedProperty = FindFProperty( UStaticMeshSocket::StaticClass(), "SocketName" ); // Pre edit, calls modify on the object SelectedSocket->PreEditChange(ChangedProperty); diff --git a/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorCommon.cpp b/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorCommon.cpp index 5d892404a990..4f7e4b492b4c 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorCommon.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorCommon.cpp @@ -232,7 +232,7 @@ void FAutomationEditorCommonUtils::ApplyCustomFactorySetting(UObject* InObject, const FString PropertyName = PropertyChain[0]; PropertyChain.RemoveAt(0); - FProperty* TargetProperty = FindField(InObject->GetClass(), *PropertyName); + FProperty* TargetProperty = FindFProperty(InObject->GetClass(), *PropertyName); if (TargetProperty) { if (PropertyChain.Num() == 0) diff --git a/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorPromotionCommon.cpp b/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorPromotionCommon.cpp index 862d44a32140..3a4037c718c7 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorPromotionCommon.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Tests/AutomationEditorPromotionCommon.cpp @@ -193,7 +193,7 @@ void FEditorPromotionTestUtilities::SendCommandToCurrentEditor(const FInputChord */ FString FEditorPromotionTestUtilities::GetPropertyByName(UObject* TargetObject, const FString& InVariableName) { - FProperty* FoundProperty = FindField(TargetObject->GetClass(), *InVariableName); + FProperty* FoundProperty = FindFProperty(TargetObject->GetClass(), *InVariableName); if (FoundProperty) { FString ValueString; @@ -213,7 +213,7 @@ FString FEditorPromotionTestUtilities::GetPropertyByName(UObject* TargetObject, */ void FEditorPromotionTestUtilities::SetPropertyByName(UObject* TargetObject, const FString& InVariableName, const FString& NewValueString) { - FProperty* FoundProperty = FindField(TargetObject->GetClass(), *InVariableName); + FProperty* FoundProperty = FindFProperty(TargetObject->GetClass(), *InVariableName); if (FoundProperty) { const FScopedTransaction PropertyChanged(LOCTEXT("PropertyChanged", "Object Property Change")); diff --git a/Engine/Source/Editor/ViewportInteraction/ActorViewportTransformable.cpp b/Engine/Source/Editor/ViewportInteraction/ActorViewportTransformable.cpp index d97d328e2c98..621119c0762f 100644 --- a/Engine/Source/Editor/ViewportInteraction/ActorViewportTransformable.cpp +++ b/Engine/Source/Editor/ViewportInteraction/ActorViewportTransformable.cpp @@ -31,16 +31,16 @@ void FActorViewportTransformable::ApplyTransform( const FTransform& NewTransform ExistingTransform.GetScale3D() == NewTransform.GetScale3D(); GEditor->BroadcastBeginObjectMovement(*Actor); - FProperty* TransformProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); + FProperty* TransformProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeLocationPropertyName()); if (!bOnlyTranslationChanged) { if (ExistingTransform.GetRotation() != NewTransform.GetRotation()) { - TransformProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName()); + TransformProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeRotationPropertyName()); } else if (ExistingTransform.GetScale3D() != NewTransform.GetScale3D()) { - TransformProperty = FindField(USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName()); + TransformProperty = FindFProperty(USceneComponent::StaticClass(), USceneComponent::GetRelativeScale3DPropertyName()); } } diff --git a/Engine/Source/Editor/WorldBrowser/Private/StreamingLevels/StreamingLevelModel.cpp b/Engine/Source/Editor/WorldBrowser/Private/StreamingLevels/StreamingLevelModel.cpp index 993aceaffdb8..c629ebba2f26 100644 --- a/Engine/Source/Editor/WorldBrowser/Private/StreamingLevels/StreamingLevelModel.cpp +++ b/Engine/Source/Editor/WorldBrowser/Private/StreamingLevels/StreamingLevelModel.cpp @@ -96,7 +96,7 @@ void FStreamingLevelModel::SetLevelColor(FLinearColor InColor) { if (LevelStreaming.IsValid()) { - FProperty* DrawColorProperty = FindField(LevelStreaming->GetClass(), "LevelColor"); + FProperty* DrawColorProperty = FindFProperty(LevelStreaming->GetClass(), "LevelColor"); LevelStreaming->PreEditChange(DrawColorProperty); LevelStreaming.Get()->LevelColor = InColor; diff --git a/Engine/Source/Programs/UnrealHeaderTool/Private/HeaderParser.cpp b/Engine/Source/Programs/UnrealHeaderTool/Private/HeaderParser.cpp index 88b97e2ca6fd..3939a8878119 100644 --- a/Engine/Source/Programs/UnrealHeaderTool/Private/HeaderParser.cpp +++ b/Engine/Source/Programs/UnrealHeaderTool/Private/HeaderParser.cpp @@ -7616,7 +7616,7 @@ void FHeaderParser::CompileFunctionDeclaration(FClasses& AllClasses) } if (SuperStruct) { - if (UFunction* OverriddenFunction = ::FindField(SuperStruct, FuncInfo.Function.Identifier)) + if (UFunction* OverriddenFunction = ::FindUField(SuperStruct, FuncInfo.Function.Identifier)) { // Native function overrides should be done in CPP text, not in a UFUNCTION() declaration (you can't change flags, and it'd otherwise be a burden to keep them identical) UE_LOG_ERROR_UHT(TEXT("%s: Override of UFUNCTION in parent class (%s) cannot have a UFUNCTION() declaration above it; it will use the same parameters as the original declaration."), FuncInfo.Function.Identifier, *OverriddenFunction->GetOuter()->GetName()); diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/Class.cpp b/Engine/Source/Runtime/CoreUObject/Private/UObject/Class.cpp index 43f1705ea97c..1e131060aa7c 100644 --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/Class.cpp +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/Class.cpp @@ -1978,8 +1978,15 @@ void UStruct::SetSuperStruct(UStruct* NewSuperStruct) FString UStruct::PropertyNameToDisplayName(FName InName) const { - const UField* FoundField = FindField(this, InName); - return GetAuthoredNameForField(FoundField); + FFieldVariant FoundField = FindUFieldOrFProperty(this, InName); + if (FoundField.IsUObject()) + { + return GetAuthoredNameForField(FoundField.Get()); + } + else + { + return GetAuthoredNameForField(FoundField.Get()); + } } FString UStruct::GetAuthoredNameForField(const UField* Field) const diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/Field.cpp b/Engine/Source/Runtime/CoreUObject/Private/UObject/Field.cpp index 537965974cb7..ea6e9749aac2 100644 --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/Field.cpp +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/Field.cpp @@ -1124,7 +1124,7 @@ FString GetPathNameSafe(const FField* InField) } } -FField* FindFieldByPath(const TCHAR* InFieldPath) +FField* FindFPropertyByPath(const TCHAR* InFieldPath) { // Expected format: FullPackageName.OwnerName:Field FField* FoundField = nullptr; @@ -1155,7 +1155,7 @@ FField* FindFieldByPath(const TCHAR* InFieldPath) checkf(*TestChar != ':' && *TestChar != '.', TEXT("FindFieldByPath can't resolve nested properties: %s"), InFieldPath); } #endif - FoundField = FindField(Owner, InFieldPath); + FoundField = FindFProperty(Owner, InFieldPath); } } return FoundField; diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/FieldPath.cpp b/Engine/Source/Runtime/CoreUObject/Private/UObject/FieldPath.cpp index 98b735341c62..271eb583c4fc 100644 --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/FieldPath.cpp +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/FieldPath.cpp @@ -123,7 +123,7 @@ FField* FFieldPath::TryToResolvePath(UStruct* InCurrentStruct, int32* OutOwnerIn if (UStruct* Owner = Cast(LastOuter)) { check(PathIndex <= 1); - Result = FindField(Owner, Path[PathIndex]); + Result = FindFProperty(Owner, Path[PathIndex]); if (Result && PathIndex > 0) { // Nested property diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/Obj.cpp b/Engine/Source/Runtime/CoreUObject/Private/UObject/Obj.cpp index 466140eaf03b..57c32190a582 100644 --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/Obj.cpp +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/Obj.cpp @@ -3089,7 +3089,7 @@ static void PerformSetCommand( const TCHAR* Str, FOutputDevice& Ar, bool bNotify UClass* Class = FindObject(ANY_PACKAGE, ObjectName); if (Class != NULL) { - FProperty* Property = FindField(Class, PropertyName); + FProperty* Property = FindFProperty(Class, PropertyName); if (Property != NULL) { while (*Str == ' ') @@ -3108,7 +3108,7 @@ static void PerformSetCommand( const TCHAR* Str, FOutputDevice& Ar, bool bNotify UObject* Object = FindObject(ANY_PACKAGE, ObjectName); if (Object != NULL) { - FProperty* Property = FindField(Object->GetClass(), PropertyName); + FProperty* Property = FindFProperty(Object->GetClass(), PropertyName); if (Property != NULL) { while (*Str == ' ') @@ -3298,7 +3298,7 @@ bool StaticExec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) { if ( FParse::Token( Str, PropertyName, UE_ARRAY_COUNT(PropertyName), 1 ) - && (Property=FindField( Class, PropertyName))!=NULL ) + && (Property=FindFProperty( Class, PropertyName))!=NULL ) { FString Temp; if( Class->GetDefaultsCount() ) @@ -3459,7 +3459,7 @@ bool StaticExec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) { FParse::Token(Str,PropertyName,UE_ARRAY_COUNT(PropertyName),1); { - Property=FindField(Class,PropertyName); + Property=FindFProperty(Class,PropertyName); { int32 cnt = 0; UObject* LimitOuter = NULL; @@ -3600,7 +3600,7 @@ bool StaticExec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) if (FParse::Token(Str, ClassName, UE_ARRAY_COUNT(ClassName), true)) { - //if ( (Property=FindField(Class,PropertyName)) != NULL ) + //if ( (Property=FindFProperty(Class,PropertyName)) != NULL ) UClass* Class = FindObject(ANY_PACKAGE, ClassName); if (Class != NULL) @@ -3631,7 +3631,7 @@ bool StaticExec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) if (Class != NULL) { - UFunction* Function = FindField(Class, FunctionName); + UFunction* Function = FindUField(Class, FunctionName); if (Function != NULL) { diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/Property.cpp b/Engine/Source/Runtime/CoreUObject/Private/UObject/Property.cpp index 2ade3e87a129..7c09195a90f0 100644 --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/Property.cpp +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/Property.cpp @@ -1116,7 +1116,7 @@ const TCHAR* FProperty::ImportSingleProperty( const TCHAR* Str, void* DestData, } const FName PropertyName(Len, Start); - FProperty* Property = FindField(ObjectStruct, PropertyName); + FProperty* Property = FindFProperty(ObjectStruct, PropertyName); if (Property == nullptr) { @@ -1125,7 +1125,7 @@ const TCHAR* FProperty::ImportSingleProperty( const TCHAR* Str, void* DestData, if (NewPropertyName != NAME_None) { - Property = FindField(ObjectStruct, NewPropertyName); + Property = FindFProperty(ObjectStruct, NewPropertyName); } if (!Property) diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyHelper.h b/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyHelper.h index 4e86e66f8872..a3e8f483a6ae 100644 --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyHelper.h +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyHelper.h @@ -255,7 +255,7 @@ namespace DelegatePropertyTools } } } - UFunction *Func = FindField( Cls, FuncName ); + UFunction *Func = FindUField( Cls, FuncName ); // Check function params. if(Func != nullptr) { diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyNumeric.cpp b/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyNumeric.cpp index 2df476bef1a7..1a0ce57970ba 100644 --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyNumeric.cpp +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/PropertyNumeric.cpp @@ -24,7 +24,7 @@ int64 FNumericProperty::ReadEnumAsInt64(FStructuredArchive::FSlot Slot, UStruct* FName EnumName; Slot << EnumName; - UEnum* Enum = FindField(dynamic_cast(DefaultsStruct) ? static_cast(DefaultsStruct) : DefaultsStruct->GetTypedOuter(), Tag.EnumName); + UEnum* Enum = FindUField(dynamic_cast(DefaultsStruct) ? static_cast(DefaultsStruct) : DefaultsStruct->GetTypedOuter(), Tag.EnumName); if (!Enum) { Enum = FindObject(ANY_PACKAGE, *Tag.EnumName.ToString()); diff --git a/Engine/Source/Runtime/CoreUObject/Public/UObject/Field.h b/Engine/Source/Runtime/CoreUObject/Public/UObject/Field.h index 465145301480..5dc366d4413c 100644 --- a/Engine/Source/Runtime/CoreUObject/Public/UObject/Field.h +++ b/Engine/Source/Runtime/CoreUObject/Public/UObject/Field.h @@ -242,7 +242,7 @@ public: return !!Container.Object; } bool IsValidLowLevel() const; - operator bool() const + inline operator bool() const { return IsValid(); } @@ -917,13 +917,13 @@ COREUOBJECT_API FString GetPathNameSafe(const FField* InField); /** * Finds a field given a path to the field (Package.Class[:Subobject:...]:FieldName) */ -COREUOBJECT_API FField* FindFieldByPath(const TCHAR* InFieldPath); +COREUOBJECT_API FField* FindFPropertyByPath(const TCHAR* InFieldPath); /** * Templated version of FindFieldByPath */ template -inline FieldType* FindField(const TCHAR* InFieldPath) +inline FieldType* FindFProperty(const TCHAR* InFieldPath) { - FField* FoundField = FindFieldByPath(InFieldPath); + FField* FoundField = FindFPropertyByPath(InFieldPath); return CastField(FoundField); } diff --git a/Engine/Source/Runtime/CoreUObject/Public/UObject/UnrealType.h b/Engine/Source/Runtime/CoreUObject/Public/UObject/UnrealType.h index 9ed36fcb3d62..25ae15cb676a 100644 --- a/Engine/Source/Runtime/CoreUObject/Public/UObject/UnrealType.h +++ b/Engine/Source/Runtime/CoreUObject/Public/UObject/UnrealType.h @@ -5538,7 +5538,9 @@ struct TFieldRange // // Find a typed field in a struct. // -template T* FindField( const UStruct* Owner, FName FieldName ) +template +UE_DEPRECATED(4.25, "FindField will no longer return properties. Use FindProperty instead or FindUField if you want to find functions or enums.") + T* FindField( const UStruct* Owner, FName FieldName ) { // We know that a "none" field won't exist in this Struct if( FieldName.IsNone() ) @@ -5559,21 +5561,91 @@ template T* FindField( const UStruct* Owner, FName FieldName ) return nullptr; } -template T* FindField( const UStruct* Owner, const TCHAR* FieldName ) +template +UE_DEPRECATED(4.25, "FindField will no longer return properties. Use FindFProperty instead or FindUField if you want to find UFunctions or UEnums.") +T* FindField( const UStruct* Owner, const TCHAR* FieldName ) { // lookup the string name in the Name hash FName Name(FieldName, FNAME_Find); return FindField(Owner, Name); } +template +typename TEnableIf::IsDerived, T*>::Type FindUField(const UStruct* Owner, FName FieldName) +{ + static_assert(sizeof(T) > 0, "T must not be an incomplete type"); + + // We know that a "none" field won't exist in this Struct + if (FieldName.IsNone()) + { + return nullptr; + } + + // Search by comparing FNames (INTs), not strings + for (TFieldIteratorIt(Owner); It; ++It) + { + if (It->GetFName() == FieldName) + { + return *It; + } + } + + // If we didn't find it, return no field + return nullptr; +} + +template +typename TEnableIf::IsDerived, T*>::Type FindUField(const UStruct* Owner, const TCHAR* FieldName) +{ + static_assert(sizeof(T) > 0, "T must not be an incomplete type"); + + // lookup the string name in the Name hash + FName Name(FieldName, FNAME_Find); + return FindUField(Owner, Name); +} + +template +typename TEnableIf::IsDerived, T*>::Type FindFProperty(const UStruct* Owner, FName FieldName) +{ + static_assert(sizeof(T) > 0, "T must not be an incomplete type"); + + // We know that a "none" field won't exist in this Struct + if (FieldName.IsNone()) + { + return nullptr; + } + + // Search by comparing FNames (INTs), not strings + for (TFieldIteratorIt(Owner); It; ++It) + { + if (It->GetFName() == FieldName) + { + return *It; + } + } + + // If we didn't find it, return no field + return nullptr; +} + +template +typename TEnableIf::IsDerived, T*>::Type FindFProperty(const UStruct* Owner, const TCHAR* FieldName) +{ + static_assert(sizeof(T) > 0, "T must not be an incomplete type"); + + // lookup the string name in the Name hash + FName Name(FieldName, FNAME_Find); + return FindFProperty(Owner, Name); +} + /** Finds FProperties or UFunctions and UEnums */ inline FFieldVariant FindUFieldOrFProperty(const UStruct* Owner, FName FieldName) { // Look for properties first as they're most often the runtime thing higher level code wants to find - FFieldVariant Result = FindField(Owner, FieldName); - if (!Result.IsValid()) + FFieldVariant Result = FindFProperty(Owner, FieldName); + if (!Result) { - Result = FindField(Owner, FieldName); + Result = FindUField(Owner, FieldName); } return Result; } diff --git a/Engine/Source/Runtime/Engine/Classes/Engine/MemberReference.h b/Engine/Source/Runtime/Engine/Classes/Engine/MemberReference.h index 54616549c135..a98b149d6010 100644 --- a/Engine/Source/Runtime/Engine/Classes/Engine/MemberReference.h +++ b/Engine/Source/Runtime/Engine/Classes/Engine/MemberReference.h @@ -311,7 +311,7 @@ public: /** Get the scope of this member */ UStruct* GetMemberScope(UClass* InMemberParentClass) const { - return FindField(InMemberParentClass, *MemberScope); + return FindUField(InMemberParentClass, *MemberScope); } /** Get the name of the scope of this member */ @@ -369,10 +369,10 @@ public: // Check if the member reference is function scoped if(IsLocalScope()) { - UStruct* MemberScopeStruct = FindField(SelfScope, *MemberScope); + UStruct* MemberScopeStruct = FindUField(SelfScope, *MemberScope); // Find in target scope - ReturnField = FindField(MemberScopeStruct, MemberName); + ReturnField = FindUFieldOrFProperty(MemberScopeStruct, MemberName).Get(); #if WITH_EDITOR if(ReturnField == nullptr) @@ -381,7 +381,7 @@ public: const FName RenamedMemberName = RefreshLocalVariableName(SelfScope); if (RenamedMemberName != NAME_None) { - ReturnField = FindField(MemberScopeStruct, MemberName); + ReturnField = FindUFieldOrFProperty(MemberScopeStruct, MemberName).Get(); } } #endif @@ -429,11 +429,11 @@ public: UScriptStruct* SparseClassDataStruct = TargetScope->GetSparseClassDataStruct(); if (SparseClassDataStruct) { - ReturnField = FindField(SparseClassDataStruct, MemberName); + ReturnField = FindUFieldOrFProperty(SparseClassDataStruct, MemberName).Get(); } if (ReturnField == nullptr) { - ReturnField = FindField(TargetScope, MemberName); + ReturnField = FindUFieldOrFProperty(TargetScope, MemberName).Get(); } #if WITH_EDITOR @@ -451,7 +451,7 @@ public: if (RenamedMemberName != NAME_None) { MemberName = RenamedMemberName; - ReturnField = FindField(TargetScope, MemberName); + ReturnField = FindUFieldOrFProperty(TargetScope, MemberName).Get(); } } #endif @@ -466,7 +466,7 @@ public: // FindObject<>; however this was not reliable (hence the addition // of GetMemberParentPackage(), etc.) else if (MemberName.ToString().EndsWith(HEADER_GENERATED_DELEGATE_SIGNATURE_SUFFIX)) - { + { ReturnField = ResolveUFunction(); if (ReturnField != nullptr) { diff --git a/Engine/Source/Runtime/Engine/Classes/Materials/Material.h b/Engine/Source/Runtime/Engine/Classes/Materials/Material.h index 2b7def3788d8..1ddd0652e041 100644 --- a/Engine/Source/Runtime/Engine/Classes/Materials/Material.h +++ b/Engine/Source/Runtime/Engine/Classes/Materials/Material.h @@ -1839,7 +1839,7 @@ private: { if (Parameter && Parameter->SetParameterValue(InParameterName, Args...)) { - if (FProperty* ParamProperty = FindField(ParameterType::StaticClass(), "DefaultValue")) + if (FProperty* ParamProperty = FindFProperty(ParameterType::StaticClass(), "DefaultValue")) { FPropertyChangedEvent PropertyChangedEvent(ParamProperty); Parameter->PostEditChangeProperty(PropertyChangedEvent); diff --git a/Engine/Source/Runtime/Engine/Private/AI/Navigation/NavigationModifier.cpp b/Engine/Source/Runtime/Engine/Private/AI/Navigation/NavigationModifier.cpp index 6764deae8bc2..3beaf9702642 100644 --- a/Engine/Source/Runtime/Engine/Private/AI/Navigation/NavigationModifier.cpp +++ b/Engine/Source/Runtime/Engine/Private/AI/Navigation/NavigationModifier.cpp @@ -110,7 +110,7 @@ void FNavigationLinkBase::DescribeCustomFlags(const TArray& EditableFla FString PropName(TEXT("bCustomFlag")); PropName += TTypeToString::ToString(Idx); - FProperty* FlagProp = FindField(StructIt, *PropName); + FProperty* FlagProp = FindFProperty(StructIt, *PropName); if (FlagProp) { if (Idx < MaxFlags) diff --git a/Engine/Source/Runtime/Engine/Private/ActorEditor.cpp b/Engine/Source/Runtime/Engine/Private/ActorEditor.cpp index 33a7760de001..5fcdd13bced9 100644 --- a/Engine/Source/Runtime/Engine/Private/ActorEditor.cpp +++ b/Engine/Source/Runtime/Engine/Private/ActorEditor.cpp @@ -876,7 +876,7 @@ void AActor::SetActorLabelInternal(const FString& NewActorLabelDirty, bool bMake } } - FPropertyChangedEvent PropertyEvent( FindField( AActor::StaticClass(), "ActorLabel" ) ); + FPropertyChangedEvent PropertyEvent( FindFProperty( AActor::StaticClass(), "ActorLabel" ) ); PostEditChangeProperty(PropertyEvent); FCoreDelegates::OnActorLabelChanged.Broadcast(this); diff --git a/Engine/Source/Runtime/Engine/Private/Animation/AnimNode_CustomProperty.cpp b/Engine/Source/Runtime/Engine/Private/Animation/AnimNode_CustomProperty.cpp index 128a0eaeb300..de52a28ac309 100644 --- a/Engine/Source/Runtime/Engine/Private/Animation/AnimNode_CustomProperty.cpp +++ b/Engine/Source/Runtime/Engine/Private/Animation/AnimNode_CustomProperty.cpp @@ -76,8 +76,8 @@ void FAnimNode_CustomProperty::InitializeProperties(const UObject* InSourceInsta const FName& SourceName = SourcePropertyNames[Idx]; const FName& DestName = DestPropertyNames[Idx]; - FProperty* SourceProperty = FindField(SourceClass, SourceName); - FProperty* DestProperty = FindField(InTargetClass, DestName); + FProperty* SourceProperty = FindFProperty(SourceClass, SourceName); + FProperty* DestProperty = FindFProperty(InTargetClass, DestName); if (SourceProperty && DestProperty #if WITH_EDITOR diff --git a/Engine/Source/Runtime/Engine/Private/Animation/AnimSequenceBase.cpp b/Engine/Source/Runtime/Engine/Private/Animation/AnimSequenceBase.cpp index 34c07da8ef87..173b59bad6e5 100644 --- a/Engine/Source/Runtime/Engine/Private/Animation/AnimSequenceBase.cpp +++ b/Engine/Source/Runtime/Engine/Private/Animation/AnimSequenceBase.cpp @@ -641,7 +641,7 @@ uint8* UAnimSequenceBase::FindNotifyPropertyData(int32 NotifyIndex, FArrayProper uint8* UAnimSequenceBase::FindArrayProperty(const TCHAR* PropName, FArrayProperty*& ArrayProperty, int32 ArrayIndex) { // find Notifies property start point - FProperty* Property = FindField(GetClass(), PropName); + FProperty* Property = FindFProperty(GetClass(), PropName); // found it and if it is array if (Property && Property->IsA(FArrayProperty::StaticClass())) diff --git a/Engine/Source/Runtime/Engine/Private/Blueprint.cpp b/Engine/Source/Runtime/Engine/Private/Blueprint.cpp index 91fa466bc151..f72774b82e2f 100644 --- a/Engine/Source/Runtime/Engine/Private/Blueprint.cpp +++ b/Engine/Source/Runtime/Engine/Private/Blueprint.cpp @@ -1618,7 +1618,7 @@ ETimelineSigType UBlueprint::GetTimelineSignatureForFunctionByName(const FName& // If an object property was specified, find the class of that property instead if(ObjectPropertyName != NAME_None) { - FObjectPropertyBase* ObjProperty = FindField(SkeletonGeneratedClass, ObjectPropertyName); + FObjectPropertyBase* ObjProperty = FindFProperty(SkeletonGeneratedClass, ObjectPropertyName); if(ObjProperty == NULL) { UE_LOG(LogBlueprint, Log, TEXT("GetTimelineSignatureForFunction: Object Property '%s' not found."), *ObjectPropertyName.ToString()); @@ -1628,7 +1628,7 @@ ETimelineSigType UBlueprint::GetTimelineSignatureForFunctionByName(const FName& UseClass = ObjProperty->PropertyClass; } - UFunction* Function = FindField(UseClass, FunctionName); + UFunction* Function = FindUField(UseClass, FunctionName); if(Function == NULL) { UE_LOG(LogBlueprint, Log, TEXT("GetTimelineSignatureForFunction: Function '%s' not found in class '%s'."), *FunctionName.ToString(), *UseClass->GetName()); diff --git a/Engine/Source/Runtime/Engine/Private/BlueprintGeneratedClass.cpp b/Engine/Source/Runtime/Engine/Private/BlueprintGeneratedClass.cpp index 64eb82699853..dd5348663856 100644 --- a/Engine/Source/Runtime/Engine/Private/BlueprintGeneratedClass.cpp +++ b/Engine/Source/Runtime/Engine/Private/BlueprintGeneratedClass.cpp @@ -1063,7 +1063,7 @@ void UBlueprintGeneratedClass::CreateTimelineComponent(AActor* Actor, const UTim // Find property with the same name as the template and assign the new Timeline to it UClass* ActorClass = Actor->GetClass(); - FObjectPropertyBase* Prop = FindField(ActorClass, TimelineTemplate->GetVariableName()); + FObjectPropertyBase* Prop = FindFProperty(ActorClass, TimelineTemplate->GetVariableName()); if (Prop) { Prop->SetObjectPropertyValue_InContainer(Actor, NewTimeline); @@ -1740,7 +1740,7 @@ void FBlueprintCookedComponentInstancingData::BuildCachedPropertyList(FCustomPro const UStruct* PropertyScope = CurrentScope; while (!Property && PropertyScope) { - Property = FindField(PropertyScope, ChangedPropertyInfo.PropertyName); + Property = FindFProperty(PropertyScope, ChangedPropertyInfo.PropertyName); PropertyScope = PropertyScope->GetSuperStruct(); } diff --git a/Engine/Source/Runtime/Engine/Private/BlueprintMapLibrary.cpp b/Engine/Source/Runtime/Engine/Private/BlueprintMapLibrary.cpp index ac84d5686944..d540427a1557 100644 --- a/Engine/Source/Runtime/Engine/Private/BlueprintMapLibrary.cpp +++ b/Engine/Source/Runtime/Engine/Private/BlueprintMapLibrary.cpp @@ -112,7 +112,7 @@ void UBlueprintMapLibrary::GenericMap_SetMapPropertyByName(UObject* OwnerObject, { if (OwnerObject) { - if (FMapProperty* MapProp = FindField(OwnerObject->GetClass(), MapPropertyName)) + if (FMapProperty* MapProp = FindFProperty(OwnerObject->GetClass(), MapPropertyName)) { void* Dest = MapProp->ContainerPtrToValuePtr(OwnerObject); MapProp->CopyValuesInternal(Dest, SrcMapAddr, 1); diff --git a/Engine/Source/Runtime/Engine/Private/BlueprintSetLibrary.cpp b/Engine/Source/Runtime/Engine/Private/BlueprintSetLibrary.cpp index b0d2ee2f3847..a7ccc8ffb877 100644 --- a/Engine/Source/Runtime/Engine/Private/BlueprintSetLibrary.cpp +++ b/Engine/Source/Runtime/Engine/Private/BlueprintSetLibrary.cpp @@ -189,7 +189,7 @@ void UBlueprintSetLibrary::GenericSet_SetSetPropertyByName(UObject* OwnerObject, { if (OwnerObject) { - if (FSetProperty* SetProp = FindField(OwnerObject->GetClass(), SetPropertyName)) + if (FSetProperty* SetProp = FindFProperty(OwnerObject->GetClass(), SetPropertyName)) { void* Dest = SetProp->ContainerPtrToValuePtr(OwnerObject); SetProp->CopyValuesInternal(Dest, SrcSetAddr, 1); diff --git a/Engine/Source/Runtime/Engine/Private/Collision/CollisionProfile.cpp b/Engine/Source/Runtime/Engine/Private/Collision/CollisionProfile.cpp index e18475a0b5dc..7b8289bd547f 100644 --- a/Engine/Source/Runtime/Engine/Private/Collision/CollisionProfile.cpp +++ b/Engine/Source/Runtime/Engine/Private/Collision/CollisionProfile.cpp @@ -327,7 +327,7 @@ void UCollisionProfile::LoadProfileConfig(bool bForceInit) { // verify if the Struct name matches // this is to avoid situations where they mismatch and causes random bugs - FField* Field = FindField(Struct, DisplayName); + FField* Field = FindFProperty(Struct, DisplayName); if (!Field) { @@ -451,7 +451,7 @@ void UCollisionProfile::LoadProfileConfig(bool bForceInit) } #if WITH_EDITOR // now enum is fixed, so find member variable for the field - FField* Field = FindField(Struct, FName(*VariableName)); + FField* Field = FindFProperty(Struct, FName(*VariableName)); // I verified up in the class, this can't happen check (Field); Field->SetMetaData(*DisplayNameKey, *DisplayValue); diff --git a/Engine/Source/Runtime/Engine/Private/ComponentDelegateBinding.cpp b/Engine/Source/Runtime/Engine/Private/ComponentDelegateBinding.cpp index b66e6d4cd15b..2933e69dea38 100644 --- a/Engine/Source/Runtime/Engine/Private/ComponentDelegateBinding.cpp +++ b/Engine/Source/Runtime/Engine/Private/ComponentDelegateBinding.cpp @@ -16,13 +16,13 @@ void UComponentDelegateBinding::BindDynamicDelegates(UObject* InInstance) const const FBlueprintComponentDelegateBinding& Binding = ComponentDelegateBindings[BindIdx]; // Get the property that points to the component - if (const FObjectProperty* ObjProp = FindField(InInstance->GetClass(), Binding.ComponentPropertyName)) + if (const FObjectProperty* ObjProp = FindFProperty(InInstance->GetClass(), Binding.ComponentPropertyName)) { // ..see if there is actually a component assigned if (UObject* Component = ObjProp->GetObjectPropertyValue_InContainer(InInstance)) { // If there is, find and return the delegate property on it - if (FMulticastDelegateProperty* MulticastDelegateProp = FindField(Component->GetClass(), Binding.DelegatePropertyName)) + if (FMulticastDelegateProperty* MulticastDelegateProp = FindFProperty(Component->GetClass(), Binding.DelegatePropertyName)) { // Get the function we want to bind if (UFunction* FunctionToBind = InInstance->GetClass()->FindFunctionByName(Binding.FunctionNameToBind)) @@ -45,13 +45,13 @@ void UComponentDelegateBinding::UnbindDynamicDelegates(UObject* InInstance) cons const FBlueprintComponentDelegateBinding& Binding = ComponentDelegateBindings[BindIdx]; // Get the property that points to the component - if (const FObjectProperty* ObjProp = FindField(InInstance->GetClass(), Binding.ComponentPropertyName)) + if (const FObjectProperty* ObjProp = FindFProperty(InInstance->GetClass(), Binding.ComponentPropertyName)) { // ..see if there is actually a component assigned if (UObject* Component = ObjProp->GetObjectPropertyValue_InContainer(InInstance)) { // If there is, find and return the delegate property on it - if (FMulticastDelegateProperty* MulticastDelegateProp = FindField(Component->GetClass(), Binding.DelegatePropertyName)) + if (FMulticastDelegateProperty* MulticastDelegateProp = FindFProperty(Component->GetClass(), Binding.DelegatePropertyName)) { // Unbind function on the instance to this delegate FScriptDelegate Delegate; @@ -70,14 +70,14 @@ void UComponentDelegateBinding::UnbindDynamicDelegatesForProperty(UObject* InIns const FBlueprintComponentDelegateBinding& Binding = ComponentDelegateBindings[BindIdx]; if (InObjectProperty->GetFName() == Binding.ComponentPropertyName) { - const FObjectProperty* ObjProp = FindField(InInstance->GetClass(), Binding.ComponentPropertyName); + const FObjectProperty* ObjProp = FindFProperty(InInstance->GetClass(), Binding.ComponentPropertyName); if (ObjProp == InObjectProperty) { // ..see if there is actually a component assigned if (UObject* Component = ObjProp->GetObjectPropertyValue_InContainer(InInstance)) { // If there is, find and return the delegate property on it - if (FMulticastDelegateProperty* MulticastDelegateProp = FindField(Component->GetClass(), Binding.DelegatePropertyName)) + if (FMulticastDelegateProperty* MulticastDelegateProp = FindFProperty(Component->GetClass(), Binding.DelegatePropertyName)) { // Unbind function on the instance from this delegate FScriptDelegate Delegate; diff --git a/Engine/Source/Runtime/Engine/Private/Components/SplineComponent.cpp b/Engine/Source/Runtime/Engine/Private/Components/SplineComponent.cpp index 7941bf138a39..c50ade656c40 100644 --- a/Engine/Source/Runtime/Engine/Private/Components/SplineComponent.cpp +++ b/Engine/Source/Runtime/Engine/Private/Components/SplineComponent.cpp @@ -1682,7 +1682,7 @@ void USplineComponent::ApplyComponentInstanceData(FSplineInstanceData* SplineIns // If we are restoring the saved state, unmark the SplineCurves property as 'modified'. // We don't want to consider that these changes have been made through the UCS. TArray Properties; - Properties.Emplace(FindField(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves))); + Properties.Emplace(FindFProperty(USplineComponent::StaticClass(), GET_MEMBER_NAME_CHECKED(USplineComponent, SplineCurves))); RemoveUCSModifiedProperties(Properties); } } diff --git a/Engine/Source/Runtime/Engine/Private/DataTable.cpp b/Engine/Source/Runtime/Engine/Private/DataTable.cpp index 10d802c049c9..bf6ea4e8abd2 100644 --- a/Engine/Source/Runtime/Engine/Private/DataTable.cpp +++ b/Engine/Source/Runtime/Engine/Private/DataTable.cpp @@ -638,7 +638,7 @@ TArray UDataTable::GetTablePropertyArray(const TArray& } else { - FProperty* ColumnProp = FindField(InRowStruct, PropName); + FProperty* ColumnProp = FindFProperty(InRowStruct, PropName); for (TFieldIterator It(InRowStruct); It && !ColumnProp; ++It) { @@ -684,7 +684,7 @@ TArray UDataTable::GetTablePropertyArray(const TArray& // Generate warning for any properties in struct we are not filling in for (int32 PropIdx = 0; PropIdx < ExpectedPropNames.Num(); PropIdx++) { - const FProperty* const ColumnProp = FindField(InRowStruct, ExpectedPropNames[PropIdx]); + const FProperty* const ColumnProp = FindFProperty(InRowStruct, ExpectedPropNames[PropIdx]); #if WITH_EDITOR // If the structure has specified the property as optional for import (gameplay code likely doing a custom fix-up or parse of that property), diff --git a/Engine/Source/Runtime/Engine/Private/EngineTypes.cpp b/Engine/Source/Runtime/Engine/Private/EngineTypes.cpp index 5cd38a7d7650..ef2675696fdd 100644 --- a/Engine/Source/Runtime/Engine/Private/EngineTypes.cpp +++ b/Engine/Source/Runtime/Engine/Private/EngineTypes.cpp @@ -214,7 +214,7 @@ UActorComponent* FComponentReference::GetComponent(AActor* OwningActor) const { if(ComponentProperty != NAME_None) { - FObjectPropertyBase* ObjProp = FindField(SearchActor->GetClass(), ComponentProperty); + FObjectPropertyBase* ObjProp = FindFProperty(SearchActor->GetClass(), ComponentProperty); if(ObjProp != NULL) { // .. and return the component that is there diff --git a/Engine/Source/Runtime/Engine/Private/GameViewportClient.cpp b/Engine/Source/Runtime/Engine/Private/GameViewportClient.cpp index ab8cb67ed387..f847bd05e198 100644 --- a/Engine/Source/Runtime/Engine/Private/GameViewportClient.cpp +++ b/Engine/Source/Runtime/Engine/Private/GameViewportClient.cpp @@ -3560,7 +3560,7 @@ bool UGameViewportClient::HandleDisplayCommand( const TCHAR* Cmd, FOutputDevice& if (Obj != nullptr) { FName PropertyName(PropStr, FNAME_Find); - if (PropertyName != NAME_None && FindField(Obj->GetClass(), PropertyName) != nullptr) + if (PropertyName != NAME_None && FindFProperty(Obj->GetClass(), PropertyName) != nullptr) { AddDebugDisplayProperty(Obj, nullptr, PropertyName); } @@ -3612,7 +3612,7 @@ bool UGameViewportClient::HandleDisplayAllCommand( const TCHAR* Cmd, FOutputDevi if (Cls != nullptr) { FName PropertyName(PropStr, FNAME_Find); - FProperty* Prop = PropertyName != NAME_None ? FindField(Cls, PropertyName) : nullptr; + FProperty* Prop = PropertyName != NAME_None ? FindFProperty(Cls, PropertyName) : nullptr; { // add all un-GCable things immediately as that list is static // so then we only have to iterate over dynamic things each frame diff --git a/Engine/Source/Runtime/Engine/Private/InstancedReferenceSubobjectHelper.cpp b/Engine/Source/Runtime/Engine/Private/InstancedReferenceSubobjectHelper.cpp index 52efd5e56906..095edcf7c75d 100644 --- a/Engine/Source/Runtime/Engine/Private/InstancedReferenceSubobjectHelper.cpp +++ b/Engine/Source/Runtime/Engine/Private/InstancedReferenceSubobjectHelper.cpp @@ -10,7 +10,7 @@ UObject* FInstancedPropertyPath::Resolve(const UObject* Container) const auto GetProperty = [&CurrentContainerType, &PropChainRef](int32 ChainIndex)->FProperty* { const FProperty* SrcProperty = PropChainRef[ChainIndex].PropertyPtr; - return FindField(CurrentContainerType, SrcProperty->GetFName()); + return FindFProperty(CurrentContainerType, SrcProperty->GetFName()); }; const FProperty* CurrentProp = GetProperty(0); diff --git a/Engine/Source/Runtime/Engine/Private/KismetArrayLibrary.cpp b/Engine/Source/Runtime/Engine/Private/KismetArrayLibrary.cpp index e8be46550503..52a638d164ae 100644 --- a/Engine/Source/Runtime/Engine/Private/KismetArrayLibrary.cpp +++ b/Engine/Source/Runtime/Engine/Private/KismetArrayLibrary.cpp @@ -390,7 +390,7 @@ void UKismetArrayLibrary::GenericArray_SetArrayPropertyByName(UObject* OwnerObje { if (OwnerObject != NULL) { - FArrayProperty* ArrayProp = FindField(OwnerObject->GetClass(), ArrayPropertyName); + FArrayProperty* ArrayProp = FindFProperty(OwnerObject->GetClass(), ArrayPropertyName); if (ArrayProp != NULL) { void* Dest = ArrayProp->ContainerPtrToValuePtr(OwnerObject); diff --git a/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp b/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp index 88bee8292f7c..51d2147fc3f6 100644 --- a/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp +++ b/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp @@ -848,7 +848,7 @@ void UKismetSystemLibrary::SetIntPropertyByName(UObject* Object, FName PropertyN { if(Object != NULL) { - FIntProperty* IntProp = FindField(Object->GetClass(), PropertyName); + FIntProperty* IntProp = FindFProperty(Object->GetClass(), PropertyName); if(IntProp != NULL) { IntProp->SetPropertyValue_InContainer(Object, Value); @@ -860,7 +860,7 @@ void UKismetSystemLibrary::SetInt64PropertyByName(UObject* Object, FName Propert { if (Object != NULL) { - FInt64Property* IntProp = FindField(Object->GetClass(), PropertyName); + FInt64Property* IntProp = FindFProperty(Object->GetClass(), PropertyName); if (IntProp != NULL) { IntProp->SetPropertyValue_InContainer(Object, Value); @@ -872,11 +872,11 @@ void UKismetSystemLibrary::SetBytePropertyByName(UObject* Object, FName Property { if(Object != NULL) { - if(FByteProperty* ByteProp = FindField(Object->GetClass(), PropertyName)) + if(FByteProperty* ByteProp = FindFProperty(Object->GetClass(), PropertyName)) { ByteProp->SetPropertyValue_InContainer(Object, Value); } - else if(FEnumProperty* EnumProp = FindField(Object->GetClass(), PropertyName)) + else if(FEnumProperty* EnumProp = FindFProperty(Object->GetClass(), PropertyName)) { void* PropAddr = EnumProp->ContainerPtrToValuePtr(Object); FNumericProperty* UnderlyingProp = EnumProp->GetUnderlyingProperty(); @@ -889,7 +889,7 @@ void UKismetSystemLibrary::SetFloatPropertyByName(UObject* Object, FName Propert { if(Object != NULL) { - FFloatProperty* FloatProp = FindField(Object->GetClass(), PropertyName); + FFloatProperty* FloatProp = FindFProperty(Object->GetClass(), PropertyName); if(FloatProp != NULL) { FloatProp->SetPropertyValue_InContainer(Object, Value); @@ -901,7 +901,7 @@ void UKismetSystemLibrary::SetBoolPropertyByName(UObject* Object, FName Property { if(Object != NULL) { - FBoolProperty* BoolProp = FindField(Object->GetClass(), PropertyName); + FBoolProperty* BoolProp = FindFProperty(Object->GetClass(), PropertyName); if(BoolProp != NULL) { BoolProp->SetPropertyValue_InContainer(Object, Value ); @@ -913,7 +913,7 @@ void UKismetSystemLibrary::SetObjectPropertyByName(UObject* Object, FName Proper { if(Object != NULL && Value != NULL) { - FObjectPropertyBase* ObjectProp = FindField(Object->GetClass(), PropertyName); + FObjectPropertyBase* ObjectProp = FindFProperty(Object->GetClass(), PropertyName); if(ObjectProp != NULL && Value->IsA(ObjectProp->PropertyClass)) // check it's the right type { ObjectProp->SetObjectPropertyValue_InContainer(Object, Value); @@ -925,7 +925,7 @@ void UKismetSystemLibrary::SetClassPropertyByName(UObject* Object, FName Propert { if (Object && *Value) { - FClassProperty* ClassProp = FindField(Object->GetClass(), PropertyName); + FClassProperty* ClassProp = FindFProperty(Object->GetClass(), PropertyName); if (ClassProp != NULL && Value->IsChildOf(ClassProp->MetaClass)) // check it's the right type { ClassProp->SetObjectPropertyValue_InContainer(Object, *Value); @@ -937,7 +937,7 @@ void UKismetSystemLibrary::SetInterfacePropertyByName(UObject* Object, FName Pro { if (Object) { - FInterfaceProperty* InterfaceProp = FindField(Object->GetClass(), PropertyName); + FInterfaceProperty* InterfaceProp = FindFProperty(Object->GetClass(), PropertyName); if (InterfaceProp != NULL && Value.GetObject()->GetClass()->ImplementsInterface(InterfaceProp->InterfaceClass)) // check it's the right type { InterfaceProp->SetPropertyValue_InContainer(Object, Value); @@ -949,7 +949,7 @@ void UKismetSystemLibrary::SetStringPropertyByName(UObject* Object, FName Proper { if(Object != NULL) { - FStrProperty* StringProp = FindField(Object->GetClass(), PropertyName); + FStrProperty* StringProp = FindFProperty(Object->GetClass(), PropertyName); if(StringProp != NULL) { StringProp->SetPropertyValue_InContainer(Object, Value); @@ -961,7 +961,7 @@ void UKismetSystemLibrary::SetNamePropertyByName(UObject* Object, FName Property { if(Object != NULL) { - FNameProperty* NameProp = FindField(Object->GetClass(), PropertyName); + FNameProperty* NameProp = FindFProperty(Object->GetClass(), PropertyName); if(NameProp != NULL) { NameProp->SetPropertyValue_InContainer(Object, Value); @@ -973,7 +973,7 @@ void UKismetSystemLibrary::SetSoftObjectPropertyByName(UObject* Object, FName Pr { if (Object != NULL) { - FSoftObjectProperty* ObjectProp = FindField(Object->GetClass(), PropertyName); + FSoftObjectProperty* ObjectProp = FindFProperty(Object->GetClass(), PropertyName); const FSoftObjectPtr* SoftObjectPtr = (const FSoftObjectPtr*)(&Value); ObjectProp->SetPropertyValue_InContainer(Object, *SoftObjectPtr); } @@ -983,7 +983,7 @@ void UKismetSystemLibrary::SetFieldPathPropertyByName(UObject* Object, FName Pro { if (Object != NULL) { - FFieldPathProperty* FieldProp = FindField(Object->GetClass(), PropertyName); + FFieldPathProperty* FieldProp = FindFProperty(Object->GetClass(), PropertyName); const FFieldPath* FieldPathPtr = (const FFieldPath*)(&Value); FieldProp->SetPropertyValue_InContainer(Object, *FieldPathPtr); } @@ -993,7 +993,7 @@ void UKismetSystemLibrary::SetSoftClassPropertyByName(UObject* Object, FName Pro { if (Object != NULL) { - FSoftClassProperty* ObjectProp = FindField(Object->GetClass(), PropertyName); + FSoftClassProperty* ObjectProp = FindFProperty(Object->GetClass(), PropertyName); const FSoftObjectPtr* SoftObjectPtr = (const FSoftObjectPtr*)(&Value); ObjectProp->SetPropertyValue_InContainer(Object, *SoftObjectPtr); } @@ -1119,7 +1119,7 @@ void UKismetSystemLibrary::SetTextPropertyByName(UObject* Object, FName Property { if(Object != NULL) { - FTextProperty* TextProp = FindField(Object->GetClass(), PropertyName); + FTextProperty* TextProp = FindFProperty(Object->GetClass(), PropertyName); if(TextProp != NULL) { TextProp->SetPropertyValue_InContainer(Object, Value); @@ -1132,7 +1132,7 @@ void UKismetSystemLibrary::SetVectorPropertyByName(UObject* Object, FName Proper if(Object != NULL) { UScriptStruct* VectorStruct = TBaseStructure::Get(); - FStructProperty* VectorProp = FindField(Object->GetClass(), PropertyName); + FStructProperty* VectorProp = FindFProperty(Object->GetClass(), PropertyName); if(VectorProp != NULL && VectorProp->Struct == VectorStruct) { *VectorProp->ContainerPtrToValuePtr(Object) = Value; @@ -1145,7 +1145,7 @@ void UKismetSystemLibrary::SetRotatorPropertyByName(UObject* Object, FName Prope if(Object != NULL) { UScriptStruct* RotatorStruct = TBaseStructure::Get(); - FStructProperty* RotatorProp = FindField(Object->GetClass(), PropertyName); + FStructProperty* RotatorProp = FindFProperty(Object->GetClass(), PropertyName); if(RotatorProp != NULL && RotatorProp->Struct == RotatorStruct) { *RotatorProp->ContainerPtrToValuePtr(Object) = Value; @@ -1158,7 +1158,7 @@ void UKismetSystemLibrary::SetLinearColorPropertyByName(UObject* Object, FName P if(Object != NULL) { UScriptStruct* ColorStruct = TBaseStructure::Get(); - FStructProperty* ColorProp = FindField(Object->GetClass(), PropertyName); + FStructProperty* ColorProp = FindFProperty(Object->GetClass(), PropertyName); if(ColorProp != NULL && ColorProp->Struct == ColorStruct) { *ColorProp->ContainerPtrToValuePtr(Object) = Value; @@ -1171,7 +1171,7 @@ void UKismetSystemLibrary::SetTransformPropertyByName(UObject* Object, FName Pro if(Object != NULL) { UScriptStruct* TransformStruct = TBaseStructure::Get(); - FStructProperty* TransformProp = FindField(Object->GetClass(), PropertyName); + FStructProperty* TransformProp = FindFProperty(Object->GetClass(), PropertyName); if(TransformProp != NULL && TransformProp->Struct == TransformStruct) { *TransformProp->ContainerPtrToValuePtr(Object) = Value; @@ -1189,7 +1189,7 @@ void UKismetSystemLibrary::Generic_SetStructurePropertyByName(UObject* OwnerObje { if (OwnerObject != NULL) { - FStructProperty* StructProp = FindField(OwnerObject->GetClass(), StructPropertyName); + FStructProperty* StructProp = FindFProperty(OwnerObject->GetClass(), StructPropertyName); if (StructProp != NULL) { void* Dest = StructProp->ContainerPtrToValuePtr(OwnerObject); diff --git a/Engine/Source/Runtime/Engine/Private/Materials/MaterialExpressions.cpp b/Engine/Source/Runtime/Engine/Private/Materials/MaterialExpressions.cpp index 84624c7ef694..701ab79effd9 100644 --- a/Engine/Source/Runtime/Engine/Private/Materials/MaterialExpressions.cpp +++ b/Engine/Source/Runtime/Engine/Private/Materials/MaterialExpressions.cpp @@ -849,7 +849,7 @@ bool UMaterialExpression::CanEditChange(const FProperty* InProperty) const { const FString& OverridingPropertyName = InProperty->GetMetaData(OverridingInputPropertyMetaData); - FStructProperty* StructProp = FindField(GetClass(), *OverridingPropertyName); + FStructProperty* StructProp = FindFProperty(GetClass(), *OverridingPropertyName); if (ensure(StructProp != nullptr)) { static FName RequiredInputMetaData(TEXT("RequiredInput")); @@ -2495,7 +2495,7 @@ void UMaterialExpressionRuntimeVirtualTextureSampleParameter::SetValueToMatching if (Material->GetRuntimeVirtualTextureParameterValue(FMaterialParameterInfo(OtherExpression->GetParameterName()), Value)) { VirtualTexture = Value; - FProperty* ParamProperty = FindField(UMaterialExpressionRuntimeVirtualTextureSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionRuntimeVirtualTextureSampleParameter, VirtualTexture)); + FProperty* ParamProperty = FindFProperty(UMaterialExpressionRuntimeVirtualTextureSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionRuntimeVirtualTextureSampleParameter, VirtualTexture)); FPropertyChangedEvent PropertyChangedEvent(ParamProperty); PostEditChangeProperty(PropertyChangedEvent); } @@ -2717,7 +2717,7 @@ void UMaterialExpressionTextureSampleParameter::SetValueToMatchingExpression(UMa UTexture* ExistingValue; Material->GetTextureParameterValue(OtherExpression->GetParameterName(), ExistingValue); Texture = ExistingValue; - FProperty* ParamProperty = FindField(UMaterialExpressionTextureSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionTextureSampleParameter, Texture)); + FProperty* ParamProperty = FindFProperty(UMaterialExpressionTextureSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionTextureSampleParameter, Texture)); FPropertyChangedEvent PropertyChangedEvent(ParamProperty); PostEditChangeProperty(PropertyChangedEvent); } @@ -4413,16 +4413,16 @@ void UMaterialExpressionStaticComponentMaskParameter::SetValueToMatchingExpressi DefaultG = G; DefaultB = B; DefaultA = A; - FProperty* ParamProperty = FindField(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultR)); + FProperty* ParamProperty = FindFProperty(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultR)); FPropertyChangedEvent RChangedEvent(ParamProperty); PostEditChangeProperty(RChangedEvent); - ParamProperty = FindField(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultG)); + ParamProperty = FindFProperty(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultG)); FPropertyChangedEvent GChangedEvent(ParamProperty); PostEditChangeProperty(GChangedEvent); - ParamProperty = FindField(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultB)); + ParamProperty = FindFProperty(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultB)); FPropertyChangedEvent BChangedEvent(ParamProperty); PostEditChangeProperty(BChangedEvent); - ParamProperty = FindField(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultA)); + ParamProperty = FindFProperty(UMaterialExpressionStaticComponentMaskParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticComponentMaskParameter, DefaultA)); FPropertyChangedEvent AChangedEvent(ParamProperty); PostEditChangeProperty(AChangedEvent); } @@ -7359,7 +7359,7 @@ void UMaterialExpressionVectorParameter::SetValueToMatchingExpression(UMaterialE FLinearColor ExistingValue = FLinearColor::Transparent; Material->GetVectorParameterValue(FMaterialParameterInfo(OtherExpression->GetParameterName()), ExistingValue); DefaultValue = ExistingValue; - FProperty* ParamProperty = FindField(UMaterialExpressionVectorParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionVectorParameter, DefaultValue)); + FProperty* ParamProperty = FindFProperty(UMaterialExpressionVectorParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionVectorParameter, DefaultValue)); FPropertyChangedEvent PropertyChangedEvent(ParamProperty); PostEditChangeProperty(PropertyChangedEvent); } @@ -7660,7 +7660,7 @@ void UMaterialExpressionScalarParameter::SetValueToMatchingExpression(UMaterialE float ExistingValue = 0.0f; Material->GetScalarParameterDefaultValue(FMaterialParameterInfo(OtherExpression->GetParameterName()), ExistingValue); DefaultValue = ExistingValue; - FProperty* ParamProperty = FindField(UMaterialExpressionScalarParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionScalarParameter, DefaultValue)); + FProperty* ParamProperty = FindFProperty(UMaterialExpressionScalarParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionScalarParameter, DefaultValue)); FPropertyChangedEvent PropertyChangedEvent(ParamProperty); PostEditChangeProperty(PropertyChangedEvent); } @@ -7779,7 +7779,7 @@ void UMaterialExpressionStaticBoolParameter::SetValueToMatchingExpression(UMater FGuid Guid; Material->GetStaticSwitchParameterValue(OtherExpression->GetParameterName(), ExistingValue, Guid); DefaultValue = ExistingValue; - FProperty* ParamProperty = FindField(UMaterialExpressionStaticBoolParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticBoolParameter, DefaultValue)); + FProperty* ParamProperty = FindFProperty(UMaterialExpressionStaticBoolParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionStaticBoolParameter, DefaultValue)); FPropertyChangedEvent PropertyChangedEvent(ParamProperty); PostEditChangeProperty(PropertyChangedEvent); } @@ -9251,7 +9251,7 @@ FName UMaterialExpressionSceneDepth::GetInputName(int32 InputIndex) const if(InputIndex == 0) { // Display the current InputMode enum's display name. - FByteProperty* InputModeProperty = FindField( UMaterialExpressionSceneDepth::StaticClass(), "InputMode" ); + FByteProperty* InputModeProperty = FindFProperty( UMaterialExpressionSceneDepth::StaticClass(), "InputMode" ); // Can't use GetNameByValue as GetNameStringByValue does name mangling that GetNameByValue does not return *InputModeProperty->Enum->GetNameStringByValue((int64)InputMode.GetValue()); } @@ -9548,7 +9548,7 @@ FName UMaterialExpressionSceneColor::GetInputName(int32 InputIndex) const if(InputIndex == 0) { // Display the current InputMode enum's display name. - FByteProperty* InputModeProperty = FindField( UMaterialExpressionSceneColor::StaticClass(), "InputMode" ); + FByteProperty* InputModeProperty = FindFProperty( UMaterialExpressionSceneColor::StaticClass(), "InputMode" ); // Can't use GetNameByValue as GetNameStringByValue does name mangling that GetNameByValue does not return *InputModeProperty->Enum->GetNameStringByValue((int64)InputMode.GetValue()); } @@ -10274,10 +10274,10 @@ void UMaterialExpressionFontSampleParameter::SetValueToMatchingExpression(UMater Material->GetFontParameterValue(FMaterialParameterInfo(OtherExpression->GetParameterName()), FontValue, FontPage); Font = FontValue; FontTexturePage = FontPage; - FProperty* ParamProperty = FindField(UMaterialExpressionFontSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionFontSampleParameter, Font)); + FProperty* ParamProperty = FindFProperty(UMaterialExpressionFontSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionFontSampleParameter, Font)); FPropertyChangedEvent PropertyChangedEvent(ParamProperty); PostEditChangeProperty(PropertyChangedEvent); - ParamProperty = FindField(UMaterialExpressionFontSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionFontSampleParameter, FontTexturePage)); + ParamProperty = FindFProperty(UMaterialExpressionFontSampleParameter::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UMaterialExpressionFontSampleParameter, FontTexturePage)); FPropertyChangedEvent PageChangedEvent(ParamProperty); PostEditChangeProperty(PageChangedEvent); } diff --git a/Engine/Source/Runtime/Engine/Private/MatineeUtils.cpp b/Engine/Source/Runtime/Engine/Private/MatineeUtils.cpp index 76ea37ec12b8..652f57e76943 100644 --- a/Engine/Source/Runtime/Engine/Private/MatineeUtils.cpp +++ b/Engine/Source/Runtime/Engine/Private/MatineeUtils.cpp @@ -342,7 +342,7 @@ namespace FMatineeUtils if (InPropertyName.Split(TEXT("."), &CompString, &PropString)) { - if (FStructProperty* StructProp = FindField(InStruct, *CompString)) + if (FStructProperty* StructProp = FindFProperty(InStruct, *CompString)) { // The first part of the path was a struct, look inside it void* StructContainer = StructProp->ContainerPtrToValuePtr(InObject); @@ -375,7 +375,7 @@ namespace FMatineeUtils else { // Look for the property in the current scope - if (FProperty* Prop = FindField(InStruct, *InPropertyName)) + if (FProperty* Prop = FindFProperty(InStruct, *InPropertyName)) { OutPropContainer = BasePointer; OutProperty = Prop; diff --git a/Engine/Source/Runtime/Engine/Private/MemberReference.cpp b/Engine/Source/Runtime/Engine/Private/MemberReference.cpp index fbb58388a95b..495bbce1c2e9 100644 --- a/Engine/Source/Runtime/Engine/Private/MemberReference.cpp +++ b/Engine/Source/Runtime/Engine/Private/MemberReference.cpp @@ -122,7 +122,7 @@ bool FMemberReference::IsSparseClassData(const UClass* OwningClass) const UScriptStruct* SparseClassDataStruct = OwningClass ? OwningClass->GetSparseClassDataStruct() : nullptr; if (SparseClassDataStruct) { - FProperty* VariableProperty = FindField(SparseClassDataStruct, GetMemberName()); + FProperty* VariableProperty = FindFProperty(SparseClassDataStruct, GetMemberName()); bIsSparseClassData = VariableProperty != nullptr; } @@ -282,7 +282,8 @@ TFieldType* FindRemappedFieldImpl(FName FieldClassOutermostName, FName FieldClas FMemberReference::InitFieldRedirectMap(); // In the case of a bifurcation of a variable (e.g. moved from a parent into certain children), verify that we don't also define the variable in the current scope first - if (FindField(InitialScope, InitialName) != nullptr) + FFieldVariant ExistingField = FindUFieldOrFProperty(InitialScope, InitialName); + if (ExistingField.Get()) { return nullptr; } @@ -326,7 +327,7 @@ TFieldType* FindRemappedFieldImpl(FName FieldClassOutermostName, FName FieldClas if (NewFieldName != NAME_None) { // Find the actual field specified by the redirector, so we can return it and update the node that uses it - TFieldType* NewField = FindField(SearchClass, NewFieldName); + TFieldType* NewField = FindUFieldOrFProperty(SearchClass, NewFieldName).Get(); if (NewField != nullptr) { if (bInitialScopeMustBeOwnerOfField && !InitialScope->IsChildOf(SearchClass)) diff --git a/Engine/Source/Runtime/Engine/Private/Net/NetPushModelHelpers.cpp b/Engine/Source/Runtime/Engine/Private/Net/NetPushModelHelpers.cpp index 70a4c4b673e5..52fadc0b1cf8 100644 --- a/Engine/Source/Runtime/Engine/Private/Net/NetPushModelHelpers.cpp +++ b/Engine/Source/Runtime/Engine/Private/Net/NetPushModelHelpers.cpp @@ -16,7 +16,7 @@ void UNetPushModelHelpers::MarkPropertyDirty(UObject* Object, FName PropertyName // If this is too slow to be practical, we might be able build a lookup from ClassName+PropertyName -> RepIndex. // It would be safest to invalidate the lookup on a hot reload / recompile (if possible), blueprint recompile, // and map change. - FProperty* Property = FindField(Class, PropertyName); + FProperty* Property = FindFProperty(Class, PropertyName); if (Property == nullptr) { UE_LOG(LogNet, Warning, TEXT("UNetPushModelHelpers::MarkPropertyDirty: Unable to find Property %s in Class %s"), *PropertyName.ToString(), *Class->GetPathName()); diff --git a/Engine/Source/Runtime/Engine/Private/NetworkDriver.cpp b/Engine/Source/Runtime/Engine/Private/NetworkDriver.cpp index e703642f54fd..a49b783ae0f0 100644 --- a/Engine/Source/Runtime/Engine/Private/NetworkDriver.cpp +++ b/Engine/Source/Runtime/Engine/Private/NetworkDriver.cpp @@ -2798,7 +2798,7 @@ bool UNetDriver::HandleNetDumpServerRPCCommand( const TCHAR* Cmd, FOutputDevice& bool UNetDriver::HandleNetDumpDormancy(const TCHAR* Cmd, FOutputDevice& Ar) { - FProperty* Property = FindField(AActor::StaticClass(), TEXT("NetDormancy")); + FProperty* Property = FindFProperty(AActor::StaticClass(), TEXT("NetDormancy")); check(Property != nullptr); Ar.Logf(TEXT("")); TArray Actors; diff --git a/Engine/Source/Runtime/Engine/Private/Particles/ParticleModules.cpp b/Engine/Source/Runtime/Engine/Private/Particles/ParticleModules.cpp index 91f6edbde488..b3d975f8e135 100644 --- a/Engine/Source/Runtime/Engine/Private/Particles/ParticleModules.cpp +++ b/Engine/Source/Runtime/Engine/Private/Particles/ParticleModules.cpp @@ -3472,7 +3472,7 @@ void UParticleModuleTypeDataMesh::OnMeshChanged() OuterObj = Emitter->GetOuter(); } - FProperty* MeshProperty = FindField(UParticleModuleTypeDataMesh::StaticClass(), FName(TEXT("Mesh"))); + FProperty* MeshProperty = FindFProperty(UParticleModuleTypeDataMesh::StaticClass(), FName(TEXT("Mesh"))); FPropertyChangedEvent PropertyChangedEvent(MeshProperty); UParticleSystem* PartSys = CastChecked(OuterObj); diff --git a/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicalMaterialMask.cpp b/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicalMaterialMask.cpp index 8966132c802e..d9dda460c797 100644 --- a/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicalMaterialMask.cpp +++ b/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicalMaterialMask.cpp @@ -155,11 +155,11 @@ void UPhysicalMaterialMask::SetMaskTexture(UTexture* InMaskTexture, const FStrin MaskTexture = InMaskTexture; AssetImportData->AddFileName(InTextureFilename, 0); - FProperty* ParamProperty = FindField(UPhysicalMaterialMask::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UPhysicalMaterialMask, MaskTexture)); + FProperty* ParamProperty = FindFProperty(UPhysicalMaterialMask::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UPhysicalMaterialMask, MaskTexture)); FPropertyChangedEvent TextureChangedEvent(ParamProperty); PostEditChangeProperty(TextureChangedEvent); - ParamProperty = FindField(UPhysicalMaterialMask::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UPhysicalMaterialMask, AssetImportData)); + ParamProperty = FindFProperty(UPhysicalMaterialMask::StaticClass(), GET_MEMBER_NAME_STRING_CHECKED(UPhysicalMaterialMask, AssetImportData)); FPropertyChangedEvent AssetImportDataChangedEvent(ParamProperty); PostEditChangeProperty(AssetImportDataChangedEvent); } diff --git a/Engine/Source/Runtime/Engine/Private/SCS_Node.cpp b/Engine/Source/Runtime/Engine/Private/SCS_Node.cpp index baed6d0deae2..8f89be7cd4df 100644 --- a/Engine/Source/Runtime/Engine/Private/SCS_Node.cpp +++ b/Engine/Source/Runtime/Engine/Private/SCS_Node.cpp @@ -161,7 +161,7 @@ UActorComponent* USCS_Node::ExecuteNodeOnActor(AActor* Actor, USceneComponent* P if (VarName != NAME_None) { UClass* ActorClass = Actor->GetClass(); - if (FObjectPropertyBase* Prop = FindField(ActorClass, VarName)) + if (FObjectPropertyBase* Prop = FindFProperty(ActorClass, VarName)) { // If it is null we don't really know what's going on, but make it behave as it did before the bug fix if (Prop->PropertyClass == nullptr || NewActorComp->IsA(Prop->PropertyClass)) diff --git a/Engine/Source/Runtime/Engine/Private/SimpleConstructionScript.cpp b/Engine/Source/Runtime/Engine/Private/SimpleConstructionScript.cpp index 640d7d06bf6f..93f9464fcca4 100644 --- a/Engine/Source/Runtime/Engine/Private/SimpleConstructionScript.cpp +++ b/Engine/Source/Runtime/Engine/Private/SimpleConstructionScript.cpp @@ -666,7 +666,7 @@ void USimpleConstructionScript::ExecuteScriptOnActor(AActor* Actor, const TInlin else { // In the non-native case, the SCS node's variable name property is used as the parent identifier - FObjectPropertyBase* Property = FindField(ActorClass, RootNode->ParentComponentOrVariableName); + FObjectPropertyBase* Property = FindFProperty(ActorClass, RootNode->ParentComponentOrVariableName); if(Property != nullptr) { // If we found a matching property, grab its value and use that as the parent for this node diff --git a/Engine/Source/Runtime/Engine/Private/StaticMesh.cpp b/Engine/Source/Runtime/Engine/Private/StaticMesh.cpp index 4697f6376134..b616b39bd922 100644 --- a/Engine/Source/Runtime/Engine/Private/StaticMesh.cpp +++ b/Engine/Source/Runtime/Engine/Private/StaticMesh.cpp @@ -6480,7 +6480,7 @@ void UStaticMesh::SetMaterial(int32 MaterialIndex, UMaterialInterface* NewMateri FScopedTransaction ScopeTransaction(LOCTEXT("StaticMeshMaterialChanged", "StaticMesh: Material changed")); // flag the property (Materials) we're modifying so that not all of the object is rebuilt. - FProperty* ChangedProperty = FindField(UStaticMesh::StaticClass(), NAME_StaticMaterials); + FProperty* ChangedProperty = FindFProperty(UStaticMesh::StaticClass(), NAME_StaticMaterials); check(ChangedProperty); PreEditChange(ChangedProperty); UMaterialInterface* CancelOldMaterial = StaticMaterials[MaterialIndex].MaterialInterface; diff --git a/Engine/Source/Runtime/Engine/Private/Tests/Internationalization/TextPropertyTest.cpp b/Engine/Source/Runtime/Engine/Private/Tests/Internationalization/TextPropertyTest.cpp index 3ed22cd7b7d1..1a5f77ed4032 100644 --- a/Engine/Source/Runtime/Engine/Private/Tests/Internationalization/TextPropertyTest.cpp +++ b/Engine/Source/Runtime/Engine/Private/Tests/Internationalization/TextPropertyTest.cpp @@ -22,8 +22,8 @@ IMPLEMENT_SIMPLE_AUTOMATION_TEST(FTextPropertyTest, "System.Engine.International bool FTextPropertyTest::RunTest (const FString& Parameters) { UClass* const TextPropertyTestObjectClass = UTextPropertyTestObject::StaticClass(); - FTextProperty* const DefaultedTextProperty = FindField(TextPropertyTestObjectClass, "DefaultedText"); - FTextProperty* const UndefaultedTextProperty = FindField(TextPropertyTestObjectClass, "UndefaultedText"); + FTextProperty* const DefaultedTextProperty = FindFProperty(TextPropertyTestObjectClass, "DefaultedText"); + FTextProperty* const UndefaultedTextProperty = FindFProperty(TextPropertyTestObjectClass, "UndefaultedText"); UTextPropertyTestObject* const TextPropertyTestCDO = Cast( TextPropertyTestObjectClass->ClassDefaultObject ); { diff --git a/Engine/Source/Runtime/Engine/Private/Timeline.cpp b/Engine/Source/Runtime/Engine/Private/Timeline.cpp index b2afd6a1d75f..ca7c3e5e1ad6 100644 --- a/Engine/Source/Runtime/Engine/Private/Timeline.cpp +++ b/Engine/Source/Runtime/Engine/Private/Timeline.cpp @@ -233,7 +233,7 @@ void FTimeline::SetPlaybackPosition(float NewPosition, bool bFireEvents, bool bF { if (VecEntry.VectorProperty == NULL) { - VecEntry.VectorProperty = FindField(PropSetObject->GetClass(), VecEntry.VectorPropertyName); + VecEntry.VectorProperty = FindFProperty(PropSetObject->GetClass(), VecEntry.VectorPropertyName); if(VecEntry.VectorProperty == NULL) { UE_LOG(LogTimeline, Log, TEXT("SetPlaybackPosition: No vector property '%s' in '%s'"), *VecEntry.VectorPropertyName.ToString(), *PropSetObject->GetName()); @@ -267,7 +267,7 @@ void FTimeline::SetPlaybackPosition(float NewPosition, bool bFireEvents, bool bF { if (FloatEntry.FloatProperty == NULL) { - FloatEntry.FloatProperty = FindField(PropSetObject->GetClass(), FloatEntry.FloatPropertyName); + FloatEntry.FloatProperty = FindFProperty(PropSetObject->GetClass(), FloatEntry.FloatPropertyName); if(FloatEntry.FloatProperty == NULL) { UE_LOG(LogTimeline, Log, TEXT("SetPlaybackPosition: No float property '%s' in '%s'"), *FloatEntry.FloatPropertyName.ToString(), *PropSetObject->GetName()); @@ -301,7 +301,7 @@ void FTimeline::SetPlaybackPosition(float NewPosition, bool bFireEvents, bool bF { if (ColorEntry.LinearColorProperty == NULL) { - ColorEntry.LinearColorProperty = FindField(PropSetObject->GetClass(), ColorEntry.LinearColorPropertyName); + ColorEntry.LinearColorProperty = FindFProperty(PropSetObject->GetClass(), ColorEntry.LinearColorPropertyName); if(ColorEntry.LinearColorProperty == NULL) { UE_LOG(LogTimeline, Log, TEXT("SetPlaybackPosition: No linear color property '%s' in '%s'"), *ColorEntry.LinearColorPropertyName.ToString(), *PropSetObject->GetName()); @@ -324,10 +324,10 @@ void FTimeline::SetPlaybackPosition(float NewPosition, bool bFireEvents, bool bF { if (DirectionProperty == nullptr) { - DirectionProperty = FindField(PropSetObject->GetClass(), DirectionPropertyName); + DirectionProperty = FindFProperty(PropSetObject->GetClass(), DirectionPropertyName); if (DirectionProperty == nullptr) { - DirectionProperty = FindField(PropSetObject->GetClass(), DirectionPropertyName); + DirectionProperty = FindFProperty(PropSetObject->GetClass(), DirectionPropertyName); } if (DirectionProperty == nullptr) diff --git a/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp b/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp index 8b6bafb0b82c..d771abe4cdf3 100644 --- a/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp +++ b/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp @@ -10464,7 +10464,7 @@ void DrawStatsHUD( UWorld* World, FViewport* Viewport, FCanvas* Canvas, UCanvas* UClass* Cls = Cast(DebugProperties[i].Obj); if (Cls != NULL) { - FProperty* Prop = FindField(Cls, DebugProperties[i].PropertyName); + FProperty* Prop = FindFProperty(Cls, DebugProperties[i].PropertyName); if (Prop != NULL || DebugProperties[i].bSpecialProperty) { // getall @@ -10485,7 +10485,7 @@ void DrawStatsHUD( UWorld* World, FViewport* Viewport, FCanvas* Canvas, UCanvas* } else { - FProperty* Prop = FindField(DebugProperties[i].Obj->GetClass(), DebugProperties[i].PropertyName); + FProperty* Prop = FindFProperty(DebugProperties[i].Obj->GetClass(), DebugProperties[i].PropertyName); if (Prop != NULL || DebugProperties[i].bSpecialProperty) { DrawProperty(CanvasObject, DebugProperties[i].Obj, DebugProperties[i], Prop, X, Y); @@ -14274,7 +14274,7 @@ void UEngine::CopyPropertiesForUnrelatedObjects(UObject* OldObject, UObject* New FObjectProperty* RootComponentProperty = nullptr; if (NewActor != nullptr && Params.bPreserveRootComponent) { - RootComponentProperty = FindField(NewActor->GetClass(), "RootComponent"); + RootComponentProperty = FindFProperty(NewActor->GetClass(), "RootComponent"); if (RootComponentProperty != nullptr) { SavedRootComponent = Cast(RootComponentProperty->GetObjectPropertyValue_InContainer(NewActor)); diff --git a/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp b/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp index afe02acfde02..088271100a93 100644 --- a/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp +++ b/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp @@ -1306,7 +1306,7 @@ void UGeometryCollectionComponent::OnCreatePhysicsState() if (EditorComponent) { - EditorComponent->PreEditChange(FindField(EditorComponent->GetClass(), GET_MEMBER_NAME_CHECKED(UGeometryCollectionComponent, CacheParameters))); + EditorComponent->PreEditChange(FindFProperty(EditorComponent->GetClass(), GET_MEMBER_NAME_CHECKED(UGeometryCollectionComponent, CacheParameters))); EditorComponent->Modify(); EditorComponent->CacheParameters.TargetCache = CacheParameters.TargetCache; diff --git a/Engine/Source/Runtime/GameplayTags/Private/GameplayTagContainer.cpp b/Engine/Source/Runtime/GameplayTags/Private/GameplayTagContainer.cpp index add02f6f3502..2365b7f0101d 100644 --- a/Engine/Source/Runtime/GameplayTags/Private/GameplayTagContainer.cpp +++ b/Engine/Source/Runtime/GameplayTags/Private/GameplayTagContainer.cpp @@ -1675,7 +1675,7 @@ void FGameplayTagQuery::BuildFromEditableQuery(UEditableGameplayTagQuery& Editab FString UEditableGameplayTagQuery::GetTagQueryExportText(FGameplayTagQuery const& TagQuery) { TagQueryExportText_Helper = TagQuery; - FProperty* const TQProperty = FindField(GetClass(), TEXT("TagQueryExportText_Helper")); + FProperty* const TQProperty = FindFProperty(GetClass(), TEXT("TagQueryExportText_Helper")); FString OutString; TQProperty->ExportTextItem(OutString, (void*)&TagQueryExportText_Helper, (void*)&TagQueryExportText_Helper, this, 0); diff --git a/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp b/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp index 8196417c5758..4b4ada2aa63e 100644 --- a/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp +++ b/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp @@ -1358,7 +1358,7 @@ FString UGameplayTagsManager::GetCategoriesMetaFromFunction(const UFunction* Thi // If a param name was specified, check it first for UPARAM metadata if (!ParamName.IsNone()) { - FProperty* ParamProp = FindField(ThisFunction, ParamName); + FProperty* ParamProp = FindFProperty(ThisFunction, ParamName); if (ParamProp) { FilterString = UGameplayTagsManager::Get().GetCategoriesMetaFromField(ParamProp); diff --git a/Engine/Source/Runtime/MovieScene/Private/MovieSceneCommonHelpers.cpp b/Engine/Source/Runtime/MovieScene/Private/MovieSceneCommonHelpers.cpp index 26944646d3e0..4806fb4e5639 100644 --- a/Engine/Source/Runtime/MovieScene/Private/MovieSceneCommonHelpers.cpp +++ b/Engine/Source/Runtime/MovieScene/Private/MovieSceneCommonHelpers.cpp @@ -417,7 +417,7 @@ FPropertyAndIndex FindPropertyAndArrayIndex(UStruct* InStruct, const FString& Pr if (PropertyName.FindLastChar('[', OpenIndex)) { FString TruncatedPropertyName(OpenIndex, *PropertyName); - PropertyAndIndex.Property = FindField(InStruct, *TruncatedPropertyName); + PropertyAndIndex.Property = FindFProperty(InStruct, *TruncatedPropertyName); const int32 NumberLength = PropertyName.Len() - OpenIndex - 2; if (NumberLength > 0 && NumberLength <= 10) @@ -431,7 +431,7 @@ FPropertyAndIndex FindPropertyAndArrayIndex(UStruct* InStruct, const FString& Pr } } - PropertyAndIndex.Property = FindField(InStruct, *PropertyName); + PropertyAndIndex.Property = FindFProperty(InStruct, *PropertyName); return PropertyAndIndex; } diff --git a/Engine/Source/Runtime/NavigationSystem/Private/NavAreas/NavAreaMeta_SwitchByAgent.cpp b/Engine/Source/Runtime/NavigationSystem/Private/NavAreas/NavAreaMeta_SwitchByAgent.cpp index 10b7519fc617..ef921719bd5b 100644 --- a/Engine/Source/Runtime/NavigationSystem/Private/NavAreas/NavAreaMeta_SwitchByAgent.cpp +++ b/Engine/Source/Runtime/NavigationSystem/Private/NavAreas/NavAreaMeta_SwitchByAgent.cpp @@ -73,7 +73,7 @@ void UNavAreaMeta_SwitchByAgent::UpdateAgentConfig() for (int32 i = 0; i < MaxAllowedAgents; i++) { const FString PropName = FString::Printf(TEXT("Agent%dArea"), i); - FProperty* Prop = FindField(UNavAreaMeta_SwitchByAgent::StaticClass(), *PropName); + FProperty* Prop = FindFProperty(UNavAreaMeta_SwitchByAgent::StaticClass(), *PropName); check(Prop); if (i < NumAgents && NumAgents > 1) diff --git a/Engine/Source/Runtime/NavigationSystem/Private/NavigationSystem.cpp b/Engine/Source/Runtime/NavigationSystem/Private/NavigationSystem.cpp index ca8975f9e240..dc0c68dda0d1 100644 --- a/Engine/Source/Runtime/NavigationSystem/Private/NavigationSystem.cpp +++ b/Engine/Source/Runtime/NavigationSystem/Private/NavigationSystem.cpp @@ -2512,8 +2512,8 @@ void UNavigationSystemV1::DescribeFilterFlags(const TArray& FlagsDesc) #endif // setup properties - FStructProperty* StructProp1 = FindField(UNavigationQueryFilter::StaticClass(), TEXT("IncludeFlags")); - FStructProperty* StructProp2 = FindField(UNavigationQueryFilter::StaticClass(), TEXT("ExcludeFlags")); + FStructProperty* StructProp1 = FindFProperty(UNavigationQueryFilter::StaticClass(), TEXT("IncludeFlags")); + FStructProperty* StructProp2 = FindFProperty(UNavigationQueryFilter::StaticClass(), TEXT("ExcludeFlags")); check(StructProp1); check(StructProp2); @@ -2525,7 +2525,7 @@ void UNavigationSystemV1::DescribeFilterFlags(const TArray& FlagsDesc) for (int32 FlagIndex = 0; FlagIndex < MaxFlags; FlagIndex++) { FString PropName = FString::Printf(TEXT("bNavFlag%d"), FlagIndex); - FProperty* Prop = FindField(Structs[StructIndex], *PropName); + FProperty* Prop = FindFProperty(Structs[StructIndex], *PropName); check(Prop); if (UseDesc[FlagIndex].Len()) diff --git a/Engine/Source/Runtime/PropertyPath/Private/PropertyPathHelpers.cpp b/Engine/Source/Runtime/PropertyPath/Private/PropertyPathHelpers.cpp index 6c76320a877f..484e694a032d 100644 --- a/Engine/Source/Runtime/PropertyPath/Private/PropertyPathHelpers.cpp +++ b/Engine/Source/Runtime/PropertyPath/Private/PropertyPathHelpers.cpp @@ -567,11 +567,7 @@ FFieldVariant FPropertyPathSegment::Resolve(UStruct* InStruct) const if ( InStruct != Struct ) { Struct = InStruct; - Field = FindField(InStruct, Name); - if (!Field.IsValid()) - { - Field = FindField(InStruct, Name); - } + Field = FindUFieldOrFProperty(InStruct, Name); } return Field; diff --git a/Engine/Source/Runtime/Serialization/Private/StructDeserializer.cpp b/Engine/Source/Runtime/Serialization/Private/StructDeserializer.cpp index fc69edf3bb37..2033f6f72aec 100644 --- a/Engine/Source/Runtime/Serialization/Private/StructDeserializer.cpp +++ b/Engine/Source/Runtime/Serialization/Private/StructDeserializer.cpp @@ -124,7 +124,7 @@ bool FStructDeserializer::Deserialize( void* OutStruct, UStruct& TypeInfo, IStru { FReadState NewState; - NewState.Property = FindField(CurrentState.TypeInfo, *PropertyName); + NewState.Property = FindFProperty(CurrentState.TypeInfo, *PropertyName); if (NewState.Property != nullptr) { @@ -247,7 +247,7 @@ bool FStructDeserializer::Deserialize( void* OutStruct, UStruct& TypeInfo, IStru else { // handle scalar property - FProperty* Property = FindField(CurrentState.TypeInfo, *PropertyName); + FProperty* Property = FindFProperty(CurrentState.TypeInfo, *PropertyName); if (Property != nullptr) { @@ -351,7 +351,7 @@ bool FStructDeserializer::Deserialize( void* OutStruct, UStruct& TypeInfo, IStru } else { - NewState.Property = FindField(CurrentState.TypeInfo, *PropertyName); + NewState.Property = FindFProperty(CurrentState.TypeInfo, *PropertyName); // unrecognized property if (NewState.Property == nullptr) diff --git a/Engine/Source/Runtime/UMG/Private/Animation/WidgetAnimationDelegateBinding.cpp b/Engine/Source/Runtime/UMG/Private/Animation/WidgetAnimationDelegateBinding.cpp index 7dfd7759be72..b2c0e1e12079 100644 --- a/Engine/Source/Runtime/UMG/Private/Animation/WidgetAnimationDelegateBinding.cpp +++ b/Engine/Source/Runtime/UMG/Private/Animation/WidgetAnimationDelegateBinding.cpp @@ -19,7 +19,7 @@ void UWidgetAnimationDelegateBinding::BindDynamicDelegates(UObject* InInstance) { const FBlueprintWidgetAnimationDelegateBinding& Binding = WidgetAnimationDelegateBindings[BindIndex]; - FObjectProperty* AnimationProp = FindField(InUserWidget->GetClass(), Binding.AnimationToBind); + FObjectProperty* AnimationProp = FindFProperty(InUserWidget->GetClass(), Binding.AnimationToBind); if (AnimationProp) { UWidgetAnimation* AnimationPropData = Cast(AnimationProp->GetObjectPropertyValue_InContainer(InUserWidget)); diff --git a/Engine/Source/Runtime/UMG/Private/Components/Widget.cpp b/Engine/Source/Runtime/UMG/Private/Components/Widget.cpp index 2c14d3bbc6cd..e6a1f02d9e15 100644 --- a/Engine/Source/Runtime/UMG/Private/Components/Widget.cpp +++ b/Engine/Source/Runtime/UMG/Private/Components/Widget.cpp @@ -1472,7 +1472,7 @@ FString UWidget::GetDefaultFontName() //bool UWidget::BindProperty(const FName& DestinationProperty, UObject* SourceObject, const FName& SourceProperty) //{ -// FDelegateProperty* DelegateProperty = FindField(GetClass(), FName(*( DestinationProperty.ToString() + TEXT("Delegate") ))); +// FDelegateProperty* DelegateProperty = FindFProperty(GetClass(), FName(*( DestinationProperty.ToString() + TEXT("Delegate") ))); // // if ( DelegateProperty ) // { diff --git a/Engine/Source/Runtime/UMG/Private/UserWidget.cpp b/Engine/Source/Runtime/UMG/Private/UserWidget.cpp index 7d3606e81a33..dd9f72195745 100644 --- a/Engine/Source/Runtime/UMG/Private/UserWidget.cpp +++ b/Engine/Source/Runtime/UMG/Private/UserWidget.cpp @@ -138,7 +138,7 @@ void UUserWidget::TemplateInitInner() FString VariableName = Widget->GetName(); // Find property with the same name as the template and assign the new widget to it. - FObjectPropertyBase* Prop = FindField(WidgetClass, *VariableName); + FObjectPropertyBase* Prop = FindFProperty(WidgetClass, *VariableName); if ( Prop ) { Prop->SetObjectPropertyValue_InContainer(this, Widget); @@ -263,7 +263,7 @@ bool UUserWidget::VerifyTemplateIntegrity(UUserWidget* TemplateRoot, TArrayGetFName(); // Find property with the same name as the template and assign the new widget to it. - FObjectPropertyBase* Prop = FindField(TemplateClass, VariableFName); + FObjectPropertyBase* Prop = FindFProperty(TemplateClass, VariableFName); if ( Prop ) { UObject* Value = Prop->GetObjectPropertyValue_InContainer(this); @@ -378,7 +378,7 @@ void UUserWidget::InitializeNamedSlots(bool bReparentToWidgetTree) { if ( UWidget* BindingContent = Binding.Content ) { - FObjectPropertyBase* NamedSlotProperty = FindField(GetClass(), Binding.Name); + FObjectPropertyBase* NamedSlotProperty = FindFProperty(GetClass(), Binding.Name); #if !WITH_EDITOR // In editor, renaming a NamedSlot widget will cause this ensure in UpdatePreviewWidget of widget that use that namedslot ensure(NamedSlotProperty); diff --git a/Engine/Source/Runtime/UMG/Private/WidgetBlueprintGeneratedClass.cpp b/Engine/Source/Runtime/UMG/Private/WidgetBlueprintGeneratedClass.cpp index 32a1ea98ee30..ada565a32677 100644 --- a/Engine/Source/Runtime/UMG/Private/WidgetBlueprintGeneratedClass.cpp +++ b/Engine/Source/Runtime/UMG/Private/WidgetBlueprintGeneratedClass.cpp @@ -140,7 +140,7 @@ void UWidgetBlueprintGeneratedClass::InitializeBindingsStatic(UUserWidget* UserW for (const FDelegateRuntimeBinding& Binding : InBindings) { // If the binding came from a parent class, this will still find it - FindField() searches the super class hierarchy by default. - FObjectProperty* WidgetProperty = FindField(UserWidget->GetClass(), *Binding.ObjectName); + FObjectProperty* WidgetProperty = FindFProperty(UserWidget->GetClass(), *Binding.ObjectName); if (WidgetProperty == nullptr) { continue; @@ -150,10 +150,10 @@ void UWidgetBlueprintGeneratedClass::InitializeBindingsStatic(UUserWidget* UserW if (Widget) { - FDelegateProperty* DelegateProperty = FindField(Widget->GetClass(), FName(*(Binding.PropertyName.ToString() + TEXT("Delegate")))); + FDelegateProperty* DelegateProperty = FindFProperty(Widget->GetClass(), FName(*(Binding.PropertyName.ToString() + TEXT("Delegate")))); if (!DelegateProperty) { - DelegateProperty = FindField(Widget->GetClass(), Binding.PropertyName); + DelegateProperty = FindFProperty(Widget->GetClass(), Binding.PropertyName); } if (DelegateProperty) @@ -297,7 +297,7 @@ void UWidgetBlueprintGeneratedClass::InitializeWidgetStatic(UUserWidget* UserWid FString VariableName = Widget->GetName(); // Find property with the same name as the template and assign the new widget to it. - FObjectPropertyBase* Prop = FindField(WidgetBlueprintClass, *VariableName); + FObjectPropertyBase* Prop = FindFProperty(WidgetBlueprintClass, *VariableName); if (Prop) { Prop->SetObjectPropertyValue_InContainer(UserWidget, Widget); @@ -335,7 +335,7 @@ void UWidgetBlueprintGeneratedClass::BindAnimations(UUserWidget* Instance, const if (Animation->GetMovieScene()) { // Find property with the same name as the animation and assign the animation to it. - FObjectPropertyBase* Prop = FindField(Instance->GetClass(), Animation->GetMovieScene()->GetFName()); + FObjectPropertyBase* Prop = FindFProperty(Instance->GetClass(), Animation->GetMovieScene()->GetFName()); if (Prop) { Prop->SetObjectPropertyValue_InContainer(Instance, Animation);