0.0.9 • Published 3 years ago

obs-animation v0.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

obs-animation

Animating OBS scene items is difficult. This library aims to fix that.

obs-animation provides a keyframe-based API for animating items in your OBS scenes. Simply load your scene items into your code, construct a timeline containing keyframes for them to animate along, and trigger the animations. obs-animation will handle interpolation, easing and request batching so that you can focus on animating!

To get started, connect to OBS websocket:

await obs.connect(address)

Then load in your scene items and the scenes they are in:

const cameraItem = sceneItem("Camera")
const mainScene = scene("Main Scene", [cameraItem])

await obs.loadScene(mainScene)

Construct a timeline of keyframes for a scene item to follow:

const cameraTimeline = timeline({
    500: {
        x: 0,
        y: 0,
    },
    1000: {
        x: obs.width - cameraItem.transform.width,
        y: obs.height - cameraItem.transform.height
    }
})

Finally, play the animation!

animate(cameraItem, cameraTimeline)

More documentation will be added later but for now see tests for more examples.

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3-1

3 years ago

0.0.1-0

3 years ago

0.0.3-a

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago