forked from drichardson/UnrealEngineExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 545cb65
Showing
762 changed files
with
6,681 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.sln | ||
.vs/ | ||
Binaries/ | ||
Build/ | ||
DerivedDataCache/ | ||
Intermediate/ | ||
Saved/ | ||
backup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "HoudiniEngine/Plugins/HoudiniEngineForUnreal"] | ||
path = HoudiniEngine/Plugins/HoudiniEngineForUnreal | ||
url = https://github.com/drichardson/HoudiniEngineForUnreal.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"FileVersion": 3, | ||
"EngineAssociation": "4.22", | ||
"Category": "", | ||
"Description": "", | ||
"Modules": [ | ||
{ | ||
"Name": "AddingAssetTypes", | ||
"Type": "Runtime", | ||
"LoadingPhase": "Default" | ||
}, | ||
{ | ||
"Name": "MyEditorModule", | ||
"Type": "Runtime", | ||
"LoadingPhase": "Default" | ||
} | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[URL] | ||
[/Script/Engine.RendererSettings] | ||
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True | ||
|
||
[/Script/HardwareTargeting.HardwareTargetingSettings] | ||
TargetedHardwareClass=Desktop | ||
AppliedTargetedHardwareClass=Desktop | ||
DefaultGraphicsPerformance=Maximum | ||
AppliedDefaultGraphicsPerformance=Maximum | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[/Script/EngineSettings.GeneralProjectSettings] | ||
ProjectID=7A02166A479E5DD01C92E1B18E530563 |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Adding Asset Types | ||
Demonstrates how to add custom asset types to UE4 that are accessible from the Content | ||
Browser. This is simply following along to the | ||
[Adding New Asset Types to UE4](https://gmpreussner.com/reference/adding-new-asset-types-to-ue4) | ||
article by [Gerke Max Preussner](https://gmpreussner.com/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
using UnrealBuildTool; | ||
using System.Collections.Generic; | ||
|
||
public class AddingAssetTypesTarget : TargetRules | ||
{ | ||
public AddingAssetTypesTarget(TargetInfo Target) : base(Target) | ||
{ | ||
Type = TargetType.Game; | ||
|
||
ExtraModuleNames.AddRange( new string[] { "AddingAssetTypes" } ); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
AddingAssetTypes/Source/AddingAssetTypes/AddingAssetTypes.Build.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
using UnrealBuildTool; | ||
|
||
public class AddingAssetTypes : ModuleRules | ||
{ | ||
public AddingAssetTypes(ReadOnlyTargetRules Target) : base(Target) | ||
{ | ||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; | ||
|
||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); | ||
|
||
PrivateDependencyModuleNames.AddRange(new string[] { }); | ||
|
||
// Uncomment if you are using Slate UI | ||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); | ||
|
||
// Uncomment if you are using online features | ||
// PrivateDependencyModuleNames.Add("OnlineSubsystem"); | ||
|
||
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
AddingAssetTypes/Source/AddingAssetTypes/AddingAssetTypes.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
#include "AddingAssetTypes.h" | ||
#include "Modules/ModuleManager.h" | ||
|
||
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, AddingAssetTypes, "AddingAssetTypes" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
|
5 changes: 5 additions & 0 deletions
5
AddingAssetTypes/Source/AddingAssetTypes/AddingAssetTypesGameModeBase.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
|
||
#include "AddingAssetTypesGameModeBase.h" | ||
|
17 changes: 17 additions & 0 deletions
17
AddingAssetTypes/Source/AddingAssetTypes/AddingAssetTypesGameModeBase.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
#include "GameFramework/GameModeBase.h" | ||
#include "AddingAssetTypesGameModeBase.generated.h" | ||
|
||
/** | ||
* | ||
*/ | ||
UCLASS() | ||
class ADDINGASSETTYPES_API AAddingAssetTypesGameModeBase : public AGameModeBase | ||
{ | ||
GENERATED_BODY() | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "TextAsset.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
|
||
#include "TextAsset.generated.h" | ||
|
||
UCLASS() | ||
class ADDINGASSETTYPES_API UTextAsset : public UObject | ||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
UPROPERTY(EditAnywhere, Category = "TextAsset") | ||
FText Text; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
using UnrealBuildTool; | ||
using System.Collections.Generic; | ||
|
||
public class AddingAssetTypesEditorTarget : TargetRules | ||
{ | ||
public AddingAssetTypesEditorTarget(TargetInfo Target) : base(Target) | ||
{ | ||
Type = TargetType.Editor; | ||
|
||
ExtraModuleNames.AddRange( new string[] { "AddingAssetTypes", "MyEditorModule" } ); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
AddingAssetTypes/Source/MyEditorModule/MyEditorModule.Build.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
using UnrealBuildTool; | ||
|
||
public class MyEditorModule : ModuleRules | ||
{ | ||
public MyEditorModule(ReadOnlyTargetRules Target) : base(Target) | ||
{ | ||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; | ||
|
||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); | ||
|
||
PrivateDependencyModuleNames.AddRange(new string[] { "AddingAssetTypes", "UnrealEd", "Slate", "SlateCore" }); | ||
|
||
// Uncomment if you are using Slate UI | ||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); | ||
|
||
// Uncomment if you are using online features | ||
// PrivateDependencyModuleNames.Add("OnlineSubsystem"); | ||
|
||
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
#include "MyEditorModule.h" | ||
|
||
#include "Modules/ModuleManager.h" | ||
#include "Styling/SlateStyle.h" | ||
#include "TextAssetActions.h" | ||
|
||
class MyEditorModule : public IModuleInterface | ||
{ | ||
TSharedPtr<ISlateStyle> Style; | ||
TArray<TSharedRef<IAssetTypeActions>> RegisteredAssetTypeActions; | ||
|
||
void StartupModule() override | ||
{ | ||
Style = MakeShareable(new FSlateStyleSet("MyModuleStyle")); | ||
RegisterAssetTools(); | ||
} | ||
|
||
void ShutdownModule() override | ||
{ | ||
UnregisterAssetTools(); | ||
} | ||
|
||
void RegisterAssetTools() | ||
{ | ||
IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get(); | ||
TSharedRef<IAssetTypeActions> Action = MakeShareable(new FTextAssetActions(Style.ToSharedRef())); | ||
AssetTools.RegisterAssetTypeActions(Action); | ||
RegisteredAssetTypeActions.Add(Action); | ||
} | ||
|
||
void UnregisterAssetTools() | ||
{ | ||
FAssetToolsModule* AssetToolsModule = FModuleManager::GetModulePtr<FAssetToolsModule>("AssetTools"); | ||
|
||
if (AssetToolsModule) | ||
{ | ||
IAssetTools& AssetTools = AssetToolsModule->Get(); | ||
|
||
for (auto Action : RegisteredAssetTypeActions) | ||
{ | ||
AssetTools.UnregisterAssetTypeActions(Action); | ||
} | ||
|
||
RegisteredAssetTypeActions.Empty(); | ||
} | ||
} | ||
}; | ||
|
||
IMPLEMENT_GAME_MODULE(MyEditorModule, MyEditorModule); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
|
85 changes: 85 additions & 0 deletions
85
AddingAssetTypes/Source/MyEditorModule/TextAssetActions.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#include "TextAssetActions.h" | ||
|
||
#include "MultiBox/MultiBoxBuilder.h" | ||
#include "TextAsset.h" | ||
|
||
#define LOCTEXT_NAMESPACE "AssetTypeActions" | ||
|
||
FTextAssetActions::FTextAssetActions(const TSharedRef<ISlateStyle>& InStyle) | ||
: Style(InStyle) | ||
{ | ||
} | ||
|
||
bool FTextAssetActions::CanFilter() | ||
{ | ||
return true; | ||
} | ||
|
||
static bool CanReverseActionExecute(TWeakObjectPtr<UTextAsset> TextAsset) | ||
{ | ||
return TextAsset.IsValid() && !TextAsset->Text.IsEmpty(); | ||
} | ||
|
||
void FTextAssetActions::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder) | ||
{ | ||
FAssetTypeActions_Base::GetActions(InObjects, MenuBuilder); | ||
|
||
auto TextAssets = GetTypedWeakObjectPtrs<UTextAsset>(InObjects); | ||
|
||
FUIAction Action( | ||
FExecuteAction::CreateLambda([TextAssets] { | ||
for (auto TextAsset : TextAssets) | ||
{ | ||
if (CanReverseActionExecute(TextAsset)) | ||
{ | ||
TextAsset->Text = FText::FromString(TextAsset->Text.ToString().Reverse()); | ||
TextAsset->PostEditChange(); | ||
TextAsset->MarkPackageDirty(); | ||
} | ||
} | ||
}), | ||
FCanExecuteAction::CreateLambda([TextAssets] { | ||
for (auto TextAsset : TextAssets) | ||
{ | ||
if (CanReverseActionExecute(TextAsset)) | ||
{ | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
}) | ||
); | ||
|
||
MenuBuilder.AddMenuEntry( | ||
LOCTEXT("TextAsset_ReverseText", "Reverse Text"), | ||
LOCTEXT("TextAsset_ReverseTextToolTip", "Reverse the text stored in the selected text asset(s)."), | ||
FSlateIcon(), | ||
Action); | ||
|
||
} | ||
|
||
uint32 FTextAssetActions::GetCategories() | ||
{ | ||
return EAssetTypeCategories::Misc; | ||
} | ||
|
||
FText FTextAssetActions::GetName() const | ||
{ | ||
return LOCTEXT("AssetTypeActions_TextAsset", "Text Asset"); | ||
} | ||
|
||
UClass* FTextAssetActions::GetSupportedClass() const | ||
{ | ||
return UTextAsset::StaticClass(); | ||
} | ||
|
||
FColor FTextAssetActions::GetTypeColor() const | ||
{ | ||
return FColor::White; | ||
} | ||
|
||
bool FTextAssetActions::HasActions(const TArray<UObject*>& InObjects) const | ||
{ | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "AssetTypeActions_Base.h" | ||
|
||
class FTextAssetActions : public FAssetTypeActions_Base | ||
{ | ||
public: | ||
|
||
FTextAssetActions(const TSharedRef<ISlateStyle>& InStyle); | ||
|
||
private: | ||
|
||
bool CanFilter() override; | ||
void GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder) override; | ||
uint32 GetCategories() override; | ||
FText GetName() const override; | ||
UClass* GetSupportedClass() const override; | ||
FColor GetTypeColor() const override; | ||
bool HasActions(const TArray<UObject*>& InObjects) const override; | ||
|
||
TSharedRef<class ISlateStyle> Style; | ||
}; |
Oops, something went wrong.