git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

nodes/attribute.json (9.6K)

  1 {
  2   "name": "Attribute",
  3   "type": "attribute",
  4   "inputs": 1,
  5   "outputs": 1,
  6   "params": [
  7     {
  8       "name": "input",
  9       "label": "Input",
 10       "type": "node",
 11       "default": "",
 12       "description": "The node whose geometry this reads; its point attributes are created, changed or deleted and the result passed on."
 13     },
 14     {
 15       "name": "operation",
 16       "label": "Operation",
 17       "type": "choice:Create,Modify,Delete,Remap,Clip,Normalize,Composite,Promote",
 18       "default": "Create",
 19       "description": "What is done to the named point attribute: create it, modify it by Value, delete it, remap or clip its range, normalize it, combine it with Source B, or promote it between point and detail."
 20     },
 21     {
 22       "name": "attribute_name",
 23       "label": "Name",
 24       "type": "attribute",
 25       "default": "attr1",
 26       "description": "The point attribute to work on. Pos and Col are the built-in position and colour; they can be modified but not created or deleted."
 27     },
 28     {
 29       "name": "type",
 30       "label": "Type",
 31       "type": "choice:Float,Float2,Float3,Float4",
 32       "default": "Float",
 33       "show_when": "operation == Create",
 34       "description": "How many components the new attribute has: one number, or a vector of two, three or four."
 35     },
 36     {
 37       "name": "value_from",
 38       "label": "Value From",
 39       "type": "choice:Constant,Attribute",
 40       "default": "Constant",
 41       "show_when": "operation == Create|Modify",
 42       "description": "Where the value comes from: Constant uses the Value row for every point; Attribute reads each point's own value of From Attribute.",
 43       "group": "value"
 44     },
 45     {
 46       "name": "from_attribute",
 47       "label": "From Attribute",
 48       "type": "attribute",
 49       "default": "",
 50       "show_when": "operation == Create|Modify && value_from == Attribute",
 51       "description": "The point attribute each point's value is read from when Value From is Attribute: copied as it is when it is as wide as the result, a single number spread to every component, otherwise as many components as fit, the rest zero. Pos and Col name the position and the colour.",
 52       "group": "value"
 53     },
 54     {
 55       "name": "value",
 56       "label": "Value",
 57       "type": "text",
 58       "default": "1.00",
 59       "show_when": "operation == Create|Modify && value_from == Constant",
 60       "description": "The number or numbers written, separated by spaces, commas or colons. One number fills every component; otherwise the count must match the attribute's width.",
 61       "group": "value"
 62     },
 63     {
 64       "name": "combine",
 65       "label": "Combine",
 66       "type": "choice:Set,Add,Multiply",
 67       "default": "Set",
 68       "show_when": "operation == Modify",
 69       "description": "How Value meets the current value: Set replaces it, Add adds to it, Multiply multiplies it, componentwise.",
 70       "group": "amount"
 71     },
 72     {
 73       "name": "strength",
 74       "label": "Strength",
 75       "type": "slider",
 76       "default": "1.00",
 77       "min": 0.0,
 78       "max": 2.0,
 79       "step": 0.05,
 80       "show_when": "operation == Modify",
 81       "description": "How much of the change lands: 1 is the full change, 0 none, 2 twice as much. Scales the difference the node makes under every Combine.",
 82       "group": "amount"
 83     },
 84     {
 85       "name": "scale_by",
 86       "label": "Scale By",
 87       "type": "attribute",
 88       "default": "",
 89       "show_when": "operation == Modify",
 90       "description": "A point attribute whose value weights the change per point, multiplied with Strength. Empty weights every point equally; a name that is not an attribute is an error.",
 91       "group": "amount"
 92     },
 93     {
 94       "name": "per_frame",
 95       "label": "Per Frame",
 96       "type": "toggle",
 97       "default": "true",
 98       "show_when": "operation == Modify && combine != Set",
 99       "description": "Inside a simulation, makes Add and Multiply a rate per frame, so the substep count does not change how far a frame moves. Off lands the full amount every substep.",
100       "group": "amount"
101     },
102     {
103       "name": "group",
104       "label": "Group",
105       "type": "group",
106       "default": "",
107       "show_when": "operation == Create|Modify|Remap|Clip|Normalize|Composite",
108       "description": "A point group limiting which points are changed or measured. Empty means every point.",
109       "group": "where"
110     },
111     {
112       "name": "from_range",
113       "label": "From Range",
114       "type": "choice:Manual,Auto",
115       "default": "Manual",
116       "show_when": "operation == Remap",
117       "description": "Where Remap's input range comes from: Manual uses the From row; Auto measures the input's lowest and highest value (over every component of the points in Group) each time the node evaluates, so the range follows the input as it changes.",
118       "group": "range"
119     },
120     {
121       "name": "detect_range",
122       "label": "Detect Range",
123       "type": "button",
124       "default": "",
125       "show_when": "operation == Remap && from_range == Manual",
126       "description": "Measures the input's lowest and highest value once, at the current frame, and writes them into From. From then stays as written when the input changes; Auto is the range that follows.",
127       "group": "range"
128     },
129     {
130       "name": "from",
131       "label": "From",
132       "type": "float2",
133       "default": "0.00:1.00",
134       "show_when": "operation == Clip || operation == Remap && from_range == Manual",
135       "description": "Remap: the input range, its first value mapping to To's first and its second to To's second; the two must differ. Clip: the bounds values are clamped to.",
136       "group": "range"
137     },
138     {
139       "name": "to",
140       "label": "To",
141       "type": "float2",
142       "default": "0.00:1.00",
143       "show_when": "operation == Remap",
144       "description": "The output range From maps onto; values between map linearly, and values outside From extend past it.",
145       "group": "range"
146     },
147     {
148       "name": "normalize_to",
149       "label": "Normalize To",
150       "type": "float",
151       "default": "1.00",
152       "show_when": "operation == Normalize",
153       "description": "The value the chosen measure (sum, maximum or range) is scaled to hit.",
154       "group": "range"
155     },
156     {
157       "name": "source_b",
158       "label": "Source B",
159       "type": "attribute",
160       "default": "",
161       "show_when": "operation == Composite && combine_op != Length",
162       "description": "The second point attribute combined with Name, point by point. A single-number source applies to every component.",
163       "group": "composite"
164     },
165     {
166       "name": "source_c",
167       "label": "Source C",
168       "type": "attribute",
169       "default": "",
170       "show_when": "operation == Composite && combine_op == Add|Subtract|Multiply|Divide|Minimum|Maximum|Average",
171       "description": "A third point attribute, folded in after Source B: (Name op B) op C. Empty leaves it out. Average takes the mean of every operand given.",
172       "group": "composite"
173     },
174     {
175       "name": "source_d",
176       "label": "Source D",
177       "type": "attribute",
178       "default": "",
179       "show_when": "operation == Composite && combine_op == Add|Subtract|Multiply|Divide|Minimum|Maximum|Average",
180       "description": "A fourth point attribute, folded in after Source C. Empty leaves it out.",
181       "group": "composite"
182     },
183     {
184       "name": "combine_op",
185       "label": "Combine Op",
186       "type": "choice:Add,Subtract,Multiply,Divide,Minimum,Maximum,Average,Difference,Dot,Distance,Length",
187       "default": "Add",
188       "show_when": "operation == Composite",
189       "description": "How the sources are combined with Name, componentwise and left to right. Difference, Dot and Distance take Name and Source B alone; Length is the length of Name and reads no source. Dot, Distance and Length produce one number, written into every component.",
190       "group": "composite"
191     },
192     {
193       "name": "result",
194       "label": "Result",
195       "type": "attribute",
196       "default": "",
197       "show_when": "operation == Composite",
198       "description": "The point attribute the result is written to, created when it does not exist: as wide as the widest operand, or one number for Dot, Distance and Length; points outside Group get zero. An existing attribute keeps its type. Empty writes the result back into Name.",
199       "group": "result"
200     },
201     {
202       "name": "to_class",
203       "label": "To Class",
204       "type": "choice:Detail,Point",
205       "default": "Detail",
206       "show_when": "operation == Promote",
207       "description": "Where the attribute is moved: Detail reduces the per-point values to one number for the whole geometry; Point copies a detail value onto every point.",
208       "group": "promote"
209     },
210     {
211       "name": "method",
212       "label": "Method",
213       "type": "choice:Average,Sum,Minimum,Maximum,First",
214       "default": "Average",
215       "show_when": "operation == Promote",
216       "description": "How point values are reduced to one detail value when promoting to Detail: their average, sum, minimum, maximum or the first point's.",
217       "group": "promote"
218     },
219     {
220       "name": "target",
221       "label": "Target",
222       "type": "choice:Sum,Maximum,Range",
223       "default": "Maximum",
224       "show_when": "operation == Normalize",
225       "description": "What is measured before scaling: the values' sum, their maximum, or their range (max minus min). Every value is scaled so this measure equals Normalize To.",
226       "group": "normalize"
227     },
228     {
229       "name": "kind",
230       "label": "Kind",
231       "type": "choice:Live,Derivative",
232       "default": "Live",
233       "show_when": "operation == Create",
234       "description": "Live keeps the attribute's values from one simulation step to the next; Derivative zeroes it at the start of every step, for values the chain rebuilds each step.",
235       "group": "kind"
236     }
237   ]
238 }