Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for expressions #437

Open
akre54 opened this issue Jul 27, 2023 · 0 comments
Open

Support for expressions #437

akre54 opened this issue Jul 27, 2023 · 0 comments
Labels
in progress An issue that is currently being worked on

Comments

@akre54
Copy link
Contributor

akre54 commented Jul 27, 2023

One thing I'm finding as I'm using Theatre a lot is I wish there were support for expressions as inputs, most notably math around addition, frame number, or time.

Things like:

  1. $F for frame number, $T for current time, $FEND for end frame
  2. Math: sin($T * 2)
  3. Logic: $F > 2
  4. Parameters: obj('box1').width * 2

Some prior art can be found in TouchDesigner, After Effects, Blender, or Houdini.

Two ways to go about doing this: the first is to use a Worker with the variables loaded in as globals, and the second is to use a parser (like jsep) and then operate on the AST. The first way is a bit more similar to After Effects and allows really complex scripts. The second is a bit more similar to the inline code in Houdini and TD (though both support complex logic in a node).

I recognize this adds a considerable surface area (not to mention security concerns) but I mostly want to open this up for discussion. Does theatre want all of this logic handled in code, and have the inputs kept strictly as scalar and string values? My ideal would be to allow more of this logic to live in the individual projects, and then the code can provide more of a "shell" to just handle the rendering. Happy to discuss more.

@AriaMinaei AriaMinaei added the in progress An issue that is currently being worked on label Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress An issue that is currently being worked on
Projects
None yet
Development

No branches or pull requests

2 participants