Quickstart
In this section we're going to guide you through creating your own simple animation using Rebelle Motion IO.
Download project files
- quickstart.json - Animation commands for Rebelle
Prepare a JSON file for Rebelle
First we need to create a JSON file with events (commands) grouped into animation frames (for more info in the JSON Events Reference section). In the following JSON file, we will:
- Setup a new artwork
- Select a brush and its parameters
- Paint a single curved stroke through multiple points
- Add some more animation frames with several simulation steps
Save the following file as quickstart.json
(or download it from the link above).
{"frames":[
{"events":[
{
"event_type": "NEW_ARTWORK",
"width": 640,
"height": 480,
"units": "px",
"dpi": 200,
"paper": {
"preset": "Default/HM01 Handmade",
"color": { "r": 255, "g": 255, "b": 255 },
"deckled_edges": true,
"paper_scale": 150
}
},
{
"event_type": "SET_BRUSH",
"tool": "WATERCOLOR",
"preset": "Gouache/Gouache Filbert",
"size" : 40,
"water": 55,
"opacity": 10,
"paint_type": "PAINT",
"glaze_mode": "OPAQUE",
"color": { "r": 64, "g": 127, "b": 200 }
},
{ "event_type": "POINTER_PRESS" , "pos": { "x": 100, "y": 100 } },
{ "event_type": "POINTER_MOVE" , "pos": { "x": 200, "y": 200 } },
{ "event_type": "POINTER_MOVE" , "pos": { "x": 300, "y": 100 } },
{ "event_type": "POINTER_MOVE" , "pos": { "x": 400, "y": 300 } },
{ "event_type": "POINTER_RELEASE", "pos": { "x": 400, "y": 300 } }
]},
{"events":[
{ "event_type": "SIMULATION", "repeats": 10 }
]},
{"events":[
{ "event_type": "SIMULATION", "repeats": 10 }
]},
{"events":[
{ "event_type": "SIMULATION", "repeats": 10 }
]},
{"events":[
{ "event_type": "SIMULATION", "repeats": 10 }
]}
]}
Run Rebelle
Tell Rebelle to process the JSON file and generate animation frames to the out/
folder.
mkdir out
"C:/Program Files/Rebelle 6 Motion IO/Rebelle 6 Motion IO.exe" \
-batch-json "quickstart.json" \
-batch-out-rgba "out/####.png"
Convert animation frames to a video
Animation frames exported from Rebelle have transparent background, so we need to first add a solid background to them e.g. using ImageMagick's convert
storing output files to the out_bg
folder.
mkdir out_bg
for i in `ls "./out"`; do
convert out/$i -background white -flatten out_bg/$i
done
Now we can create the final video out_bg.mp4
:
num_frames=$(ls "out_bg"/* | wc -l)
framerate=2
ffmpeg -y -framerate $framerate -i "out_bg/%04d.png" -pix_fmt yuv420p -c:v libx264 -preset slow -crf 18 "out_bg.mp4"