01.04.2024 01:45
Nej Ravindran
portfolio

I am tinkering with MotionIO.  My objective is to create a .NET library that eases the generation of the JSON script.  This is my day #1, and so far, I have been able to make a basic object model, where I could create an artwork, add frames and events to it, generate JSON script, and run it through MotionIO command line to produce the png frames.  Next, I am planning to automate the creation of the movie out of the generated frames.  Afterwards, I would like to build a UI that eases the creation of the script/creation of simple animations so even people without technical background can create the script.  In my mind ideally, the movie creation should be done in a completely automated and headless way. If I become successful, I will share my work with the community here. So I have a few questions.  Hopefully, someone in the Escape Motions dev team can answer these:

1. How can I run MotionIO headless way.  I already saw the "no-gui" option in the documentation, but that does not seem to work.  I am on Windows 11, and the command I use is: "C:\Program Files\Rebelle 7 Motion IO\Rebelle 7 Motion IO.exe" -no-gui -batch-json "rebelle.json" -batch-out-rgba "out/####.png".  When I issue this command, MotionIO does show its window.

2. Is there any way to reuse the instance of the currently running MotionIO, rather than starting it every time to make the process a little faster.

3. Is there any way to get the output as a byte array or stream than a bunch of png files (eg. through the std output)?  Ideally one frame at a time.

4. What exactly is meant by simulation?  Is it the transition of the paint on the paper?  If yes, is it applicable only for watercolor?

5. If I do not set an event property in the JSON, how do I know what is the default?

 

 

 

            

07.05.2024 05:18
Michal Escape Motions
Team Member portfolio

Hi Nej,

I'm really sorry for my late reply. We've been working a lot on fixing Rebelle 7 bugs and I forgot to check the Motion IO section of our forum.

I'll be really happy to see your project when it's ready! Fingers crossed!

1. The headless mode of Motion IO was used only on custom linux builds running on a render farm with headless nodes. Rebelle doesn't run without a display, but on linux there is Xvfb (basically a software emulated display) which allows Rebelle UI to be rendered to a virtual framebuffer so that it seems like it doesn't have any UI. I don't know if there is a similar tool for Windows. You may have more luck on macOS, but I haven't tried that either.

2. That's not possible now. Processing each JSON file requires starting a new Rebelle instance.

3. There's no such stream output available, just writing output to files. I'm not sure what kind of a stream output would be ideal for this. Each frame may output multiple images and even input multiple images. Maybe a websocket interface could be useful for this. To find your way around it, you can just listen to stdout so that you know which frame was already processed and written (https://www.escapemotions.com/products/rebelle/motionio_doc/reference/console_output) and/or use a filesystem watcher to monitor the output folder.

4. Simulation step is a single iteration of the Rebelle fluid simulation which is used only for wet media (watercolors, inks, water). If you use only dry media, you don't need to care about simulation events in Motion IO.

5. It depends on the event type you use but in general it behaves the same as when you use Rebelle directly via its UI. E.g. when you select a brush preset, all its parameters are loaded into Rebelle. So if it has "size: 50" then it's the default value of the size parameter in the SET_BRUSH event:

{
"event_type": "SET_BRUSH",
"tool": "WATERCOLOR",
"preset": "Default/MyBrush1"
}

If you need size: 20, you have to override the default value:

{
    "event_type": "SET_BRUSH",
    "tool": "WATERCOLOR",
    "preset": "Default/MyBrush1",
    "size" : 20
}

Default values of other events like SET_ENGINE_PARAMS are loaded from your settings.ini file located in your "library folder" (Rebelle's main menu -> Help -> Show Library Folder... -> Data -> settings.ini)

If you find an event param where it should be specified which default value it has, please let us know, we could update it in the documentation.