2d-inc / Flare-JS

Flare Javascript ES6 runtime with Canvas rendering.
https://flare.rive.app
MIT License
265 stars 59 forks source link

There is no way to import an FLR (JSON) file into the "Rive/Flare" interface. #38

Open askoj opened 4 years ago

askoj commented 4 years ago

Currently, when I try to import FLR JSON files, they don't appear on the Artboard.

While alternatively I could just import from a binary export, the reason I'm requesting that FLR JSON formats be recognised for importability is that I may want to manipulate the FLR file via some external software after working with it in the console.

umberto-sonnino commented 4 years ago

flr files are just meant to be used with our runtimes.

What you're probably looking for is the "Download File" button in the Export Menu. With that, you'll be able to download a flr2d file, that is a backup at your current revision, you can drag-and-drop within the Editor.

askoj commented 4 years ago

I understand what you are saying, although I need something from you.

TLDR: What is the script that is triggered when an individual presses "Export to flr2d" that generates binary from the Artboard class?

Essentially, what I'm doing is developing a 'motion capture' middleware for your system. The idea is that me and my mates get in motion capture suits, film motion detection videos through 'Apple Motion 5', and then use an exporter to translate the movements into the flr json format, so that we can animate from real movements.

So far, I've developed the exporter, which can punch out an flr json file from the filmed movements, however I recognise that it isn't the same as your flr2d format, which is a binary representation, encoded using the ActorLoader.js file I'm pretty sure.

While you're correct in that your system doesn't allow flr imports, the coded example in this repository does. I've forked it, and have managed to simulate movements, however I can't then convert that into flr2d which is important, because I want to be able to import the file back into the online interface.

What code file is used to translate an ephemeral instance of the Artboard class into the flr2d format?

Thanks again for your time.