OrigenNetwork
Docs

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

  1. The player's ped is teleported to a green screen location (Config.GreenScreenPos)
  2. For each clothing item, the ped is dressed with that item and a screenshot is taken using a per-component camera angle
  3. The PNG is either saved locally or uploaded to Fivemanage
  4. The image_url column in origen_clothing_items is updated with the result
  5. 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:

lua
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

lua
Config.Save = {
    localFiles  = false,       -- true = save PNGs to resource images/ folder
    fiveManageAPI = "",        -- Fivemanage API key (required when localFiles = false)
}
OptionDescription
localFiles = falseUpload PNGs to Fivemanage. Requires a valid API key.
localFiles = trueSave 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:

lua
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:

FieldTypeDescription
boneIdnumberPed bone the camera focuses on (31086 = head, 24818 = spine)
camOffsetvector4Camera position offset from the bone
targetOffsetvector4Point-at offset from the bone
fovnumberField of view in degrees

Commands

/screenshot [ped] [collection] [isProp] [component] [variation]

Manual command to take screenshots. Runs from the client.

ArgumentDefaultDescription
pedPed model name (e.g. mp_m_freemode_01)
collectionallCollection name or all for every collection
isProp01 = props, 0 = clothing components
componentallComponent name or all
variation-1Specific variation index or -1 for all

Example — screenshot all shirts on the male freemode ped:

text
/screenshot mp_m_freemode_01 all 0 shirts

Example — screenshot a specific collection:

text
/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:

lua
exports['origen_clothing_screenshot']:UpdateUrl(model, hash, url)
ParameterTypeDescription
modelnumberPed model hash
hashstringItem hash string
urlstringNew image URL to store

Client-side export — prepareScreenshot

Programmatically trigger the screenshot process from another resource (e.g. from the clothing admin UI):

lua
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
})
FieldTypeDescription
pedstringPed model name
collectionstringCollection name or 'all'
isPropbooleantrue = props, false = clothing components
componentstringComponent category name or 'all'
variationnumberSpecific global variation index or -1 for all
skipExistingbooleanIf 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.