Visualize Your Ideas With Code
docs: added rendering page to the quickstart guides (#49)
Ross Esmond0e111b94291e
diff --git a/packages/docs/docs/guides/getting-started/quickstart.mdx b/packages/docs/docs/guides/getting-started/quickstart.mdxindex ea5fc1da..61e2ecb2 100644--- a/packages/docs/docs/guides/getting-started/quickstart.mdx+++ b/packages/docs/docs/guides/getting-started/quickstart.mdx@@ -1,5 +1,5 @@----sidebar_position: 2+sidebar_position: 1---import ReactPlayer from 'react-player'diff --git a/packages/docs/docs/guides/getting-started/rendering.md b/packages/docs/docs/guides/getting-started/rendering.mdnew file mode 100644index 00000000..77ce71e1--- /dev/null+++ b/packages/docs/docs/guides/getting-started/rendering.md@@ -0,0 +1,88 @@+---+sidebar_position: 2+---++# Rendering an Animation++To render an animation, open the Rendering panel in the top left of the screen+using the button with the icon below.++++You should see a panel titled "RENDERING" with several fields and a Render+button. The default settings are sufficient to render the animation, but we will+explore some of the options.++### Options++##### Range++The Range is the span of frames that will render. If set to a smaller range than+the entire length of the video, it will only render a portion of the frames in+your animation. This can be useful for quickly rendering small changes in your+animation.++##### FPS (Frames Per Second)++The frame rate at which the preview plays and the number of frames that will+render per one second of runtime. The most common values are 24, 30, and 60,+though any whole integer value is allowed. Motion Canvas animations are+resilient to changes in frame rate, so most animations will not be affected by+changing the FPS.++##### Resolution++The resolution in pixels of each frame in the video. You may use this value to+render in a higher resolution or to change the aspect ratio. Note, however, that+animations will not scale with changes in resolution, so plan ahead for any+adjustments to resolution.++##### Scale++Scale will increase or decrease the resolution of the animation, but, unlike the+Resolution option, the coordinates and size of animation elements will be+adjusted as well. You may use this option to render in multiple different+resolution densities or to adjust your output resolution after completing an+animation.++##### Color Space++The HTML Canvas color space to use when previewing or rendering the animation.+Current options include sRGB, a common color space for images and video, and+DCI-P3, a wide-gamut color space.++##### File Type++The type of image file to which Motion Canvas will convert the frames. Current+options are PNG, JPEG, and WebP. Note that Motion Canvas depends on the+capabilities of your browser to generate image files, and so WebP may not work+on Safari or older browsers.++##### Quality++The quality target for compression from 0 to 1, where a lower setting will+result in smaller file sizes but might degrade image quality. A setting of 1+will result in lossless images, such that no detail is lost, but lower settings+will often produce no discernible difference. Note that output to a file type of+PNG does not allow for different quality settings, so this option will be+ignored when outputting to PNG.++### The Output++After clicking the Render button, Motion Canvas will play through the animation+and save each frame as an image to `/output` in your project directory. The+target output direction may be configured in `vite.config.js`, however, by+setting the `output` property in the `motionCanvas` plugin options.++```js+export default defineConfig({+ plugins: [+ motionCanvas({+ output: './custom',+ }),+ ],+});+```++You may then import your animation as frames into a video editor of your choice,+or convert the frames directly to a video using a tool like `ffmpeg`.diff --git a/packages/docs/static/img/rendering_icon.svg b/packages/docs/static/img/rendering_icon.svgnew file mode 100644index 00000000..db564342--- /dev/null+++ b/packages/docs/static/img/rendering_icon.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="#ffffff"><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M3,6h18v5h2V6c0-1.1-0.9-2-2-2H3C1.9,4,1,4.9,1,6v12c0,1.1,0.9,2,2,2h9v-2H3V6z"/><polygon points="15,12 9,8 9,16"/><path d="M22.71,18.43c0.03-0.29,0.04-0.58,0.01-0.86l1.07-0.85c0.1-0.08,0.12-0.21,0.06-0.32l-1.03-1.79 c-0.06-0.11-0.19-0.15-0.31-0.11L21.23,15c-0.23-0.17-0.48-0.31-0.75-0.42l-0.2-1.36C20.26,13.09,20.16,13,20.03,13h-2.07 c-0.12,0-0.23,0.09-0.25,0.21l-0.2,1.36c-0.26,0.11-0.51,0.26-0.74,0.42l-1.28-0.5c-0.12-0.05-0.25,0-0.31,0.11l-1.03,1.79 c-0.06,0.11-0.04,0.24,0.06,0.32l1.07,0.86c-0.03,0.29-0.04,0.58-0.01,0.86l-1.07,0.85c-0.1,0.08-0.12,0.21-0.06,0.32l1.03,1.79 c0.06,0.11,0.19,0.15,0.31,0.11l1.27-0.5c0.23,0.17,0.48,0.31,0.75,0.42l0.2,1.36c0.02,0.12,0.12,0.21,0.25,0.21h2.07 c0.12,0,0.23-0.09,0.25-0.21l0.2-1.36c0.26-0.11,0.51-0.26,0.74-0.42l1.28,0.5c0.12,0.05,0.25,0,0.31-0.11l1.03-1.79 c0.06-0.11,0.04-0.24-0.06-0.32L22.71,18.43z M19,19.5c-0.83,0-1.5-0.67-1.5-1.5s0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5 S19.83,19.5,19,19.5z"/></g></g></svg>