Ligamen

Commands

Files and pipeline

This page describes 32 commands in 5 sections. How to call them is explained in Commands.

File#

The File menu: projects, import, export, atlases and FBX.

lg.file.new#

Start a new empty project.

Hotkey: Ctrl+N.

Example

lg.file.new()

lg.file.new_skeleton#

Add another, empty skeleton to the project.

Example

lg.file.new_skeleton()

lg.file.open#

Open a project (shows the file dialog).

Hotkey: Ctrl+O.

Opens a dialog and waits for you.

Example

lg.file.open()

lg.file.save#

Save the project to its .ligamen file.

Hotkey: Ctrl+S.

Example

lg.file.save()

lg.file.save_as#

Save the project under a new name (shows the file dialog).

Hotkey: Ctrl+Shift+S.

Opens a dialog and waits for you.

Example

lg.file.save_as()

lg.file.package_project#

Pack the project with its images and audio into one .zip file.

Opens a dialog and waits for you.

Example

lg.file.package_project()

lg.file.import_#

Open the Import window.

Opens a dialog and waits for you.

Example

lg.file.import_()

lg.file.export#

Open the Export window.

Hotkey: Ctrl+E.

Opens a dialog and waits for you.

Example

lg.file.export()

lg.file.repeat_export#

Run the last export of the session again with the same options, without a window.

Hotkey: Ctrl+Shift+E.

Example

lg.file.repeat_export()

lg.file.export_unity#

Export the data together with its texture atlas for the Unity runtime.

Opens a dialog and waits for you.

Example

lg.file.export_unity()

lg.file.export_skeleton#

Export an additional skeleton of the project as a separate file.

Opens a dialog and waits for you.

Example

lg.file.export_skeleton()

lg.file.export_image_sequence#

Open the window that renders the animation to images or a video.

Opens a dialog and waits for you.

Example

lg.file.export_image_sequence()

lg.file.pack_atlas#

Open the Texture Packer.

Opens a dialog and waits for you.

Example

lg.file.pack_atlas()

lg.file.unpack_atlas#

Open the Texture Unpacker, which turns an atlas back into separate images.

Opens a dialog and waits for you.

Example

lg.file.unpack_atlas()

lg.file.import_fbx#

Import an FBX file.

Opens a dialog and waits for you.

Example

lg.file.import_fbx()

lg.file.export_fbx#

Export an FBX file.

Opens a dialog and waits for you.

Example

lg.file.export_fbx()

lg.file.quit#

Quit Ligamen Studio.

Hotkey: Ctrl+Q.

Example

lg.file.quit()

Pipeline#

Exchange with Blender.

lg.pipeline.blender_send#

Send the project to Blender.

Opens a dialog and waits for you.

Example

lg.pipeline.blender_send()

lg.pipeline.blender_receive#

Receive the result from Blender.

Opens a dialog and waits for you.

Example

lg.pipeline.blender_receive()

Project#

Create, open and save projects, project settings and what the animator sees.

lg.project.new_project#

Start an empty project.

Synopsis

lg.project.new_project(...)
ArgumentTypeDescription
fpsint
discard_changesboolDrop unsaved changes.

Example

lg.project.new_project(fps=30)

lg.project.open_project#

Open a .ligamen project or a Spine JSON file.

Synopsis

lg.project.open_project(path, ...)
ArgumentTypeDescription
pathstr(required) File path.
discard_changesboolDrop unsaved changes.

Example

lg.project.open_project(path="/Users/me/knight.ligamen")

lg.project.save_project#

Save as .ligamen (to its current path, or 'path').

Synopsis

lg.project.save_project(...)
ArgumentTypeDescription
pathstrTarget .ligamen path (required for a never-saved project).

Example

lg.project.save_project(path="/Users/me/knight.ligamen")

lg.project.set_project#

Project settings: fps, images_dir, audio_dir (relative to the project file).

Synopsis

lg.project.set_project(...)
ArgumentTypeDescription
fpsint
images_dirstrImages folder.
audio_dirstrAudio folder.

Example

lg.project.set_project(fps=24, images_dir="images")

lg.project.set_view#

What the animator sees: setup/animate mode, open animation, frame, active skins, selection, playback. Does not change the document.

Synopsis

lg.project.set_view(...)
ArgumentTypeDescription
modestrMode. One of: setup, animate.
animationstrOpen this animation.
framefloatFrame at the project FPS (fractional allowed).
timefloatTime in seconds (alternative to frame).
skinslistActive skins.
select_boneslistBones to select.
select_slotslistSlots to select.
frame_allboolFit the view.
playingboolPlay/stop.

Example

lg.project.set_view(mode="animate", animation="walk", frame=0)

Importer#

Bring PSD layers, images, skeletons and animations into the project.

lg.importer.psd#

Import a layered PSD: every layer becomes bone+slot+region (layer PNGs written to the images folder). Save the project first.

Synopsis

lg.importer.psd(path, ...)
ArgumentTypeDescription
pathstr(required) PSD file.
skinstrSkin (default 'default').
parentstrParent bone for the new bones.
on_conflictstrExisting names. One of: skip, overwrite.
include_hiddenboolAlso import hidden layers.
group_as_slotboolPSD groups become one slot each.
images_dirstrWhere to write layer PNGs.

Example

lg.importer.psd(path="/Users/me/knight.psd", skin="default")

lg.importer.images#

Import a folder of images: one bone+slot+region per image.

Synopsis

lg.importer.images(folder, ...)
ArgumentTypeDescription
folderstr(required) Folder.
skinstrSkin.
parentstrParent bone.
spacingfloatHorizontal spacing between parts.
on_conflictstrExisting names. One of: skip, overwrite.

Example

lg.importer.images(folder="/Users/me/parts", spacing=10)

lg.importer.skeleton#

Merge bones/slots/skins from another Spine JSON or .ligamen.

Synopsis

lg.importer.skeleton(path, ...)
ArgumentTypeDescription
pathstr(required) Source file.
on_conflictstrExisting names. One of: skip, overwrite.

Example

lg.importer.skeleton(path="/Users/me/other.ligamen", on_conflict="skip")

lg.importer.animations#

Copy animations from another Spine JSON or .ligamen.

Synopsis

lg.importer.animations(path, ...)
ArgumentTypeDescription
pathstr(required) Source file.
nameslistOnly these animations.
on_conflictstrExisting names. One of: rename, skip, overwrite.

Example

lg.importer.animations(path="/Users/me/other.ligamen", names=["walk"])

Exporter#

Write Spine JSON, rendered media and atlases to disk, or send the model to Blender.

lg.exporter.spine_json#

Export Spine JSON (validated first).

Synopsis

lg.exporter.spine_json(path, ...)
ArgumentTypeDescription
pathstr(required) Output .json.
prettyboolIndent (default true).
nonessentialboolKeep nonessential data (default true).

Example

lg.exporter.spine_json(path="/Users/me/knight.json")

lg.exporter.media#

Render an animation to png/jpg/psd frames (path = folder) or gif/apng/avi/mov (path = file).

Synopsis

lg.exporter.media(path, ...)
ArgumentTypeDescription
pathstr(required) Folder or file.
formatstrFormat. One of: png, jpg, psd, gif, apng, avi, mov, mp4.
animationstrAnimation (default: open one).
all_animationsboolFrames formats only.
scalefloatOutput scale.
widthint
heightint
cropboolTrim empty margins.
overlay_bonesboolDraw bones.
smoothingboolBilinear filtering (default true).

Example

lg.exporter.media(format="gif", path="/Users/me/walk.gif", animation="walk")

lg.exporter.pack_atlas#

Pack a folder of images into a .atlas + page PNGs.

Synopsis

lg.exporter.pack_atlas(folder, output, ...)
ArgumentTypeDescription
folderstr(required) Source images.
outputstr(required) Output .atlas path.
max_sizeint
paddingint
allow_rotationboolRotate to fit.
power_of_twoboolPOT pages.
strip_whitespaceboolTrim transparent edges (default true).

Example

lg.exporter.pack_atlas(folder="/Users/me/parts", output="/Users/me/knight.atlas")

lg.exporter.send_to_blender#

Send the project to Blender through the configured bridge.

Synopsis

lg.exporter.send_to_blender()

Example

lg.exporter.send_to_blender()