Ligamen

Commands

Tools and meshes

This page describes 16 commands in 3 sections. How to call them is explained in Commands.

Tools#

The viewport tools and the Magic Brush size.

lg.tool.select#

Click to select, drag for a region, Shift adds, Ctrl toggles

Synopsis

lg.tool.select(state)

Hotkey: Q / V.

A switch: lg.tool.select(True) turns it on, lg.tool.select(False) off, without an argument it flips it.

Example

lg.tool.select(True)

lg.tool.create#

Click sets the bone root, drag sets direction and length

Synopsis

lg.tool.create(state)

Hotkey: B.

A switch: lg.tool.create(True) turns it on, lg.tool.create(False) off, without an argument it flips it.

Example

lg.tool.create(True)

lg.tool.translate#

Drag to move, Shift constrains to one axis

Synopsis

lg.tool.translate(state)

Hotkey: W.

A switch: lg.tool.translate(True) turns it on, lg.tool.translate(False) off, without an argument it flips it.

Example

lg.tool.translate(True)

lg.tool.rotate#

Drag to rotate around the parent, Shift snaps to 15 degrees

Synopsis

lg.tool.rotate(state)

Hotkey: E.

A switch: lg.tool.rotate(True) turns it on, lg.tool.rotate(False) off, without an argument it flips it.

Example

lg.tool.rotate(True)

lg.tool.scale#

Drag to scale, Alt keeps it uniform

Synopsis

lg.tool.scale(state)

Hotkey: R.

A switch: lg.tool.scale(True) turns it on, lg.tool.scale(False) off, without an argument it flips it.

Example

lg.tool.scale(True)

lg.tool.pose#

Drag a bone to move it, drag its tip to rotate

Synopsis

lg.tool.pose(state)

Hotkey: P.

A switch: lg.tool.pose(True) turns it on, lg.tool.pose(False) off, without an argument it flips it.

Example

lg.tool.pose(True)

lg.tool.shear#

Drag to shear, Shift keeps one direction

Synopsis

lg.tool.shear(state)

Hotkey: Z.

A switch: lg.tool.shear(True) turns it on, lg.tool.shear(False) off, without an argument it flips it.

Example

lg.tool.shear(True)

lg.tool.bone_length#

Drag the tip to change the length, Alt moves the children along

Synopsis

lg.tool.bone_length(state)

Hotkey: L.

A switch: lg.tool.bone_length(True) turns it on, lg.tool.bone_length(False) off, without an argument it flips it.

Example

lg.tool.bone_length(True)

lg.tool.magic_brush#

Hold and drag over bones: they turn towards the brush centre, Esc cancels

Synopsis

lg.tool.magic_brush(state)

Hotkey: N.

A switch: lg.tool.magic_brush(True) turns it on, lg.tool.magic_brush(False) off, without an argument it flips it.

Example

lg.tool.magic_brush(True)

lg.tool.magic_smaller#

Shrink the Magic Brush radius

Hotkey: [.

Example

lg.tool.magic_smaller()

lg.tool.magic_larger#

Grow the Magic Brush radius

Hotkey: ].

Example

lg.tool.magic_larger()

Mesh#

Mesh editing and weight painting switches.

lg.mesh.edit#

Edit the selected mesh's vertices; everything else is locked (Esc or M leaves)

Synopsis

lg.mesh.edit(state)

Hotkey: M.

A switch: lg.mesh.edit(True) turns it on, lg.mesh.edit(False) off, without an argument it flips it.

Example

lg.mesh.edit(True)

lg.mesh.weight_paint#

While on, dragging in the viewport paints the chosen bone's weight onto vertices instead of selecting one (roadmap 4.6e)

Synopsis

lg.mesh.weight_paint(state)

A switch: lg.mesh.weight_paint(True) turns it on, lg.mesh.weight_paint(False) off, without an argument it flips it.

Example

lg.mesh.weight_paint(True)

Meshes and weights#

Mesh a slot's image and bind the mesh to bones.

lg.skin.mesh#

Mesh the slot's visible image: convert (4-corner mesh), trace (alpha-safe adaptive outline with preset/outset/step/chord/thin), generate (fill with interior vertices, spacing in px), reset. Trace target can be current, selected Tree slots, or all project attachments.

Synopsis

lg.skin.mesh(action, ...)
ArgumentTypeDescription
actionstr(required) Operation. One of: convert, trace, generate, reset.
slotstrSlot (required except trace target=all/selected).
slotslistSlots for trace target=selected.
targetstrTrace scope. One of: current, selected, all.
attachmentstrMake this attachment visible first.
thresholdint
presetstrTrace density preset. One of: Very Low, Low, Medium, High.
outsetfloatTransparent-side offset, px.
stepfloatBase distance between outline vertices, px.
chordfloatMaximum contour-to-chord deviation, px.
thinfloatStraight-run thinning tolerance, px.
detailfloatDeprecated Trace detail 0..1.
concavityfloatDeprecated Trace concavity 0..1.
spacingfloatGenerate spacing, px.

Example

lg.skin.mesh(slot="arm_img", action="trace", preset="Medium")

lg.skin.weights#

Bind a mesh to bones: auto (heat diffusion; restrict with 'bones' - pass the bones that should deform this part), prune (drop tiny weights below threshold), rebind.

Synopsis

lg.skin.weights(slot, action, ...)
ArgumentTypeDescription
slotstr(required) Slot.
actionstr(required) Operation. One of: auto, prune, rebind.
attachmentstrAttachment.
boneslistBones allowed to influence (auto).
thresholdfloatPrune threshold 0..1.

Example

lg.skin.weights(slot="arm_img", action="auto", bones=["arm", "forearm"])

lg.skin.get_mesh#

Mesh info for a slot: vertices, hull, triangles, which bones hold how much weight.

Synopsis

lg.skin.get_mesh(slot)
ArgumentTypeDescription
slotstr(required) Slot.

Example

print(lg.skin.get_mesh(slot="arm_img"))