Custom Shape Templates
Create a template script
- In project window, rightclick and select “Create→Curvy→Shape” to open the Shape Template wizard
- Enter a class name (best to prefix it with “CS” for “Curvy Shape”)
- Enter a menu name
- Choose if the shape provides 2D or 3D output
- 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 |