# Easy2Sfx Importer (Unreal Engine plugin)

Editor plugin that imports a **session folder** from disk into your Unreal project while the editor is open:

- **Destination:** `Content/Easy2Sfx/<session folder name>/`
- **Names:** Imported assets keep the **same base names** as the files on disk (Unreal’s usual import rules apply).
- **Formats:** Tries common audio extensions: `.wav`, `.mp3`, `.ogg`, `.flac`, `.aif`, `.aiff`, `.m4a`, `.wma` (whatever your engine build’s factories support).

The **session folder name** is the **last folder** you pick in the file dialog (e.g. picking `D:\Exports\MySession` creates `Content/Easy2Sfx/MySession/`).

---

## Requirements

- **Unreal Engine 5.x** (tested against typical 5.3+ API; if a property name fails to compile on your exact version, see “Troubleshooting” below).
- A **C++ project** (or a project that already uses C++ so the plugin can compile).

---

## Install

**Folder layout (required):** Unreal expects this exact structure under `Plugins` (folder name can differ, but `Source` must match):

```
Plugins/
  YourPluginFolderName/          e.g. Easy2SfxImporter or Easy2SfxUnrealPlugin
    Easy2SfxImporter.uplugin
    Source/
      Easy2SfxImporter/
        Easy2SfxImporter.Build.cs
        Easy2SfxImporter.cpp
      Easy2SfxImporterEditor/
        Easy2SfxImporterEditor.Build.cs
        Easy2SfxImporterEditor.cpp
        Easy2SfxImporterEditor.h
```

If Visual Studio reports **missing `*.Build.cs`**, the `Source` tree is incomplete or paths were renamed—copy the whole `Source` folder from this repo. Then **delete** your project’s `Intermediate` (and regenerate project files) so old paths are not cached.

1. **Copy this entire folder** into your Unreal project’s `Plugins` directory:

   ```
   YourUnrealProject/
     Plugins/
       Easy2SfxUnrealPlugin/     ← copy the folder that contains Easy2SfxImporter.uplugin
         Easy2SfxImporter.uplugin
         Source/
         README.md
   ```

2. **Regenerate project files**
   - Right‑click `YourUnrealProject.uproject` → **Generate Visual Studio project files** (Windows), or use the equivalent for your IDE.

3. **Build**
   - Open the solution and build the **Editor** target, or build from Unreal when it prompts you to rebuild missing modules.

4. **Enable the plugin**
   - Open the project in Unreal Editor.
   - **Edit → Plugins**
   - Search for **Easy2Sfx** (or “Easy2Sfx Importer”).
   - Enable it and **restart** the editor if asked.

---

## Use

1. Export or copy your Easy2Sfx session sounds into a **folder on disk** (the folder’s name should be your session name).
2. In Unreal: **Tools → Import Easy2Sfx session folder...**
3. Select that **folder** (not individual files).
4. After import, the **Content Browser** focuses `Content/Easy2Sfx/<folder name>/`.

---

## WAV conversion

Unreal often imports **WAV, OGG, and others** directly. If you need **everything as `.wav`** before import (e.g. odd codecs), convert on disk first, then run the importer.

**Example (FFmpeg on PATH)** — convert all supported inputs in a folder to WAV (run in a shell in that folder):

```bash
for %f in (*.*) do ffmpeg -y -i "%f" "%~nf.wav"
```

(PowerShell one-liner alternative: use `Get-ChildItem` and call `ffmpeg` per file.)

After conversion, pick that folder with **Import Easy2Sfx session folder...** so only the `.wav` files are pulled in (or remove non-wav files if you want a clean folder).

---

## Troubleshooting

- **“Plugin failed to load” / compile errors**  
  Ensure the project is **C++**, regenerate project files, and build the **Editor** configuration.

- **UE 5.5: `GetDesktopPlatform` is not a member of `FDesktopPlatformModule`**  
  Use `IDesktopPlatform* P = FDesktopPlatformModule::Get();` (static `Get()` returns the platform pointer).

- **Missing `Easy2SfxImporter.Build.cs` / CS2001 in ModuleRules**  
  Copy the full `Source/` tree; delete the project `Intermediate` folder; regenerate Visual Studio project files; rebuild.

- **`bAsynchronous` / `IContentBrowserSingleton`**  
  Do not set `bAsynchronous` on `UAssetImportTask` in 5.5; include `"IContentBrowserSingleton.h"` for Content Browser sync.

- **Some formats don’t import**  
  Your UE build may not ship factories for every codec. Convert to **WAV** first (section above), then import again.

---

## License

Provided with Easy2SfxPro for use with your projects; adjust licensing if you redistribute the plugin separately.
