---
title: "snapToConstraint"
canonical: "https://help.vicon.com/space/Shogun112/31229317/snapToConstraint"
format: markdown
---
# Description

Sets the location of the selected markers to the offset of their constraint based on the current pose of the skeleton. Useful during skeleton setup, when manually creating a VST, and as a method of filling gaps. Note that [fillGaps](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31229848) `-constraints` may be more appropriate for gap filling. If no flags are used, the marker(s) only snap into place for the current frame.

## Functional area

Snap

# Command syntax

## Syntax

|  |
| --- |
| `snapToConstraint [-ranges] [-allTime] [-defaultValue] -[solvingOnly] [-labelingOnly]` |

### Arguments

None

### Flags

> Macro (scroll-tablelayout)

| **Name** | **Flag arguments** | **Argument type** | **Exclusive to** | **Comments** |
| --- | --- | --- | --- | --- |
| `ranges` | 0 | — | allTime, defaultValue | Snaps the marker(s) only over the selected ranges |
| `all time` | 0 | — | ranges, defaultValue | Snaps the marker(s) over all time |
| `defaultValue` | 0 | — | ranges, allTime | Snaps the marker(s) at the current frame and only modifies their default values. |
| `solvingOnly` |  |  |  |  |
| `labelingOnly` |  |  |  |  |

> Macro (scroll-pagebreak)

## Return value

void

## Examples

```plaintext
// Select a marker that is the source of a constraint. Move the marker
// away from its constraint offset location. Execute snapToConstraint
// to move it back to its constraint offset location.
snapToConstraint;
```

# Additional information

## Related commands

- [createSkelScript](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31230473)
- [setConstraint](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31232057)
- [snapTo](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31239319)
- [snapToLine](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31235118)
- [snapToLocal](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31233570)
- [snapToRigid](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31237482)
- [snapToSystem](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31233010)
- [snapToSystemAlign](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31234804)
- [solve](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31231226)