Clear
Back

Procedural Animation

If a 3D object has a skeleton, you can use patches to set how the joints in the skeleton move - animating the object. This is called procedural animation.

To test this out, import your own 3D object or choose from a huge selection in the AR Library.

You can apply the same technique to other types of object, like the mesh that make up a 3D object, to add animation to your effects.

Find the joint you want to animate

Expand your object in the Scene panel and select the joint you want to animate.

In the example below, we’ve added an object called boombox_animated to our scene. It’s made up of several mesh and a skeleton with 3 joints. We’ve selected a joint called base_jnt which will allows us to animate the base of the object.

Create a patch to represent the position, rotation or scale of the joint

In the Inspector, create a patch to represent either the position, rotation or scale of the joint.

You’d choose:

  1. Position to move the object between different positions.
  2. Rotation to rotate the object.
  3. Scale to make the object get bigger and smaller.

To create the patch, just click the arrow next to the property.

In the example below, we’ve created a patch to represent the scale of the joint.

Create a Loop Animation and Transition patch

You’ll use two patches, Loop Animation and Transition, to animate the joint.

The Loop Animation patch and Transition patches are usually used together. This is because the Loop Animation patch controls the progress of an animation, and the Transition patch can be configured to control how and where the object moves.

To create these patches:

  1. Right-click in the Patch Editor and select a Loop Animation patch from the menu.
  2. Right-click again and select a Transition patch.

Connect the patches and edit their values

Connect:

  1. The Progress output of the Loop Animation patch to the Progress input in the Transition patch.
  2. The output of the Transition patch to the patch representing the property you want to animate.


Editing the patches

Next edit the Loop Animation patch:

  • Change the Duration value to slow the animation down or speed it up.
  • Check the box next to Mirrored to mirror the movement back and forth.

In the Transition patch, set values for the object to animate between. For example, if we set each value next to Start to 0.9, the object will get very slightly bigger:



Finally, it’s worth taking a look at the Curve value in the Transition patch. You can adjust this to set the pacing of the movement. It's worth experimenting with this option in your own effects.

Learn more

Join the Spark AR Creator's community

Find inspiration, see examples, get support, and share your work with a network of creators.

Join Community

Join the Spark AR Creator's community

Find inspiration, see examples, get support, and share your work with a network of creators.

Join Community

Frequently asked questions

Have a specific question? Maybe it's been answered.


Read FAQs
Was this document helpful?