Curvy Generator

The generator is an ecosystem of it's own, bound to Curvy by the fact that it uses splines as the preferable input. But that's just the regular use case, and we have some great plans for the future.

Unless otherwise explicitly stated Curvy Generator treats all Input and Output as local to the CurvyGenerator GameObject!

In short, the Curvy Generator takes some input (usually spline data), processes it and spits out the results. Some default use cases are

  • extrude a shape along a path (i.e. create a volume)
  • clone other geometry along a path or volume
  • general path manipulation (mix, transform, scale, rotate etc…)
  • more to come…

We thought and created sketches to find a proper design for months! Here are just a few problems we had to consider:

  • Should divide tons of features into “chewable” chunks
  • Must be highly extendable
  • Must be fast and should be able to use threading
  • Should be fun to work with

To make a long story short, a modular design is the only way to handle such a beast. Having modules plugged in a graph tree is a popular way to manage complex setups, done by lots of software tools like Substance Designer or Shader Tree. So we went that road, and the Curvy Generator is the result.

  • Modules can be connected by using slots, each requiring a certain data type
  • Data Types can be subtyped. E.g. Path inherits from Shape, so you can plugin a Path when a Shape is required
  • Smart Caching: if a module's input is unchanged, it returns the cached output instead of recalculating again

Curvy Generator is built from several GameObjects that needs to be properly initialized before you can access it safely. It has a IsInitialized property that you should check before trying to interact with it. For example:

IEnumerator Start ()
{
    // Wait until the generator is fully intialized before accessing it: 
    while (!CurvyGenerator.IsInitialized) 
      yield return null; 
    // now we're safe to use it 
    CurvyGenerator.SomeMethod();}
Show Debug

Show Debug Output?

Auto Refresh

Whether to automatically refresh the spline when necessary

Refresh Delay

The minimum delay between two automatic generator's refreshing while in Play mode, in milliseconds

Refresh Delay Editor

The minimum delay between two automatic generator's refreshing while in Edit mode, in milliseconds

Events

You can react to certain spline related events by adding a handler to the following UnityEvents:

OnRefresh

Called each time after the generator has refreshed