Files
armorpaint/Sources/arm/nodes/NodesBrush.hx
T
luboslenco a16722cd72 Brush mask
2019-08-06 14:40:29 +02:00

411 lines
7.0 KiB
Haxe

package arm.nodes;
import zui.Nodes;
class NodesBrush {
public static var categories = ["Nodes"];
public static var list:Array<Array<TNode>> = [
[ // Category 0
{
id: 0,
name: "Input",
type: "InputNode",
x: 0,
y: 0,
color: 0xff4982a0,
inputs: [],
outputs: [
{
id: 0,
node_id: 0,
name: "Position",
type: "VECTOR",
color: 0xff63c763,
default_value: null
}
],
buttons: []
},
// {
// id: 0,
// name: "Brush Output",
// type: "BrushOutputNode",
// x: 0,
// y: 0,
// color: 0xff4982a0,
// inputs: [
// {
// id: 0,
// node_id: 0,
// name: "Position",
// type: "VECTOR",
// color: 0xff63c763,
// default_value: [0.0, 0.0, 0.0]
// },
// {
// id: 0,
// node_id: 0,
// name: "Radius",
// type: "VALUE",
// color: 0xffa1a1a1,
// default_value: 1.0
// },
// {
// id: 0,
// node_id: 0,
// name: "Opacity",
// type: "VALUE",
// color: 0xffa1a1a1,
// default_value: 1.0
// },
// {
// id: 0,
// node_id: 0,
// name: "Hardness",
// type: "VALUE",
// color: 0xffa1a1a1,
// default_value: 1.0
// },
// {
// id: 0,
// node_id: 0,
// name: "UV Scale",
// type: "VALUE",
// color: 0xffa1a1a1,
// default_value: 1.0
// }
// ],
// outputs: [],
// buttons: []
// },
{
id: 0,
name: "Value",
type: "FloatNode",
x: 0,
y: 0,
color: 0xffb34f5a,
inputs: [
{
id: 0,
node_id: 0,
name: "Value",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.5,
min: 0.0,
max: 10.0
}
],
outputs: [
{
id: 0,
node_id: 0,
name: "Value",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.5
}
],
buttons: []
},
{
id: 0,
name: "Vector",
type: "VectorNode",
x: 0,
y: 0,
color: 0xff4982a0,
inputs: [
{
id: 0,
node_id: 0,
name: "X",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
},
{
id: 0,
node_id: 0,
name: "Y",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
},
{
id: 0,
node_id: 0,
name: "Z",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
}
],
outputs: [
{
id: 0,
node_id: 0,
name: "Vector",
type: "VECTOR",
color: 0xff6363c7,
default_value: [0.0, 0.0, 0.0]
}
],
buttons: []
},
{
id: 0,
name: "Separate Vector",
type: "SeparateVectorNode",
x: 0,
y: 0,
color: 0xff4982a0,
inputs: [
{
id: 0,
node_id: 0,
name: "Vector",
type: "VECTOR",
color: 0xff6363c7,
default_value: [0.0, 0.0, 0.0]
}
],
outputs: [
{
id: 0,
node_id: 0,
name: "X",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
},
{
id: 0,
node_id: 0,
name: "Y",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
},
{
id: 0,
node_id: 0,
name: "Z",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
}
],
buttons: []
},
{
id: 0,
name: "Vector Math",
type: "VectorMathNode",
x: 0,
y: 0,
color: 0xff4982a0,
inputs: [
{
id: 0,
node_id: 0,
name: "Vector",
type: "VECTOR",
color: 0xff6363c7,
default_value: [0.0, 0.0, 0.0]
},
{
id: 0,
node_id: 0,
name: "Vector",
type: "VECTOR",
color: 0xff6363c7,
default_value: [0.0, 0.0, 0.0]
}
],
outputs: [
{
id: 0,
node_id: 0,
name: "Vector",
type: "VECTOR",
color: 0xff6363c7,
default_value: [0.0, 0.0, 0.0]
},
{
id: 0,
node_id: 0,
name: "Value",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
}
],
buttons: [
{
name: "operation",
type: "ENUM",
data: ["Add", "Subtract", "Average", "Dot Product", "Cross Product", "Normalize"],
default_value: 0,
output: 0
}
]
},
{
id: 0,
name: "Math",
type: "MathNode",
x: 0,
y: 0,
color: 0xff4982a0,
inputs: [
{
id: 0,
node_id: 0,
name: "Value",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.5
},
{
id: 0,
node_id: 0,
name: "Value",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.5
}
],
outputs: [
{
id: 0,
node_id: 0,
name: "Value",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
}
],
buttons: [
{
name: "operation",
type: "ENUM",
data: ["Add", "Subtract", "Multiply", "Divide", "Sine", "Cosine", "Tangent", "Arcsine", "Arccosine", "Arctangent", "Power", "Logarithm", "Minimum", "Maximum", "Round", "Less Than", "Greater Than", "Module", "Absolute"],
default_value: 0,
output: 0
},
{
name: "use_clamp",
type: "BOOL",
default_value: "false",
output: 0
}
]
},
{
id: 0,
name: "Time",
type: "TimeNode",
x: 0,
y: 0,
color: 0xff4982a0,
inputs: [],
outputs: [
{
id: 0,
node_id: 0,
name: "Time",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
},
{
id: 0,
node_id: 0,
name: "Delta",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
},
{
id: 0,
node_id: 0,
name: "Brush",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 0.0
}
],
buttons: []
},
{
id: 0,
name: "Image Texture",
type: "TEX_IMAGE",
x: 0,
y: 0,
color: 0xff4982a0,
inputs: [
{
id: 0,
node_id: 0,
name: "Vector",
type: "VECTOR",
color: 0xff6363c7,
default_value: [0.0, 0.0, 0.0]
}
],
outputs: [
{
id: 0,
node_id: 0,
name: "Color",
type: "RGBA",
color: 0xffc7c729,
default_value: [0.0, 0.0, 0.0, 1.0]
},
{
id: 0,
node_id: 0,
name: "Alpha",
type: "VALUE",
color: 0xffa1a1a1,
default_value: 1.0
}
],
buttons: [
{
// name: "File",
name: "property0",
type: "ENUM",
default_value: 0,
data: ""
},
{
name: "Color Space",
type: "ENUM",
default_value: 0,
data: ["linear", "srgb"]
}
]
}
]
];
public static function createImageTexture():TNode {
for (n in list[categories.indexOf("Nodes")]) {
if (n.type == "TEX_IMAGE") {
var canvas = arm.ui.UINodes.inst.canvasBrush;
var nodes = arm.ui.UINodes.inst.nodes;
var node = arm.ui.UINodes.makeNode(n, nodes, canvas);
canvas.nodes.push(node);
return node;
}
}
return null;
}
}