generate-assets
Generates 3D models and audio assets via AI APIs (Meshy, ElevenLabs) and imports them into Unreal Engine.
SKILL.mdUnrealEngine/skills/generate-assets/SKILL.md
GitHubGenerative AI Workflow
You have access to a Python utility script generative_utils.py located inside the plugin's ExternalServer directory. This script securely interfaces with third-party generative AI services to create assets for the Unreal Engine project.
Requirements
The user MUST provide the required API keys in a .env file located at the root of the project.
- For 3D Models (Meshy):
MESHY_API_KEY - For Audio (ElevenLabs):
ELEVENLABS_API_KEY
If the script fails due to a missing key, kindly ask the user to add the key to the .env file in the project workspace.
Step 1: Generate the Asset
To generate an asset, you will run the Python script using a local terminal. The script will poll the API, download the asset, and save it.
Resolve the path to generative_utils.py dynamically:
- Script location:
{AGENT_PLUGIN_DIR}/ExternalServer/src/generative_utils.py - If
{AGENT_PLUGIN_DIR}is not in your environment, use.agents/plugins/UnrealEngine/ExternalServer/src/generative_utils.pyrelative to the project root.
For 3D Models:
python "{AGENT_PLUGIN_DIR}/ExternalServer/src/generative_utils.py" --project-root "{PROJECT_ROOT}" meshy --prompt "Your detailed prompt here"
Note: This will download an .fbx file and its associated PBR texture maps (.png).
For Audio / Text-to-Speech:
python "{AGENT_PLUGIN_DIR}/ExternalServer/src/generative_utils.py" --project-root "{PROJECT_ROOT}" elevenlabs --prompt "Text to speak"
Note: This will download a proper RIFF/WAV file.
Step 2: Import into Unreal Engine
Once the Python script succeeds, it will print the absolute paths of the downloaded files. You MUST import these files into the Unreal Editor immediately.
For 3D Models:
- Use the
import_meshMCP tool for the.fbxmodel. - Use the
import_assets_batchMCP tool for the texture.pngfiles (base_color,normal,roughness,metallic,ao). - Destination paths:
/Game/GenAI/Meshes/for models,/Game/GenAI/Textures/for texture maps.
For Audio (.wav):
- Use the
import_assets_batchMCP tool. - Destination path:
/Game/GenAI/Audio/.
Step 3: One-Shot PBR Material Setup (3D Models Only)
After importing the mesh and texture maps, build and assign the material using the native one-shot PBR material action:
- Create PBR Material Graph: Use
create_pbr_material_from_texturesto instantiate texture samples and wireBaseColor,Normal,Roughness,Metallic, andAOpins in a single atomic tool call:{ "MaterialPath": "/Game/GenAI/Materials/M_GenAI_{Name}", "BaseColorTexturePath": "/Game/GenAI/Textures/T_{Name}_BaseColor", "NormalTexturePath": "/Game/GenAI/Textures/T_{Name}_Normal", "RoughnessTexturePath": "/Game/GenAI/Textures/T_{Name}_Roughness", "MetallicTexturePath": "/Game/GenAI/Textures/T_{Name}_Metallic", "BlendMode": "Opaque", "ShadingModel": "DefaultLit" } - Assign Material: Use
configure_static_meshorset_component_propertiesto assign/Game/GenAI/Materials/M_GenAI_{Name}to the static mesh material slot.
Step 4: Sound Wave & Cue Setup (Audio Assets Only)
After importing raw .wav audio files into /Game/GenAI/Audio/:
- Configure Sound Wave & Sound Cue: Use
configure_sound_wave_cueto set playback parameters (bLooping,VolumeMultiplier,PitchMultiplier) and optionally generate aUSoundCueasset with 3D spatial attenuation:{ "SoundWaveAsset": "/Game/GenAI/Audio/SW_GenAI_{Name}", "CueAssetPath": "/Game/GenAI/Audio/SC_GenAI_{Name}", "bLooping": false, "VolumeMultiplier": 1.0, "PitchMultiplier": 1.0, "AttenuationAssetPath": "/Game/Audio/ATT_Default3D" }