diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/BlueprintNativeCodeGen.Build.cs b/Engine/Source/Developer/BlueprintNativeCodeGen/BlueprintNativeCodeGen.Build.cs new file mode 100644 index 000000000000..306285b3e0e4 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/BlueprintNativeCodeGen.Build.cs @@ -0,0 +1,36 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; + +public class BlueprintNativeCodeGen : ModuleRules +{ + public BlueprintNativeCodeGen(TargetInfo Target) + { + PrivateIncludePaths.Add("BlueprintNativeCodeGen/Private"); + + PublicDependencyModuleNames.AddRange( + new string[] { + "Core", + "CoreUObject", + "Engine", + } + ); + + PrivateDependencyModuleNames.AddRange( + new string[] { + "DesktopPlatform", + "UnrealEd", + "InputCore", + "SlateCore", + "Slate", + "EditorStyle" + } + ); + + DynamicallyLoadedModuleNames.AddRange( + new string[] { + "AssetRegistry", + } + ); + } +} diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenCoordinator.cpp b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenCoordinator.cpp new file mode 100644 index 000000000000..4f22359a2a45 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenCoordinator.cpp @@ -0,0 +1,321 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#include "BlueprintNativeCodeGenPCH.h" +#include "BlueprintNativeCodeGenCoordinator.h" +#include "NativeCodeGenCommandlineParams.h" +#include "Engine/Blueprint.h" +#include "Engine/UserDefinedStruct.h" +#include "Engine/UserDefinedEnum.h" +#include "ARFilter.h" +#include "PackageName.h" +#include "FileManager.h" +#include "AssetRegistryModule.h" + +/******************************************************************************* + * UBlueprintNativeCodeGenConfig +*******************************************************************************/ + +//------------------------------------------------------------------------------ +UBlueprintNativeCodeGenConfig::UBlueprintNativeCodeGenConfig(FObjectInitializer const& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +/******************************************************************************* + * BlueprintNativeCodeGenCoordinatorImpl declaration +*******************************************************************************/ + +namespace BlueprintNativeCodeGenCoordinatorImpl +{ + static const UClass* TargetAssetTypes[] = { + UBlueprint::StaticClass(), + UUserDefinedStruct::StaticClass(), + UUserDefinedEnum::StaticClass(), + }; + + static const int32 IncompatibleBlueprintTypeMask = (1 << BPTYPE_LevelScript) | + (1 << BPTYPE_MacroLibrary) | (1 << BPTYPE_Const); + + static const FName BlueprintTypePropertyName("BlueprintType"); + static const FName ParentClassTagName("ParentClassPackage"); + static const FName AssetInterfacesTagName("ImplementedInterfaces"); + + /** */ + static IAssetRegistry& GetAssetRegistry(); + + /** */ + static void GatherAssetsToConvert(TArray& ConversionQueueOut); + + /** */ + static void GatherParentAssets(const FAssetData& TargetAsset, TArray& AssetsOut); + + /** */ + static void GatherInterfaceAssets(const FAssetData& TargetAsset, TArray& AssetsOut); +} + +/******************************************************************************* + * FScopedAssetCollector +*******************************************************************************/ + +/** */ +struct FScopedAssetCollector +{ +public: + FScopedAssetCollector(const FARFilter& SharedFilter, const UClass* AssetType, TArray& AssetsOut) + : TargetType(AssetType) + { + if (FScopedAssetCollector** SpecializedCollector = SpecializedAssetCollectors.Find(TargetType)) + { + (*SpecializedCollector)->GatherAssets(SharedFilter, AssetsOut); + } + else + { + GatherAssets(SharedFilter, AssetsOut); + } + } + +protected: + FScopedAssetCollector(const UClass* AssetType) : TargetType(AssetType) {} + + /** + * + * + * @param SharedFilter + * @param AssetsOut + */ + virtual void GatherAssets(const FARFilter& SharedFilter, TArray& AssetsOut) const; + + const UClass* TargetType; + static TMap SpecializedAssetCollectors; +}; +TMap FScopedAssetCollector::SpecializedAssetCollectors; + +//------------------------------------------------------------------------------ +void FScopedAssetCollector::GatherAssets(const FARFilter& SharedFilter, TArray& AssetsOut) const +{ + IAssetRegistry& AssetRegistry = BlueprintNativeCodeGenCoordinatorImpl::GetAssetRegistry(); + + FARFilter ClassFilter; + ClassFilter.Append(SharedFilter); + ClassFilter.ClassNames.Add(TargetType->GetFName()); + + if (ClassFilter.PackagePaths.Num() > 0) + { + // we want the union of specified package names and paths, not the + // intersection (how GetAssets() is set up to work), so here we query + // for both separately + ClassFilter.PackageNames.Empty(); + AssetRegistry.GetAssets(ClassFilter, AssetsOut); + + if (SharedFilter.PackageNames.Num() > 0) + { + ClassFilter.PackageNames = SharedFilter.PackageNames; + ClassFilter.PackageNames.Empty(); + AssetRegistry.GetAssets(ClassFilter, AssetsOut); + } + } + else + { + AssetRegistry.GetAssets(ClassFilter, AssetsOut); + } +} + +/******************************************************************************* + * FSpecializedAssetCollector<> +*******************************************************************************/ + +template +struct FSpecializedAssetCollector : public FScopedAssetCollector +{ +public: + FSpecializedAssetCollector() : FScopedAssetCollector(AssetType::StaticClass()) + { + SpecializedAssetCollectors.Add(AssetType::StaticClass(), this); + } + + ~FSpecializedAssetCollector() + { + SpecializedAssetCollectors.Remove(AssetType::StaticClass()); + } + + // FScopedAssetCollector interface + virtual void GatherAssets(const FARFilter& SharedFilter, TArray& AssetsOut) const override; + // End FScopedAssetCollector interface +}; + +//------------------------------------------------------------------------------ +template<> +void FSpecializedAssetCollector::GatherAssets(const FARFilter& SharedFilter, TArray& AssetsOut) const +{ + FARFilter BlueprintFilter; + BlueprintFilter.Append(SharedFilter); + + if (UByteProperty* TypeProperty = FindField(TargetType, BlueprintNativeCodeGenCoordinatorImpl::BlueprintTypePropertyName)) + { + ensure(TypeProperty->HasAnyPropertyFlags(CPF_AssetRegistrySearchable)); + + UEnum* TypeEnum = TypeProperty->Enum; + if (ensure(TypeEnum != nullptr)) + { + for (int32 BlueprintType = 0; BlueprintType < TypeEnum->GetMaxEnumValue(); ++BlueprintType) + { + if (!TypeEnum->IsValidEnumValue(BlueprintType)) + { + continue; + } + + // explicitly ignore unsupported Blueprint conversion types + if ((BlueprintNativeCodeGenCoordinatorImpl::IncompatibleBlueprintTypeMask & (1 << BlueprintType)) != 0) + { + continue; + } + BlueprintFilter.TagsAndValues.Add(TypeProperty->GetFName(), TypeEnum->GetEnumName(BlueprintType)); + } + } + } + + const int32 StartingIndex = AssetsOut.Num(); + FScopedAssetCollector::GatherAssets(BlueprintFilter, AssetsOut); + const int32 EndingIndex = AssetsOut.Num(); + + // have to ensure that we convert the entire inheritance chain + for (int32 BlueprintIndex = StartingIndex; BlueprintIndex < EndingIndex; ++BlueprintIndex) + { + BlueprintNativeCodeGenCoordinatorImpl::GatherParentAssets(AssetsOut[BlueprintIndex], AssetsOut); + BlueprintNativeCodeGenCoordinatorImpl::GatherInterfaceAssets(AssetsOut[BlueprintIndex], AssetsOut); + // @TODO: Collect UserDefinedStructs (maybe enums?)... maybe put off till later, once the BP is loaded? + } +} + +/******************************************************************************* + * BlueprintNativeCodeGenCoordinatorImpl definition +*******************************************************************************/ + +//------------------------------------------------------------------------------ +static IAssetRegistry& BlueprintNativeCodeGenCoordinatorImpl::GetAssetRegistry() +{ + FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked(TEXT("AssetRegistry")); + return AssetRegistryModule.Get(); +} + +//------------------------------------------------------------------------------ +static void BlueprintNativeCodeGenCoordinatorImpl::GatherAssetsToConvert(TArray& ConversionQueueOut) +{ + IAssetRegistry& AssetRegistry = GetAssetRegistry(); + // have to make sure that the asset registry is fully populated + AssetRegistry.SearchAllAssets(/*bSynchronousSearch =*/true); + + FARFilter AssetFilter; + AssetFilter.bRecursivePaths = true; + + const UBlueprintNativeCodeGenConfig* ConfigSettings = GetDefault(); + IFileManager& FileManager = IFileManager::Get(); + + for (const FString& PackagePath : ConfigSettings->PackagesToAlwaysConvert) + { + const FString RelativePath = FPackageName::LongPackageNameToFilename(PackagePath); + if (FileManager.DirectoryExists(*RelativePath)) + { + AssetFilter.PackagePaths.Add(*PackagePath); + } + else + { + AssetFilter.PackageNames.Add(*PackagePath); + } + } + + // will be utilized if UBlueprint is an entry in TargetAssetTypes (auto registers + FSpecializedAssetCollector BlueprintAssetCollector; + + const int32 TargetClassCount = sizeof(TargetAssetTypes) / sizeof(TargetAssetTypes[0]); + for (int32 ClassIndex = 0; ClassIndex < TargetClassCount; ++ClassIndex) + { + const UClass* TargetClass = TargetAssetTypes[ClassIndex]; + FScopedAssetCollector AssetCollector(AssetFilter, TargetClass, ConversionQueueOut); + } +} + +//------------------------------------------------------------------------------ +static void BlueprintNativeCodeGenCoordinatorImpl::GatherParentAssets(const FAssetData& TargetAsset, TArray& AssetsOut) +{ + IAssetRegistry& AssetRegistry = GetAssetRegistry(); + + if (const FString* ParentClassPkg = TargetAsset.TagsAndValues.Find(ParentClassTagName)) + { + TArray ParentPackages; + AssetRegistry.GetAssetsByPackageName(**ParentClassPkg, ParentPackages); + + // should either be 0 (when the parent is a native class), or 1 (the parent is another asset) + ensure(ParentPackages.Num() <= 1); + + for (const FAssetData& ParentData : ParentPackages) + { + AssetsOut.AddUnique(ParentData); // keeps us from converting parents that were already flagged for conversion + GatherParentAssets(ParentData, AssetsOut); + GatherInterfaceAssets(ParentData, AssetsOut); + } + } +} + +//------------------------------------------------------------------------------ +static void BlueprintNativeCodeGenCoordinatorImpl::GatherInterfaceAssets(const FAssetData& TargetAsset, TArray& AssetsOut) +{ + IAssetRegistry& AssetRegistry = GetAssetRegistry(); + + if (const FString* InterfacesListPtr = TargetAsset.TagsAndValues.Find(AssetInterfacesTagName)) + { + static const FString InterfaceClassLabel(TEXT("(Interface=")); + static const FString BlueprintClassName = UBlueprintGeneratedClass::StaticClass()->GetName(); + static const FString ClassPathDelimiter = TEXT("'"); + static const FString PackageDelimiter = TEXT("."); + + FString InterfacesList = *InterfacesListPtr; + do + { + const int32 SearchIndex = InterfacesList.Find(InterfaceClassLabel); + if (SearchIndex != INDEX_NONE) + { + int32 InterfaceClassIndex = SearchIndex + InterfaceClassLabel.Len(); + InterfacesList = InterfacesList.Mid(InterfaceClassIndex); + + if (InterfacesList.StartsWith(BlueprintClassName)) + { + InterfaceClassIndex = BlueprintClassName.Len(); + + const int32 ClassEndIndex = InterfacesList.Find(ClassPathDelimiter, ESearchCase::IgnoreCase, ESearchDir::FromStart, InterfaceClassIndex+1); + const FString ClassPath = InterfacesList.Mid(InterfaceClassIndex+1, ClassEndIndex - InterfaceClassIndex); + + FString ClassPackagePath, ClassName; + if (ClassPath.Split(PackageDelimiter, &ClassPackagePath, &ClassName)) + { + TArray InterfacePackages; + AssetRegistry.GetAssetsByPackageName(*ClassPackagePath, InterfacePackages); + + // should find a single asset (since we know this is for a Blueprint generated class) + ensure(InterfacePackages.Num() == 1); + + for (const FAssetData& Interface : InterfacePackages) + { + // AddUnique() keeps us from converting interfaces that were already flagged for conversion + AssetsOut.AddUnique(Interface); + } + } + } + } + else + { + break; + } + } while (!InterfacesList.IsEmpty()); + } +} + +/******************************************************************************* + * FBlueprintNativeCodeGenCoordinator +*******************************************************************************/ + +//------------------------------------------------------------------------------ +FBlueprintNativeCodeGenCoordinator::FBlueprintNativeCodeGenCoordinator(const FNativeCodeGenCommandlineParams& CommandlineParams) +{ + BlueprintNativeCodeGenCoordinatorImpl::GatherAssetsToConvert(ConversionQueue); +} diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenCoordinator.h b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenCoordinator.h new file mode 100644 index 000000000000..a994aadeb0b8 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenCoordinator.h @@ -0,0 +1,32 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "AssetData.h" +#include "BlueprintNativeCodeGenManifest.h" +#include "BlueprintNativeCodeGenCoordinator.generated.h" + +// Forward declarations +struct FNativeCodeGenCommandlineParams; + +UCLASS(config=Editor) +class UBlueprintNativeCodeGenConfig : public UObject +{ + GENERATED_UCLASS_BODY() + +public: + UPROPERTY(globalconfig) + TArray PackagesToAlwaysConvert; +}; + +/** */ +struct FBlueprintNativeCodeGenCoordinator +{ +public: + FBlueprintNativeCodeGenCoordinator(const FNativeCodeGenCommandlineParams& CommandlineParams); + +public: + TArray ConversionQueue; + FBlueprintNativeCodeGenManifest Manifest; +}; + diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenManifest.cpp b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenManifest.cpp new file mode 100644 index 000000000000..ec98787421d6 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenManifest.cpp @@ -0,0 +1,5 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#include "BlueprintNativeCodeGenPCH.h" +#include "BlueprintNativeCodeGenManifest.h" + diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenManifest.h b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenManifest.h new file mode 100644 index 000000000000..96b9402ac2a2 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenManifest.h @@ -0,0 +1,19 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#pragma once + +/** */ +struct FBlueprintNativeCodeGenManifest +{ +public: + struct FAssetEntry + { + UClass* AssetType; + FString AssetPath; + FString GeneratedFilePath; + }; + +private: + TArray Manifest; +}; + diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenPCH.h b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenPCH.h new file mode 100644 index 000000000000..f27c4e96aeaf --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/BlueprintNativeCodeGenPCH.h @@ -0,0 +1,5 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine.h" diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/GenerateBlueprintCodeModuleCommandlet.cpp b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/GenerateBlueprintCodeModuleCommandlet.cpp new file mode 100644 index 000000000000..782d1cf0d199 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/GenerateBlueprintCodeModuleCommandlet.cpp @@ -0,0 +1,47 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#include "BlueprintNativeCodeGenPCH.h" +#include "GenerateBlueprintCodeModuleCommandlet.h" +#include "NativeCodeGenCommandlineParams.h" +#include "BlueprintNativeCodeGenCoordinator.h" + +DEFINE_LOG_CATEGORY_STATIC(LogBlueprintCodeGen, Log, All); + +/******************************************************************************* + * GenerateBlueprintCodeModuleImpl +*******************************************************************************/ + +namespace GenerateBlueprintCodeModuleImpl +{ + +} + +/******************************************************************************* + * UGenerateBlueprintCodeModuleCommandlet +*******************************************************************************/ + +//------------------------------------------------------------------------------ +UGenerateBlueprintCodeModuleCommandlet::UGenerateBlueprintCodeModuleCommandlet(FObjectInitializer const& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +//------------------------------------------------------------------------------ +int32 UGenerateBlueprintCodeModuleCommandlet::Main(FString const& Params) +{ + TArray Tokens, Switches; + ParseCommandLine(*Params, Tokens, Switches); + + FNativeCodeGenCommandlineParams CommandlineParams(Switches); + + if (CommandlineParams.bHelpRequested) + { + UE_LOG(LogBlueprintCodeGen, Display, TEXT("%s"), *FNativeCodeGenCommandlineParams::HelpMessage); + return 0; + } + + FBlueprintNativeCodeGenCoordinator Coordinator(CommandlineParams); + + return 0; +} + diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/GenerateBlueprintCodeModuleCommandlet.h b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/GenerateBlueprintCodeModuleCommandlet.h new file mode 100644 index 000000000000..68c2afaa5416 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/GenerateBlueprintCodeModuleCommandlet.h @@ -0,0 +1,18 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Commandlets/Commandlet.h" +#include "GenerateBlueprintCodeModuleCommandlet.generated.h" + +/** */ +UCLASS() +class UGenerateBlueprintCodeModuleCommandlet : public UCommandlet +{ + GENERATED_UCLASS_BODY() + +public: + // Begin UCommandlet Interface + virtual int32 Main(FString const& Params) override; + // End UCommandlet Interface +}; diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenCommandlineParams.cpp b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenCommandlineParams.cpp new file mode 100644 index 000000000000..8c19ad642c65 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenCommandlineParams.cpp @@ -0,0 +1,72 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#include "BlueprintNativeCodeGenPCH.h" +#include "NativeCodeGenCommandlineParams.h" + +DEFINE_LOG_CATEGORY_STATIC(LogNativeCodeGenCommand, Log, All); + +/** */ +const FString FNativeCodeGenCommandlineParams::HelpMessage = TEXT("\n\ +\n\ +-------------------------------------------------------------------------------\n\ + GenerateBlueprintCodeModule :: Converts Blueprint assets into C++ \n\ +-------------------------------------------------------------------------------\n\ +\n\ +:: \n\ +:: Usage \n\ +:: \n\ +\n\ + UE4Editor.exe -run=GenerateBlueprintCodeModule [parameters] \n\ +\n\ +:: \n\ +:: Switches \n\ +:: \n\ +\n\ + -whitelist=<> \n\ + \n\ +\n\ + -blacklist=<> \n\ + \n\ +\n\ + -output=<> \n\ + \n\ +\n\ + -help, -h, -? Display this message and then exit. \n\ +\n"); + +/******************************************************************************* + * NativeCodeGenCommandlineParamsImpl + ******************************************************************************/ + +namespace NativeCodeGenCommandlineParamsImpl +{ + +} + +/******************************************************************************* + * FNativeCodeGenCommandlineParams + ******************************************************************************/ + +//------------------------------------------------------------------------------ +FNativeCodeGenCommandlineParams::FNativeCodeGenCommandlineParams(const TArray& CommandlineSwitches) + : bHelpRequested(false) +{ + for (const FString& Param : CommandlineSwitches) + { + FString Switch = Param, Value; + Param.Split(TEXT("="), &Switch, &Value); + + if (!Switch.Compare(TEXT("h"), ESearchCase::IgnoreCase) || + !Switch.Compare(TEXT("?"), ESearchCase::IgnoreCase) || + !Switch.Compare(TEXT("help"), ESearchCase::IgnoreCase)) + { + bHelpRequested = true; + } + else + { + //UE_LOG(LogNativeCodeGenCommand, Warning, TEXT("Unrecognized commandline parameter: %s"), *Switch); + } + } +} + diff --git a/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenCommandlineParams.h b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenCommandlineParams.h new file mode 100644 index 000000000000..be3c9164dc87 --- /dev/null +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenCommandlineParams.h @@ -0,0 +1,20 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#pragma once + +/** */ +struct FNativeCodeGenCommandlineParams +{ +public: + static const FString HelpMessage; + +public: + FNativeCodeGenCommandlineParams(const TArray& CommandlineSwitches); + +public: + bool bHelpRequested : 1; + TArray WhiteListedAssetPaths; + TArray BlackListedAssetPaths; + FString ModuleOutputDir; +}; + diff --git a/Engine/Source/Editor/Kismet/Private/NativeCodeGenerationTool.cpp b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenerationTool.cpp similarity index 99% rename from Engine/Source/Editor/Kismet/Private/NativeCodeGenerationTool.cpp rename to Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenerationTool.cpp index 760f97eeb4f3..de19e0e32702 100644 --- a/Engine/Source/Editor/Kismet/Private/NativeCodeGenerationTool.cpp +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Private/NativeCodeGenerationTool.cpp @@ -1,13 +1,13 @@ // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. -#include "BlueprintEditorPrivatePCH.h" +#include "BlueprintNativeCodeGenPCH.h" #include "NativeCodeGenerationTool.h" #include "Dialogs.h" #include "Engine/BlueprintGeneratedClass.h" #include "Engine/UserDefinedEnum.h" #include "Engine/UserDefinedStruct.h" #include "SourceCodeNavigation.h" -#include "DesktopPlatformModule.h" +#include "DesktopPlatformModule.h" // for InvalidateMakefiles() //#include "Editor/KismetCompiler/Public/BlueprintCompilerCppBackendInterface.h" #define LOCTEXT_NAMESPACE "NativeCodeGenerationTool" diff --git a/Engine/Source/Editor/Kismet/Private/NativeCodeGenerationTool.h b/Engine/Source/Developer/BlueprintNativeCodeGen/Public/NativeCodeGenerationTool.h similarity index 56% rename from Engine/Source/Editor/Kismet/Private/NativeCodeGenerationTool.h rename to Engine/Source/Developer/BlueprintNativeCodeGen/Public/NativeCodeGenerationTool.h index c12c9752645e..a772af9d1ca0 100644 --- a/Engine/Source/Editor/Kismet/Private/NativeCodeGenerationTool.h +++ b/Engine/Source/Developer/BlueprintNativeCodeGen/Public/NativeCodeGenerationTool.h @@ -9,7 +9,6 @@ struct FNativeCodeGenerationTool { - static void Open(UBlueprint& Object, TSharedRef< class FBlueprintEditor> Editor); - - static bool CanGenerate(const UBlueprint& Object); + BLUEPRINTNATIVECODEGEN_API static void Open(UBlueprint& Object, TSharedRef< class FBlueprintEditor> Editor); + BLUEPRINTNATIVECODEGEN_API static bool CanGenerate(const UBlueprint& Object); }; \ No newline at end of file diff --git a/Engine/Source/Editor/Kismet/Kismet.Build.cs b/Engine/Source/Editor/Kismet/Kismet.Build.cs index a9e2c4791524..c8fa121cadc0 100644 --- a/Engine/Source/Editor/Kismet/Kismet.Build.cs +++ b/Engine/Source/Editor/Kismet/Kismet.Build.cs @@ -47,6 +47,7 @@ public class Kismet : ModuleRules "DerivedDataCache", "DesktopPlatform", "HotReload", + "BlueprintNativeCodeGen" } );