Skip to main content

Motion Canvas v3.15.0

ยท 4 min read
Jacob
Motion Canvas Creator

New features ๐ŸŽ‰โ€‹

  • aarthificial's avatar

    A brand-new

    Code

    node with dedicated code signals, customizable syntax highlighting, and more expressive animation system (Including automatic diff-based transitions).

    #946
    Press play to preview the animation
    import ...

    export default makeScene2D(function* (view) {
    const code = createRef<Code>();

    view.add(
    <Code
    ref={code}
    fontSize={28}
    fontFamily={'JetBrains Mono, monospace'}
    offsetX={-1}
    x={-400}
    code={'const number = 7;'}
    />,
    );

    yield* waitFor(0.6);
    yield* all(
    code().code.replace(code().findFirstRange('number'), 'variable', 0.6),
    code().code.prepend(0.6)`function example() {\n `,
    code().code.append(0.6)`\n}`,
    );

    yield* waitFor(0.6);
    yield* code().selection(code().findFirstRange('variable'), 0.6);

    yield* waitFor(0.6);
    yield* all(
    code().code('const number = 7;', 0.6),
    code().selection(DEFAULT, 0.6),
    );
    });

  • aarthificial's avatar

    New

    withDefaults

    helper function lets you quickly extend nodes with your own defaults.

    #982
    import {Txt, withDefaults} from '@wangyaoshen/locus-2d';

    export const MyTxt = withDefaults(Txt, {
    fill: 'rgba(255, 255, 255, 0.6)',
    fontFamily: 'JetBrains Mono',
    fontSize: 28,
    });
  • aarthificial's avatar

    When using

    loop

    , the iteration count can be omitted to create an infinite loop:

    #952
    // These two are equivalent:
    yield* loop(() => { /* animation */ });
    yield* loop(Infinity, () => { /* animation */ });
  • aarthificial's avatar

    New

    spawn

    function lets you run animations in the background, from any place, without needing to yield them.

    #951
  • aarthificial's avatarPolygon

    now extends

    Curve

    giving it access to all curve-related properties like

    startArrow

    and

    radius

    .

    #961
  • jmaen's avatar

    Color fields in the editor now come with a visual color picker.

    #962
  • aarthificial's avatar

    New

    Vector2

    methods: #985

  • aarthificial's avatar

    New

    cardinalPoint

    method lets you map

    Origin

    s and

    Direction

    s to their corresponding cardinal points of the node.

    #988
  • aarthificial's avatar

    New

    waitTransition

    lets you animate transitions using nodes.

    #983
  • aarthificial's avatar

    When passed to OpenGL,

    Matrix2D

    is now converted to a 3x3 square matrix (as opposed to a 3x2 matrix)

    #984
  • aarthificial's avatar

    The view's

    cachePadding

    is now respected when calculating the cache size of individual nodes.

    #986
  • Niikelion's avatar

    Presentation Mode now supports PowerPoint shortcuts (Page Up, Page Down, etc.)

    #993
  • nvborisenko's avatar

    Parts of the motion-canvas-player shadow root are now exposed using part and can be customized with CSS.

    #956
  • aarthificial's avatar

    Fiddles on this website now play automatically when scrolled into view.

    #1001

Fixed bugs ๐Ÿ›โ€‹

  • CactusPuppy's avatar

    Account for italic fonts in cache.

    #968
  • rogerpinho's avatar

    Fix typo in the Quickstart Guide.

    #974
  • aarthificial's avatar

    Properly handle offset when retrieving the absolute position of a node.

    #987
  • aarthificial's avatar

    Fix the spline warning for reactive points.

    #981

Check out the Update Guide for information on how to update your existing projects.