Animation Puzzles Reference — Soft8Soft
Description: How to control animation using Verge3D Puzzles.

# Animation and Constraint Puzzles

The puzzles from this category are used to perform operations with animation clips, do procedural animations, as well as restrict the movement of the objects.

## Contents

- Animation Puzzles Reference
  - play animation
  - stop animation
  - pause animation
  - resume animation
  - set animation frame
  - get animation frame
  - is anim playing
  - set animation speed
  - get animation speed
  - on animation frame do
  - get animation of
  - assign animation
  - clone animation
  - animate param
  - updated value
  - stop animate param
- Constraints Puzzles Reference
  - limit transform
  - copy transform
  - remove / mute / unmute constraint

#

## Animation Puzzles Reference

#

### play animation

Plays an animation clip. Animation clip names correspond to objects to which animation is assigned in Blender, 3ds Max, or Maya (only one animation clip can be assigned per object). Use the animation selector puzzle to provide an animation clip for this puzzle. The drop-down can be used to change the animation mode — auto allows for using the animation mode specified in the modelling suite, while the other modes override the settings specified in Blender, 3ds Max, or Maya. If the animation is already playing, this puzzles does nothing.

This puzzles supports additional options which can be activated via the gear icon. Use the from and to fields to specify the frame range. Use the speed field to specify the playback speed. The reversed checkbox enables reversed playback.

Puzzles in the when finished do slot are processed once the animation is finished (this only is valid for the once animation mode).

This puzzle also works for a list of animation clips.

#

### stop animation

Stops playing back an animation clip and resets its current frame to zero. Also works for a list of animation clips.

It won't trigger any puzzles inside the when finished do slot of the play animation puzzle.

#

### pause animation

Pauses an animation clip playback so that it can be resumed later starting from the frame it was paused on. Also works for a list of animation clips.

#

### resume animation

Resumes a previously paused animation clip. Also works for a list of animation clips.

#

### set animation frame

Sets an animation clip to a specified frame. Also works for a list of animation clips.

If the animation clip is running, this puzzle put it on pause. Use the resume animation puzzle to resume it.

#

### get animation frame

Get current frame of an animation clip.

#

### is anim playing

Checks if an animation clip (or any of animations in a list) is currently being played back.

#

### set animation speed

Changes the animation playback speed. Animation doesn't restart on speed changing. The reversed checkbox reverses the animation speed (i.e the speed is multiplied by -1). Also works for a list of animation clips.

#

### get animation speed

Get the animation playback speed.

#

### on animation frame do

Execute puzzles specified in the do slot upon animation frame.

#

### get animation of

Retrieves a specified object's animation clip. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle. The return value is always a list of animation clips (even if there is only one of them).

Basic usage examples:

The return unique animation id(s) checker in the gear popup can be used to retrieve unique animation IDs instead of names:

This option is very important in the case when having just the name is not sufficient – this is when animations are appended dynamically from another glTF file and happen to have same names.

You can use the IDs obtained by this puzzle (which look like this: 5c464bf0-043a-40ee-b864-5c026436d7de) to pass them into other animation puzzles.

#

### assign animation

Applies a specified animation clip to a different object and returns the name of the resulting animation clip.

This puzzle supports whole-object, shape key, material, and light intensity animation. Skinning animation is not supported.

If the target object already has some animation assigned, it will be replaced by the new one.

#

### clone animation

Clones an animation clip (or a list of animations) in the specified range (both inclusive).

#

### animate param

Animates a numeric parameter (or all parameters in a list or a dictionary) in between from and to, during a period specified with duration (in seconds). The easing dropdown allows you to specify the animation mode (see below).

The repeat field specifies the number of repetitions after the first animation is complete. The yoyo checkbox enables backtrack movement (works for repeat > 1).

Puzzles in the on update do slot are triggered every rendering frame while the parameter is animated. Puzzles in the when finished do slot are triggered once the animation is finished.

This puzzle wraps the Tween.js library, exposing its all 31 easing modes (pictured), duration, repeat and yoyo settings, and the update and complete callbacks.

The in-between value may be retrieved with an updated value puzzle usually placed inside the on update do slot.

#

### updated value

Returns the in-between value produced by the animate param puzzle. Depending on the type of the animated parameter, can be a number, a list or a dictionary.

This puzzle may be placed anywhere in a scenario, but naturally works in the on update do slot of the animate param puzzle where it is updated every frame.

#

### stop animate param

Stops the animation produced by the animate param puzzle.

#

## Constraints Puzzles Reference

If an object is not parented to another object, the constraints will work in world space. Otherwise they will work in the parent object's space — you can select the parent object in Blender, 3ds Max, or Maya to show up the coordinate axes.

#

### limit transform

Creates a constraint to limit object position, rotation or scale along a selected axis. Constraint id should be unique, otherwise an existing constraint with the same id will be replaced. The min and max slots specify the range between which the movement is allowed. The constraint can limit distance between two objects, thus distance slot specifies the distance limit, i.e. the radius of the constraining sphere, equal, max, min modes constrain on surface, inside, outside the sphere.

#

### copy transform

Creates a constraint to copy object position, rotation, scale or all transforms from another object. Constraint id should be unique, otherwise an existing constraint with the same id will be replaced.

#

### remove / mute / unmute constraint

Removes, mutes or unmutes a constraint assigned to a specified object. Other constraints assigned to this object (if any) will remain intact.

## Having Troubles with Puzzles?

Seek help on the forums!