|
@@ -2,13 +2,10 @@ package hrt.animgraph;
|
|
|
|
|
|
typedef Edge = {target: Node, outputIndex: Int};
|
|
|
|
|
|
-#if editor
|
|
|
-
|
|
|
enum OutputType {
|
|
|
TFloat;
|
|
|
TAnimation;
|
|
|
}
|
|
|
-
|
|
|
typedef NodeOutputInfo = {
|
|
|
name: String,
|
|
|
type: OutputType,
|
|
@@ -16,7 +13,6 @@ typedef NodeOutputInfo = {
|
|
|
|
|
|
typedef NodeInputInfo = { > NodeOutputInfo, ?def : Dynamic };
|
|
|
|
|
|
-#end
|
|
|
@:build(hrt.animgraph.Macros.build(false))
|
|
|
@:autoBuild(hrt.animgraph.Macros.build(true))
|
|
|
@:keep
|
|
@@ -32,6 +28,7 @@ implements hide.view.GraphInterface.IGraphNode
|
|
|
|
|
|
@:s public var x : Float;
|
|
|
@:s public var y : Float;
|
|
|
+ public var id : Int;
|
|
|
public var inputEdges: Array<Edge> = [];
|
|
|
var animGraph : AnimGraph;
|
|
|
|
|
@@ -95,9 +92,20 @@ implements hide.view.GraphInterface.IGraphNode
|
|
|
return inst;
|
|
|
}
|
|
|
|
|
|
+ // Autogenerated macro interface
|
|
|
+
|
|
|
+ // Do not override
|
|
|
+ public function getInputs() : Array<NodeInputInfo> {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ // Do not override
|
|
|
+ public function getOutputs() : Array<NodeOutputInfo> {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
#if editor
|
|
|
|
|
|
- public var id : Int;
|
|
|
public static var __nodeUID : Int = 0;
|
|
|
|
|
|
public var editor : hide.view.GraphEditor;
|
|
@@ -115,18 +123,6 @@ implements hide.view.GraphInterface.IGraphNode
|
|
|
return SIZE_DEFAULT;
|
|
|
}
|
|
|
|
|
|
- // Autogenerated macro interface
|
|
|
-
|
|
|
- // Do not override
|
|
|
- public function getInputs() : Array<NodeInputInfo> {
|
|
|
- return [];
|
|
|
- }
|
|
|
-
|
|
|
- // Do not override
|
|
|
- public function getOutputs() : Array<NodeOutputInfo> {
|
|
|
- return [];
|
|
|
- }
|
|
|
-
|
|
|
// If not present in the child classes, will default to the class name
|
|
|
// Auto overriden by build macro
|
|
|
public function getDisplayName() : String {
|
|
@@ -181,16 +177,6 @@ implements hide.view.GraphInterface.IGraphNode
|
|
|
y = p.y;
|
|
|
}
|
|
|
|
|
|
- // Static helpers
|
|
|
- static public var registeredNodes = new Map<String, Class<Node>>();
|
|
|
-
|
|
|
- // Used by macros to auto-register nodes
|
|
|
- @:noCompletion
|
|
|
- static public function register(name: String, cl: Class<Node>) : Bool {
|
|
|
- registeredNodes.set(name, cl);
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
static function getTypeColor(type: OutputType) : Int {
|
|
|
switch(type) {
|
|
|
case TAnimation:
|
|
@@ -204,4 +190,14 @@ implements hide.view.GraphInterface.IGraphNode
|
|
|
return a == b;
|
|
|
}
|
|
|
#end
|
|
|
+
|
|
|
+ // Static helpers
|
|
|
+ static public var registeredNodes = new Map<String, Class<Node>>();
|
|
|
+
|
|
|
+ // Used by macros to auto-register nodes
|
|
|
+ @:noCompletion
|
|
|
+ static public function register(name: String, cl: Class<Node>) : Bool {
|
|
|
+ registeredNodes.set(name, cl);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|