Rive Animations

dylantarre/animation-principles/skills/09-by-tool-framework/rive-animations

作者 dylantarre83597134ba8f無授權條款99 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫9 個月前更新

Use when implementing Disney's 12 animation principles with Rive interactive animations

僅含說明Design & Creative
AI 產生的概覽

指導如何在 Rive 互動動畫中透過狀態機與執行階段程式碼實作迪士尼十二項動畫原則。

功能
此技能說明如何運用 Rive 編輯器功能與執行階段 API 套用迪士尼十二項動畫原則。內容涵蓋擠壓伸展、預備動作、場面調度、時間節奏、跟隨與重疊動作、弧線、誇張與吸引力,並提供狀態機設定、緩動建議以及 JavaScript 或 React 程式碼片段。它產出的是實作指引,而非檔案或指令碼。
適用情境
在製作 Rive 互動動畫並希望套用經典動畫原則時使用。適合涉及 Rive 狀態機、輸入、觸發器,以及網頁或 React 專案中執行階段播放控制的工作。
執行需求
需要熟悉 Rive 編輯器及其執行階段 API;React 範例假定使用 @rive-app/react-canvas 套件。此技能未附任何指令碼。

Rive Animation Principles

Implement all 12 Disney animation principles using Rive's state machine and interactive animations.

1. Squash and Stretch

In Rive Editor:

  • Create shape with bones
  • Animate scale X/Y with inverse relationship
  • Key: scaleX: 1.2 when scaleY: 0.8
javascript
// Trigger from coderive.play('squash_stretch');

2. Anticipation

State Machine Setup:

  1. Create "Idle" state
  2. Create "Anticipate" state (wind-up pose)
  3. Create "Action" state
  4. Connect: Idle → Anticipate → Action
javascript
const inputs = rive.stateMachineInputs('State Machine');const trigger = inputs.find(i => i.name === 'jump');trigger.fire(); // Plays anticipate → action sequence

3. Staging

In Rive:

  • Use artboard layers for depth
  • Apply blur/opacity to background layers
  • Use nested artboards for complex scenes
javascript
// Control visibilityconst bgOpacity = inputs.find(i => i.name === 'bgOpacity');bgOpacity.value = 0.6;

4. Straight Ahead / Pose to Pose

Pose to Pose in Rive:

  • Set key poses on timeline
  • Rive interpolates between
  • Use easing curves in Graph Editor

5. Follow Through and Overlapping Action

In Rive Editor:

  • Use bone hierarchy with constraints
  • Apply "delay" or "lag" to child bones
  • Or offset keyframes by 2-4 frames
  • Use spring constraints for natural follow-through

6. Slow In and Slow Out

In Rive Graph Editor:

  • Select keyframes
  • Apply easing: Cubic, Quad, Bounce
  • Adjust bezier handles for custom curves
javascript
// Runtime speed controlrive.play('animation', { speed: 0.5 });

7. Arc

In Rive:

  • Use IK (Inverse Kinematics) for natural arcs
  • Apply path constraints
  • Animate position with curved interpolation

8. Secondary Action

State Machine approach:

javascript
// Listen for state changesrive.on('statechange', (event) => {  if (event.data.includes('button_press')) {    // Secondary animations auto-trigger via state machine  }});
// Or blend multiple animationsrive.play(['main_action', 'secondary_particles']);

9. Timing

javascript
// Fast - snappy feedbackrive.play('click', { speed: 1.5 });
// Normalrive.play('hover');
// Slow - dramatic revealrive.play('reveal', { speed: 0.5 });

In Rive Editor:

  • Adjust animation duration
  • Use work area to fine-tune timing
  • Graph Editor for precise control

10. Exaggeration

In Rive:

  • Push bone rotations beyond natural limits
  • Exaggerate scale transformations
  • Use elastic/bounce interpolation
  • Overshoot in Graph Editor curves

11. Solid Drawing

In Rive:

  • Use multiple bones for volume preservation
  • Apply constraints to maintain form
  • Use clipping for depth illusion
  • Layer shapes for 3D effect

12. Appeal

Design in Rive:

  • Smooth bezier curves on shapes
  • Consistent stroke weights
  • Pleasing color palette
  • Clean bone structure
javascript
// Smooth hover interactionsconst hover = inputs.find(i => i.name === 'isHovering');element.addEventListener('mouseenter', () => hover.value = true);element.addEventListener('mouseleave', () => hover.value = false);

React Implementation

jsx
import { useRive, useStateMachineInput } from '@rive-app/react-canvas';
function AnimatedButton() {  const { rive, RiveComponent } = useRive({    src: 'button.riv',    stateMachines: 'Button',    autoplay: true  });
  const hoverInput = useStateMachineInput(rive, 'Button', 'isHovering');
  return (    <RiveComponent      onMouseEnter={() => hoverInput.value = true}      onMouseLeave={() => hoverInput.value = false}    />  );}

Key Rive Features

  • State Machines - Logic-driven animation flow
  • Inputs - Boolean, Number, Trigger types
  • Blend States - Mix multiple animations
  • Listeners - Pointer events in editor
  • Constraints - IK, path, distance, rotation
  • Bones & Meshes - Skeletal animation
  • Runtime API - Full control from code
  • Tiny file size - Optimized binary format

來源與署名

來源:dylantarre/animation-principles位於skills/09-by-tool-framework/rive-animations提交8359713

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架