Screenshots · origen_clothing
origen_clothing_screenshot is a companion resource that generates item preview images for the clothing store UI. Each item in origen_clothing_items needs an image_url — this resource takes care of that automatically.
How it works
- The player's ped is teleported to a green screen location (
Config.GreenScreenPos) - For each clothing item, the ped is dressed with that item and a screenshot is taken using a per-component camera angle
- The PNG is either saved locally or uploaded to Fivemanage
- The
image_urlcolumn inorigen_clothing_itemsis updated with the result - The player's original appearance and position are restored when done
Configuration — config.lua
Green screen location
The coordinates where peds are placed during the screenshot process:
Config.GreenScreenPos = vector4(1339.42, 5864.18, 2.57, 357.78)This is a remote area with a flat ground. Do not change it unless you know what you're doing — lighting conditions affect image quality.
Save destination
Config.Save = {
localFiles = false, -- true = save PNGs to resource images/ folder
fiveManageAPI = "", -- Fivemanage API key (required when localFiles = false)
}| Option | Description |
|---|---|
localFiles = false | Upload PNGs to Fivemanage. Requires a valid API key. |
localFiles = true | Save PNGs to origen_clothing_screenshot/images/. No external dependency. |
If using Fivemanage (localFiles = false), set your API key in Config.Save.fiveManageAPI. Get your key at docs.fivemanage.com.
Camera configuration
Each component ID and prop ID has a dedicated camera angle optimized for that body part. These are defined in Config.ScreenshotCameras:
Config.ScreenshotCameras = {
clothes = {
[1] = { boneId = 31086, ... }, -- masks (head bone)
[3] = { boneId = 24818, ... }, -- torsos
[4] = { boneId = 24818, ... }, -- legs
[5] = { boneId = 24818, ... }, -- bags
[6] = { boneId = 24818, ... }, -- shoes
[7] = { boneId = 24818, ... }, -- neck
[8] = { boneId = 24818, ... }, -- shirts
[9] = { boneId = 24818, ... }, -- vest
[10] = { boneId = 24818, ... }, -- decals
[11] = { boneId = 24818, ... }, -- jackets
},
props = {
[0] = { boneId = 31086, ... }, -- hats (head bone)
[1] = { boneId = 31086, ... }, -- glasses
[2] = { boneId = 31086, ... }, -- earrings
[6] = { boneId = 24818, ... }, -- watches
[7] = { boneId = 24818, ... }, -- bracelets
}
}Each camera entry uses these fields:
| Field | Type | Description |
|---|---|---|
boneId | number | Ped bone the camera focuses on (31086 = head, 24818 = spine) |
camOffset | vector4 | Camera position offset from the bone |
targetOffset | vector4 | Point-at offset from the bone |
fov | number | Field of view in degrees |
Commands
/screenshot [ped] [collection] [isProp] [component] [variation]
Manual command to take screenshots. Runs from the client.
| Argument | Default | Description |
|---|---|---|
ped | — | Ped model name (e.g. mp_m_freemode_01) |
collection | all | Collection name or all for every collection |
isProp | 0 | 1 = props, 0 = clothing components |
component | all | Component name or all |
variation | -1 | Specific variation index or -1 for all |
Example — screenshot all shirts on the male freemode ped:
/screenshot mp_m_freemode_01 all 0 shirtsExample — screenshot a specific collection:
/screenshot mp_m_freemode_01 mp_m_2024_01 0 all/stopscreenshot
Immediately stops an active screenshot process.
Server-side export — UpdateUrl
origen_clothing_screenshot also exposes a server export to manually update an item's image URL:
exports['origen_clothing_screenshot']:UpdateUrl(model, hash, url)| Parameter | Type | Description |
|---|---|---|
model | number | Ped model hash |
hash | string | Item hash string |
url | string | New image URL to store |
Client-side export — prepareScreenshot
Programmatically trigger the screenshot process from another resource (e.g. from the clothing admin UI):
exports['origen_clothing_screenshot']:prepareScreenshot({
ped = 'mp_m_freemode_01',
collection = 'all', -- collection name or 'all'
isProp = false,
component = 'all', -- component name or 'all'
variation = -1,
skipExisting = true, -- skip items that already have an image_url
})| Field | Type | Description |
|---|---|---|
ped | string | Ped model name |
collection | string | Collection name or 'all' |
isProp | boolean | true = props, false = clothing components |
component | string | Component category name or 'all' |
variation | number | Specific global variation index or -1 for all |
skipExisting | boolean | If true, items that already have an image_url are skipped |
When skipExisting = true, the resource queries the DB in chunks of 500 items to check which ones already have photos before starting. This can save significant time on large catalogs.