0.0.1 • Published 3 years ago
obs-anim-js v0.0.1
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.1
3 years ago