EditorGUI.Curvefield presets

Any way to add presets to the curve field editor?

I just saw this question a couple of hours ago.

The official answer is: NO. The CurveEditorWindow is an internal class which isn’t ment to be extended or altered in any way.

However since the preset list is stored in an internal array it’s possible to change the array. Since the CurveEditorWindow is a popup window changes to the window will be lost as soon as the window lost focus. I’ve written a “quick” Editorwindow which will inject a custom preset array into the CurveEditorWindow. This EditorWindow has to be open while using the curve editor. It saves the custom presets to the “EditorPrefs” so the presets are preserved between sessions.

I’ve put the whole script on the wiki since it’s quite long :wink:

Just get it from the wiki