Skip to content

Item Art Pipeline

Summary: Scripts in Tools/ItemArt/ that take an item from generated art to art in the editor: a rendered image becomes an inventory icon and a skill slot icon, a generated mesh becomes a rigged, correctly sized FBX with PBR maps, and one editor script imports the set. Built for Midjourney images and Tripo meshes; it works for any render on a plain background and any single-object mesh. The item itself is then made by copying a relative.

Table of Contents


Requirements

Need For Note
Python packages numpy, Pillow, scipy, rembg make_icon.py, metal_mask.py pip install numpy pillow scipy "rembg[cpu]"
The BiRefNet model make_icon.py Downloaded on first run to ~/.rembg, about 970 MB
Blender 4.2 or newer tripo_prep.py, glb_textures.py, uv_region.py Tested on 5.2. blender below means the full path to blender.exe unless it is on PATH
The editor, open, with Play stopped ue_import_art.py Run through Tools/Harness/mcp.py

The source images and the generator's .blend and .glb files are not in the repository. What the tools write under ArtSource/ is the source of record.


The Steps

A set is one folder name, for example ForestGear. Every step writes to or reads from that set's two folders.

Step Command Result
Icon python Tools/ItemArt/make_icon.py <image> T_Icon_<Name> --grid 1x3 --upright --slot --out ArtSource/Textures/<Set> T_Icon_<Name>.png and T_Icon_<Name>_VAR2.png
Mesh blender -b <file.blend> --python Tools/ItemArt/tripo_prep.py -- --object <part of name> --kind blade --name <Name> --out ArtSource/Meshes/<Set> SKM_<Name>.fbx
PBR maps blender -b --python Tools/ItemArt/glb_textures.py -- <file.glb> <Name> --out ArtSource/Meshes/<Set> T_<Name>_BC.png, _N.png, _ORM.png
Import Set SET, ICONS and MESHES at the top of Tools/ItemArt/ue_import_art.py, then python Tools/Harness/mcp.py py Tools/ItemArt/ue_import_art.py Textures, material instances and skeletal meshes under Content/

The first three run without the editor. Without --out, each tool writes to a folder named after the item, which the import step does not read.


Icons

make_icon.py removes the background with an AI matting model, then grades and frames the item.

  • Matte. BiRefNet, through the rembg package. It removes the ground shadow and keeps thin spikes and the gaps between woven parts. Colour keying could not do either on a grey blade over a grey background.
  • Edges. Pixels on the edge are a blend of item and studio background. The script replaces their colour with the nearest solid colour, so no grey fringe shows on a dark slot.
  • Grade. Low-key and near neutral: median brightness about 60 of 255, highlights about 200. These numbers come from the Remnant, knight armour and weapon icons. --median, --white and --saturation change them.
  • Framing. --grid WxH is the item's inventory footprint; the canvas takes that proportion. Weapons use --upright, which turns the long axis vertical with the narrow end up (--point-down reverses it). Leave it off for an item whose head is wider than its handle, such as a mace: the image is used as it stands. --mirror flips the item left to right, for an off-hand item whose outer edge should face away from the body.
  • Skill slot icon. --slot also writes <name>_VAR2.png, a 256 px square for the HUD's attack slots: the item leans 35 degrees and is pushed in until it runs off the frame, as the older weapon icons do. --slot-focus picks the part that stays centred (0 is the top of the item), --slot-zoom how far it is pushed in, and --slot-tilt 0 with --slot-zoom 0.95 keeps a round item whole. Set it on the manifest as the SkillSlot entry of IconVariants.
  • Reshaped meshes. --width-scale squashes or widens the item, so the icon matches a mesh that was made oval.
  • Output. A PNG with colour bled under the transparent texels, and a preview on three backgrounds (ignored by git). The script prints the IconDimensions to put on the manifest: 64 px per grid cell.

Icons import as TEXTUREGROUP_UI, TC_EditorIcon, sharpened mips, sRGB, into /Game/Thumbnails/.


Meshes

tripo_prep.py runs in Blender and does five things in order: weld, clean, size, orient, rig.

Weld and clean. A Tripo mesh arrives with every UV seam split, so it reads as thousands of loose pieces with every edge open. Welding is what makes a manifold check mean anything. After the weld the script drops stray fragments, fills the holes it can, and reports what is left. A face made by filling a hole has no UVs of its own, so it takes them from its neighbours; without that it samples the texture at random and shows as a wrongly coloured patch. Expect a few dozen open edges and some edges shared by three faces: generated meshes are overlapping shells, not one closed surface. That is fine for a rendered item and would matter only for fracture or printing.

Size, orient and rig, per --kind:

Kind Convention (copied from the existing art) Rig
shield Face in the XZ plane, front toward Blender -Y. --size is the longest side in metres (default 0.8), --squash makes it an oval (width as a share of height), --depth flattens it (a share of the depth), --seat moves the arm into the straps (metres) One bone, Root
blade Length along +Z with the narrow end up, grip centred on the origin. --size is the length in metres (default 0.6), --grip is where the hand sits, as a share of the length from the bottom One bone, Root
head A ring on the brow, centred on its band, pinched at the temples, tilted so the front sits higher. --size is not used: the ring is fitted to the skull Skinned whole to head on the player skeleton

Limits: a blade's point is found by comparing how thick the two ends are, so a weapon with a heavy head needs checking; a head ring must arrive lying flat (its hole along Z). head needs --skeleton-fbx: an FBX export of any mesh already on SK_Als (a helm works). The skull measurements at the top of the script were taken on SKM_Male3_Rigged; a different body needs new numbers. --static also writes an SM_ twin for decoration.

The forest gear's four meshes were made with these arguments, from the generator's scene:

Item Arguments
Thorn Shield --kind shield --name Thorn_Shield --size 1.02 --squash 0.86 --depth 0.85 --seat 0.045
Totem Shear --kind blade --name Shear_Blade --size 0.55 --grip 0.2
Rust Machete --kind blade --name Machete --size 0.68 --grip 0.16
The Barbed Wreath --kind head --name Barbed_Wreath --skeleton-fbx <a helm on SK_Als>

PBR Maps

Tripo exports a model again as a glb with PBR on, and the re-export keeps the UVs. glb_textures.py pulls the maps out at the size the file holds them: T_<Name>_BC, T_<Name>_N (green flipped for the engine) and T_<Name>_ORM (roughness in green, metallic in blue, red set to white because the file carries no occlusion). The import step needs all three.

Metal on blades. Tripo's metallic map is close to zero even on a blade. Two steps paint it:

blender -b --python Tools/ItemArt/uv_region.py -- ArtSource/Meshes/<Set>/SKM_<Name>.fbx <region.json> python Tools/ItemArt/metal_mask.py T_<Name>_BC.png T_<Name>_ORM.png <region.json> --blade-from 0.12

Metal goes on the faces above --blade-from (metres up the blade, so the grip stays untouched) and only where the base colour is grey iron, not rust. Brighter iron gets lower roughness, so the shine is patchy. --metal and --rough set the values on clean iron (0.8 and 0.4). The ORM file is rewritten in place; keep the extracted one if you want to try other values.


Import

ue_import_art.py imports one set: the icons, each mesh's three textures, a material instance of M_ORM per mesh and the skeletal mesh. It reads ArtSource/Meshes/<SET>/ and ArtSource/Textures/<SET>/ and writes its result to Saved/ItemArt_import.json.

It is safe to run again after re-exporting a mesh or a texture. Textures and meshes are replaced in place. A held item's skeleton (SK_<Name>) is made on the first import and reused after, so its sockets survive. A material instance that already exists is left alone, so values tuned by hand survive.

Two things remain by hand or by MCP call after the first import:

  1. Sockets. Weapon meshes need Socket_01 (blade base), Socket_02 (tip) and FX_Weapon on Root. Add them with SkeletalMeshTools.add_socket and set_socket_transform.
  2. Weapon scaling. Each new weapon base type needs a row in /Game/DataAssets/Combat/WeaponScaling, or the log reports "No scaling definition found" and the default is used.

Making the Item

There is no script for this step. An item is made by duplicating a close relative in the editor and changing only the fields that differ. That keeps the montage tables, combo and charge configs, abilities, block stats and sockets of the relative, which the Item Manager wizard does not ask for.

Asset Made from Changed
Base type BT_<id> A base type of the same hand context Id, display name, type name, subtype tag, implicits
Visual config The relative's config The mesh: SocketAttachments for held items, DeformingMeshes for worn ones
Manifest The relative's manifest ItemID, name, description, icon, IconVariants, IconDimensions, grid, base type, visual config, and the stats that differ

A manifest is edited from Python as text: export the whole struct, change it, import it back (see Unreal MCP and Python Guide). For a new weapon type, read Adding a Weapon Type first.


Traps

Symptom Cause Fix
Skeletal mesh import returns nothing; the log says "Cannot import SkeletalMeshNode asset at runtime" PIE is running Stop PIE, then import
A value set from Python reads back right but is not in the file The asset was not marked dirty, so the save wrote nothing Call modify() before the change and save_loaded_asset(asset, False); check the file, not the object
A head mesh shrinks to a speck on the skeleton in Blender The exported skeleton is in centimetres under a 0.01 parent; the mesh is in metres Set matrix_parent_inverse to the rig's inverse world matrix after parenting (the script does)
A worn ring sits off centre It was centred on its outer bounds, and thorns or leaves are longer on one side Centre on the band's middle line (the script does)
Small wrongly coloured patches on a mesh Faces made by filling holes had no UVs The script gives them their neighbours' UVs
A new type tag is dropped when the manifest text is imported The tag does not exist in the running editor Add the native tag, build, restart the editor, then author
A socket cannot be named from editor Python SkeletalMeshSocket.SocketName is read-only to scripts Use the SkeletalMeshTools MCP toolset
The icon tool stalls on first run It is downloading the matting model Wait; later runs start at once

Source References

Component Location
Icon tool Tools/ItemArt/make_icon.py
Mesh tool Tools/ItemArt/tripo_prep.py
PBR maps from a glb Tools/ItemArt/glb_textures.py
Blade metal mask Tools/ItemArt/uv_region.py, Tools/ItemArt/metal_mask.py
Art import Tools/ItemArt/ue_import_art.py
Mesh sources ArtSource/Meshes/
Icon sources ArtSource/Textures/
Equipment mesh references Source/ProjectEternal/Public/EquipmentManagement/Data/EquipmentVisualConfig.h
Weapon type tags Source/ProjectEternal/Private/Inventory/Items/ItemTags.cpp


Recent Changes

Date Change Impact
2026-11-14 PBR maps from a glb, blade metal mask, skill slot icons, hole-fill faces get UVs; the import script takes a set and is safe to re-run; the item authoring script is gone A set goes from generator output to imported art with paths that work on any checkout
2026-11-13 Initial page, written with the Thorn Shield, Totem Shear, Rust Machete and the Barbed Wreath's mesh A generated image and mesh become item art in a few commands