Skip to content

Support hot-reload preview #76

@AzurIce

Description

@AzurIce

The main purpose is to offer more convinience experience when writing anim, and attempt to reduce user's compile time.

User will write their Scene code in a lib crate with dylib crate-type.

Thus, the meta info of scene and the preview/render target all needs to be done in "lib" instead of "main".

So, we can use linkme, and wrap it into a ranim's macro for preview and render.

Then, defining a scene to be previewed/rendered will be like this:

#[preview]
#[render(name = "output", fps = 60]
fn arc() -> Box<dyn SceneConstructor> {
    Box::new(ArcScene)
}

This introduces a new crate ranim-cli:

  • ranim preview: launch a preview app, watch the lib crate and rebuild it to dylib when it is changed, then reload it and applies to the preview app.
  • ranim render: build the lib crate and load it, then render it to video.

And there may be a complete re-organization of crates layout in the near future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions