# Locate Module Resource Path

**URL:** <https://forums.unrealengine.com/t/locate-module-resource-path/359992>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 7, 2016, 7:31pm UTC](https://forums.unrealengine.com/t/locate-module-resource-path/359992 "2016-06-07T19:31:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [June 7, 2016, 7:31pm UTC](https://forums.unrealengine.com/t/locate-module-resource-path/359992/1 "2016-06-07T19:31:28Z")

</div>

Is there away to get the module path?

I’ve modeled my module after the plugin template that provides a toolbar button. Unforunately I’m having trouble loading the image file located in the Resources directory:

```
TSharedRef< FSlateStyleSet > FMyStyle::Create()
{
    TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("MyStyle"));

    //Style->SetContentRoot(IPluginManager::Get().FindPlugin("MyPlugin")->GetBaseDir() / TEXT("Resources"));
    Style->SetContentRoot(TEXT("../Resources"));

    Style->Set("MyModule.MyAction", new IMAGE_BRUSH(TEXT("ButtonIcon_40x"), Icon40x40));

    return Style;
}

```

Any help is appreciated.

Thank you.

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [June 7, 2016, 9:23pm UTC](https://forums.unrealengine.com/t/locate-module-resource-path/359992/2 "2016-06-07T21:23:06Z")

</div>

Use the Content Directory of your Plugin Instead. You can get it with

```
FString ContentDir = IPluginManager::Get().FindPlugin(TEXT("MyPlugin"))->GetContentDir();

```

Make sure you also have “CanContainContent” : true in your MyPlugin.uplugin

Besides that look into Paper2D Plugin it is easy to understand and you can see good exaples there.

Good Luck and have Fun =)

---

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [June 7, 2016, 9:35pm UTC](https://forums.unrealengine.com/t/locate-module-resource-path/359992/3 "2016-06-07T21:35:27Z")

</div>

Thank you Nachtmahr. I’m using a Gameplay / Editor Module, which may be different from the plugin structure:

> **[Gameplay Modules](https://docs.unrealengine.com/5.2/en-US/gameplay-modules-in-unreal-engine/)**
>
> Collections of gameplay classes belonging to a game project compiled into DLLs.

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [June 7, 2016, 10:01pm UTC](https://forums.unrealengine.com/t/locate-module-resource-path/359992/4 "2016-06-07T22:01:44Z")

</div>

Oh ok I See. If its a Game Module why you dont load directly from the Game Content folder instead? Here is a Wiki entry I came across who does it in case its a Option for you?

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Otherwise I´m not sure where the Ressource Dir is in a Game Module (never create a seperate Game Module, sry ^^)

---

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [June 8, 2016, 1:14pm UTC](https://forums.unrealengine.com/t/locate-module-resource-path/359992/5 "2016-06-08T13:14:40Z")

</div>

That looks like a really nice tutorial Nachtmahr 🙂

I’ll look that over a little later today and see if it solves my problem. It certainly looks very similar to what I’m doing, except it may not utilize resources such as images (I could be wrong just took a quick glance at it).

Thanks.
