Spritesheets

Preview Directional Sprites: a few frames of a 3D model in a style, from each direction asked for, to check a style before rendering. Takes the same model, animation, camera and style fields as createDirectionalSprites. The response (synchronous, not a job) has one preview per direction, in the order asked, each with `frame_urls` - the frames as images (4 for an animated model, 1 for a still one) - and `render_3d`, the style and settings as rendered, which createDirectionalSprites takes back as they are. Free (no credits), and nothing is saved to your generations; the frame images are kept for 7 days. A preview takes several seconds. You run one preview at a time: starting another while one is still running cancels the older one, which then answers 204 with no body. Preview one or two directions while trying styles and render only once the look is right. Requires an API key (user scope).

Changed on
post/assets/sprite/directional-preview

Request

  • Base URL
    https://api.ludo.ai/api
  • Auth
    API key in header Authorization

Request body

modelstring required

The 3D model, as a URL or base64-encoded GLB file (not an AI model name). Rigged, to animate it. Up to 30MB; a larger file is rejected with HTTP 400.

animation_urlstring

An animation for the model, as a URL or base64-encoded GLB file - the glb_url of an animation from animate3DModel or animate3DModelPreset, made for this model's skeleton. At most one of animation_url, preset_id and model_animation. Up to 30MB; a larger file is rejected with HTTP 400.

preset_idstring

An animation preset id from listAnimationPresets, retargeted onto the model. Any rig type can take one; when the preset cannot be retargeted onto the model, the call returns an error. At most one of animation_url, preset_id and model_animation.

crop_loopboolean

With preset_id, trim the preset to the span that loops seamlessly. Omit to follow the preset's own loop flag.

model_animationstring

The name of an animation the GLB itself carries. At most one of animation_url, preset_id and model_animation; with none, the preview is a single frame.

perspective'horizon' | 'low' | 'isometric' | 'high' | 'top'

Camera height, from the side (horizon) to straight down (top).

directionsstring[]

Where the camera stands around a character facing S, each direction at most once. One preview per direction, in this order.

style_idstring

A style id from listDirectionalSpriteStyles.

style_versioninteger

Version of the style; omit for its current one.

style_paramsobject

The style's settings to change, by name, each one of its listed option values (true/false for a bool setting, or any colour for a color one). Omit a setting to keep its default.

keep_horizontal_travelboolean

Keep the animation's ground travel (the character moves across the frame). Off keeps it in place.

keep_vertical_travelboolean

Keep the animation's vertical root motion (jumps, bobbing).

target_frame_sizeinteger

Sprite size of the preview frames in pixels (the longer side).

Response

Success

Changes