Custom Shape Templates

Create a template script

  1. In project window, rightclick and select “Create→Curvy→Shape” to open the Shape Template wizard
  2. Enter a class name (best to prefix it with “CS” for “Curvy Shape”)
  3. Enter a menu name
  4. Choose if the shape provides 2D or 3D output
  5. Select Create to create the template class file

Adding functionality

You should override these members:

Member Purpose
Reset() Reset to default values
OnValidate() Input validation
ApplyShape() Create and setup Control Points

To ease working with Control Points, the parent class provides some useful methods:

Member Purpose
PrepareSpline() Setup basic spline parameters
PrepareControlPoints() Setup a bunch of Control Points
SetPosition() change CP position
SetRotation() change CP rotation
SetBezierHandleIn() change the incoming handle of Bezier segments
SetBezierHandleOut() change the outgoing handle of Bezier segments
SetBezierHandles() change both handles of Bezier segments at once
SetCGHardEdges() set hard edge flag of several Control Points
Last modified: 2015/08/04 21:29 by Jake