graphic design tool
git clone https://git.lucas.co/cce-designer.git
nodes/neighbour.json (4.5K)
1 {
2 "name": "Neighbour",
3 "type": "neighbour",
4 "inputs": 1,
5 "outputs": 1,
6 "params": [
7 {
8 "name": "input",
9 "label": "Input",
10 "type": "node",
11 "default": "",
12 "description": "The geometry whose point attribute is changed by comparing each point with the points around it."
13 },
14 {
15 "name": "attribute",
16 "label": "Attribute",
17 "type": "attribute",
18 "default": "mass",
19 "description": "The point attribute to operate on; must already exist. Works on floats, integers and vectors; integers stay whole."
20 },
21 {
22 "name": "mode",
23 "label": "Mode",
24 "type": "choice:Diffuse,Concentrate,Migrate,Bleed,Align,Lead,Charge",
25 "default": "Diffuse",
26 "description": "Diffuse smooths toward neighbours, Concentrate sharpens away from them, Migrate moves value along Direction, Bleed decays to zero, Align and Lead turn vectors, Charge accumulates and discharges."
27 },
28 {
29 "name": "neighbourhood",
30 "label": "Neighbourhood",
31 "type": "choice:Connectivity,Radius,Global",
32 "default": "Connectivity",
33 "show_when": "mode != Bleed",
34 "description": "Which points count as neighbours: those within Rings edges on the mesh, those within Radius in space (across folds too), or every point.",
35 "group": "neighbourhood"
36 },
37 {
38 "name": "rings",
39 "label": "Rings",
40 "type": "spinbox",
41 "default": "1",
42 "min": 1.0,
43 "max": 8.0,
44 "step": 1.0,
45 "show_when": "neighbourhood == Connectivity && mode != Bleed",
46 "description": "How many edge rings out from a point count as its neighbours. More rings spread the effect wider per evaluation.",
47 "group": "neighbourhood"
48 },
49 {
50 "name": "radius",
51 "label": "Radius",
52 "type": "slider",
53 "default": "0.20",
54 "min": 0.0,
55 "max": 2.0,
56 "step": 0.01,
57 "show_when": "neighbourhood == Radius && mode != Bleed",
58 "description": "Distance in world units within which points count as neighbours, regardless of mesh connectivity.",
59 "group": "neighbourhood"
60 },
61 {
62 "name": "amount",
63 "label": "Amount",
64 "type": "slider",
65 "default": "0.50",
66 "min": 0.0,
67 "max": 1.0,
68 "step": 0.01,
69 "description": "Strength of each evaluation, 0 to 1: the fraction of the way toward the target, the fraction moved or decayed, or the charge added per step. Inside a simnet it acts as a rate.",
70 "group": "amount"
71 },
72 {
73 "name": "direction",
74 "label": "Direction",
75 "type": "attribute",
76 "default": "",
77 "show_when": "mode == Migrate",
78 "description": "A vector point attribute giving the direction value flows in Migrate mode; neighbours in front of each point receive what it gives up.",
79 "group": "amount"
80 },
81 {
82 "name": "group",
83 "label": "Group",
84 "type": "group",
85 "default": "",
86 "description": "Only points in this group are changed; neighbours outside it are still read. Empty changes every point.",
87 "group": "where"
88 },
89 {
90 "name": "target",
91 "label": "Target",
92 "type": "choice:Local Average,Global Average,Constant,Attribute,Surface Tangent",
93 "default": "Local Average",
94 "show_when": "mode == Align",
95 "description": "What vectors turn toward: the neighbours' average, the whole geometry's average, the Constant vector, the Source attribute, or the vector's own projection onto the surface.",
96 "group": "mode"
97 },
98 {
99 "name": "constant",
100 "label": "Constant",
101 "type": "float3",
102 "default": "0.00:1.00:0.00",
103 "show_when": "mode == Align && target == Constant",
104 "description": "The fixed direction vectors turn toward when Target is Constant.",
105 "group": "mode"
106 },
107 {
108 "name": "source",
109 "label": "Source",
110 "type": "attribute",
111 "default": "",
112 "show_when": "mode == Align|Lead",
113 "description": "In Align with Target set to Attribute, the vector attribute to turn toward. In Lead, a number weighting each neighbour's influence; empty weighs all equally.",
114 "group": "mode"
115 },
116 {
117 "name": "release",
118 "label": "Release",
119 "type": "slider",
120 "default": "1.00",
121 "min": 0.0,
122 "max": 10.0,
123 "step": 0.05,
124 "show_when": "mode == Charge",
125 "description": "Threshold at which a point's charge discharges, split evenly among its neighbours. Higher stores more before firing; 0 never discharges.",
126 "group": "mode"
127 }
128 ]
129 }