Spritesheets

Fit an accessory to a rigged 3D model for Directional Sprites: an item GLB (a sword, a gun, a staff, a bow, a shield, a helmet, a hat, a backpack...) held by one bone of the model - a hand, the head, the back or the hips. Nothing is saved. The item is first placed automatically for its `kind` (a sword by its handle, a gun by its pistol grip, a shield on the forearm, a helmet over the head, a backpack on the back), and the hand closes round it. Adjust it relative to that automatic fit with `size` (% of it), `move` (% of the character's height along forward/up/out) and `turn` (degrees about those axes), and call again with the new values until it looks right: each call starts from the automatic fit, so send the full adjustment every time. The response has the `placement` to pass to attachDirectionalAccessories, `checks` (how far the item sinks into the body, how far its grip is from the palm, how much of the head pokes through a helmet, each in % of the character's height or of its vertices), and, unless `preview` is false, `model_url` (the model holding the item, a GLB kept 7 days) and `previews`: frames of the model walking with it, seen from SW and SE, like previewDirectionalSprites' (which this shares: one preview at a time, a newer one cancels the older, which then comes back without previews). Free (no credits) and synchronous; a fit takes a few seconds with previews. Requires an API key (user scope).

Changed on
post/assets/sprite/directional-accessory-fit

Request

Request body

modelstring required

The rigged 3D model, as a URL or base64-encoded GLB file - create3DModel with rig true, or rigModel. Up to 30MB; a larger file is rejected with HTTP 400.

itemstring required

The item, as a URL or base64-encoded GLB file - any 3D model (create3DModel without rig, standing as generated). Up to 30MB.

namestring

What the item is, in words ("rusty sword"). Used to guess kind when it is omitted, and as the item's name when saved.

kind'blade' | 'gun' | 'staff' | 'bow' | 'shield' | 'helmet' | 'hat' | 'back' | 'other'

What the item is, which decides how it is first held: blade (sword, axe, dagger, mace, wand...: by its handle, pointing forward), gun (by its pistol grip, barrel forward), staff (spear, polearm: at its middle, upright), bow (at its middle, upright), shield (on the forearm, facing out), helmet (over the head, sized to it), hat (hat or crown: on top of the head), back (backpack, quiver: flat on the back), other. Omit to guess it from name and the item's shape (other when unsure).

point'right_hand' | 'left_hand' | 'head' | 'back' | 'hips'

Where the item goes. Omit for where its kind goes (a bow and a shield in the left hand, a helmet or hat on the head, a backpack on the back, anything else in the right hand). The response lists the points this skeleton has.

bonestring

A bone of the model's skeleton to hold the item, by name, instead of point.

sizenumber float

The item's size in % of the automatic fit's (100 = as fitted, 150 = half as big again).

flipboolean

Hold the item by its other end (when the automatic fit grabbed it by the wrong end).

gripboolean

Close the hand round the item (on a skeleton with finger bones).

previewboolean

Render previews and host the model holding the item. False answers only the fit and its checks, in about a second.

preview_preset_idstring

The animation preset (listAnimationPresets) the previews show the model doing with the item.

Response

Success

kindstring

What the item was fitted as (as sent, or guessed).

pointstring

The attach point the bone is, if it is one.

bonestring

The bone holding the item.

sizenumber float
flipboolean
gripboolean
model_urlstring

The model holding the item, as a GLB (kept 7 days). Unless preview is false.

preview_errorstring

Why there are no previews, when they could not be made (the fit itself is still valid).

Changes