|
@@ -1,4 +1,5 @@
|
|
|
package hrt.prefab;
|
|
|
+import hide.comp.CurveEditor;
|
|
|
using Lambda;
|
|
|
|
|
|
class CurveHandle {
|
|
@@ -69,6 +70,11 @@ class Curve extends Prefab {
|
|
|
loop = o.loop;
|
|
|
if(o.keyMode != null)
|
|
|
keyMode = o.keyMode;
|
|
|
+
|
|
|
+ if( keys.length == 0 ) {
|
|
|
+ addKey(0.0, 0.0);
|
|
|
+ addKey(1.0, 1.0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public override function save() {
|
|
@@ -256,15 +262,17 @@ class Curve extends Prefab {
|
|
|
#if editor
|
|
|
override function edit( ctx : EditContext ) {
|
|
|
super.edit(ctx);
|
|
|
-
|
|
|
ctx.properties.add(new hide.Element('
|
|
|
- <div class="group" name="Parameters">
|
|
|
- <dl>
|
|
|
- <dt>Loop curve</dt><dd><input type="checkbox" field="loop"/></dd>
|
|
|
- </dl>
|
|
|
- </div>'), this, function(pname) {
|
|
|
+ <div class="group" name="Parameters">
|
|
|
+ <dl>
|
|
|
+ <dt>Loop curve</dt><dd><input type="checkbox" field="loop"/></dd>
|
|
|
+ </dl>
|
|
|
+ </div>'), this, function(pname) {
|
|
|
ctx.onChange(this, pname);
|
|
|
});
|
|
|
+
|
|
|
+ var ce = new CurveEditor(ctx.properties.undo, ctx.properties.element);
|
|
|
+ ce.curve = this;
|
|
|
}
|
|
|
|
|
|
override function getHideProps() : HideProps {
|