Giter Club home page Giter Club logo

fbrelation's Introduction

fbrelation

fbrelation is a simple declarative language for creating MotionBuilder relation constraints. After writing a lot of cumbersome scripts to manipulate relation constraints with pyfbsdk, I decided to take a stab at improving that process as a weekend project. The resulting language takes inspiration from Graphviz DOT and looks like this:

linear_interpolate
{
    # Macro input boxes
    a [input="Number"]
    b [input="Number"]
    t [input="Number"]

    # Operations
    sub  [group="Number", type="Subtract (a - b)"]
    mult [group="Number", type="Multiply (a x b)"]
    add  [group="Number", type="Add (a + b)"]

    # Macro output
    r [output="Number"]

              b -> sub.a   # b - a
              a -> sub.b

     sub.Result -> mult.a  # (b - a) * t
              t -> mult.b

              a -> add.a   # a * ((b - a) * t)
    mult.Result -> add.b

     add.Result -> r
}

Documentation

Online documentation is available here:

Full documentation is included with the source and can be built using Sphinx.

Limitations

There are a few major areas for improvement in the current implementation:

  • When the interpreter creates relation constraints, it does not arrange their boxes in a way that's particularly organized or aesthetically pleasing. Procedural layout functionality could be added, and support could be added for manually specifying x and y coordinates in boxes' attribute lists.

  • Some syntactic sugar could be added for various shortcuts in connection declarations. For example, it'd be handy to be able to declare a connection straight from a vector output to a number input, and have the interpreter automatically create the necessary converters, e.g.: cube.Translation.X -> camera.Roll

  • Constants can not currently be connected to input nodes, e.g.: (90.0, 0.0, 0.0) -> null.Lcl Rotation. As discussed below, the API doesn't support connecting constants at all, so this addition would need to use a sender component to contain these values as custom properties.

Additionally, some significant limitations of the MotionBuilder API prevent this library from being very useful in production:

  • The API does not provide a means of plugging constant values into a box's input nodes.

  • The API does not provide a means of renaming the animation nodes of macro input and output boxes from the default names of "Input" and "Output".

  • Once a function box is added to a relation constraint, there's no way to determine the box's type or group name. This omission from the API makes it impossible to reliably serialize already-authored relation constraints into fbrelation programs, meaning that the library only works one-way.

fbrelation's People

Contributors

awforsythe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.