Skip to content

Commit

Permalink
new repo to remove git lfs
Browse files Browse the repository at this point in the history
  • Loading branch information
drichardson committed Aug 27, 2019
0 parents commit 545cb65
Show file tree
Hide file tree
Showing 762 changed files with 6,681 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.sln
.vs/
Binaries/
Build/
DerivedDataCache/
Intermediate/
Saved/
backup
3 changes: 3 additions & 0 deletions .gitmodules
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
18 changes: 18 additions & 0 deletions AddingAssetTypes/AddingAssetTypes.uproject
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.
11 changes: 11 additions & 0 deletions AddingAssetTypes/Config/DefaultEngine.ini
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


2 changes: 2 additions & 0 deletions AddingAssetTypes/Config/DefaultGame.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=7A02166A479E5DD01C92E1B18E530563
Binary file added AddingAssetTypes/Content/NewTextAsset.uasset
Binary file not shown.
Binary file added AddingAssetTypes/Content/Sample.uasset
Binary file not shown.
5 changes: 5 additions & 0 deletions AddingAssetTypes/README.md
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/).
14 changes: 14 additions & 0 deletions AddingAssetTypes/Source/AddingAssetTypes.Target.cs
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 AddingAssetTypes/Source/AddingAssetTypes/AddingAssetTypes.Build.cs
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 AddingAssetTypes/Source/AddingAssetTypes/AddingAssetTypes.cpp
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" );
6 changes: 6 additions & 0 deletions AddingAssetTypes/Source/AddingAssetTypes/AddingAssetTypes.h
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"

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"

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()

};
2 changes: 2 additions & 0 deletions AddingAssetTypes/Source/AddingAssetTypes/TextAsset.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "TextAsset.h"

16 changes: 16 additions & 0 deletions AddingAssetTypes/Source/AddingAssetTypes/TextAsset.h
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;
};

14 changes: 14 additions & 0 deletions AddingAssetTypes/Source/AddingAssetTypesEditor.Target.cs
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 AddingAssetTypes/Source/MyEditorModule/MyEditorModule.Build.cs
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
}
}
51 changes: 51 additions & 0 deletions AddingAssetTypes/Source/MyEditorModule/MyEditorModule.cpp
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);
6 changes: 6 additions & 0 deletions AddingAssetTypes/Source/MyEditorModule/MyEditorModule.h
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 AddingAssetTypes/Source/MyEditorModule/TextAssetActions.cpp
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;
}
22 changes: 22 additions & 0 deletions AddingAssetTypes/Source/MyEditorModule/TextAssetActions.h
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;
};
Loading

0 comments on commit 545cb65

Please sign in to comment.