Blender  V2.93
node_geo_attribute_map_range.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #include "BLI_math_base_safe.h"
18 
19 #include "UI_interface.h"
20 #include "UI_resources.h"
21 
22 #include "node_geometry_util.hh"
23 
25  {SOCK_GEOMETRY, N_("Geometry")},
26  {SOCK_STRING, N_("Attribute")},
27  {SOCK_STRING, N_("Result")},
28  {SOCK_FLOAT, N_("From Min"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
29  {SOCK_FLOAT, N_("From Max"), 1.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
30  {SOCK_FLOAT, N_("To Min"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
31  {SOCK_FLOAT, N_("To Max"), 1.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
32  {SOCK_FLOAT, N_("Steps"), 4.0f, 4.0f, 4.0f, 0.0f, -FLT_MAX, FLT_MAX},
33  {SOCK_VECTOR, N_("From Min"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
34  {SOCK_VECTOR, N_("From Max"), 1.0f, 1.0f, 1.0f, 0.0f, -FLT_MAX, FLT_MAX},
35  {SOCK_VECTOR, N_("To Min"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
36  {SOCK_VECTOR, N_("To Max"), 1.0f, 1.0f, 1.0f, 0.0f, -FLT_MAX, FLT_MAX},
37  {SOCK_VECTOR, N_("Steps"), 4.0f, 4.0f, 4.0f, 0.0f, -FLT_MAX, FLT_MAX},
38  {SOCK_BOOLEAN, N_("Clamp")},
39  {-1, ""},
40 };
41 
43  {SOCK_GEOMETRY, N_("Geometry")},
44  {-1, ""},
45 };
46 
48 {
49  uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE);
50  uiItemR(layout, ptr, "interpolation_type", 0, "", ICON_NONE);
51 }
52 
54 {
56  __func__);
57  data->data_type = CD_PROP_FLOAT;
58  data->interpolation_type = NODE_MAP_RANGE_LINEAR;
59 
60  node->storage = data;
61 }
63 {
64  NodeAttributeMapRange &node_storage = *(NodeAttributeMapRange *)node->storage;
65 
66  bNodeSocket *sock_from_min_float = (bNodeSocket *)BLI_findlink(&node->inputs, 3);
67  bNodeSocket *sock_from_max_float = sock_from_min_float->next;
68  bNodeSocket *sock_to_min_float = sock_from_max_float->next;
69  bNodeSocket *sock_to_max_float = sock_to_min_float->next;
70  bNodeSocket *sock_steps_float = sock_to_max_float->next;
71 
72  bNodeSocket *sock_from_min_vector = sock_steps_float->next;
73  bNodeSocket *sock_from_max_vector = sock_from_min_vector->next;
74  bNodeSocket *sock_to_min_vector = sock_from_max_vector->next;
75  bNodeSocket *sock_to_max_vector = sock_to_min_vector->next;
76  bNodeSocket *sock_steps_vector = sock_to_max_vector->next;
77 
78  bNodeSocket *sock_clamp = sock_steps_vector->next;
79 
80  const CustomDataType data_type = static_cast<CustomDataType>(node_storage.data_type);
81 
82  nodeSetSocketAvailability(sock_clamp,
83  node_storage.interpolation_type == NODE_MAP_RANGE_LINEAR ||
85 
86  nodeSetSocketAvailability(sock_from_min_float, data_type == CD_PROP_FLOAT);
87  nodeSetSocketAvailability(sock_from_max_float, data_type == CD_PROP_FLOAT);
88  nodeSetSocketAvailability(sock_to_min_float, data_type == CD_PROP_FLOAT);
89  nodeSetSocketAvailability(sock_to_max_float, data_type == CD_PROP_FLOAT);
90  nodeSetSocketAvailability(sock_steps_float,
91  data_type == CD_PROP_FLOAT &&
93 
94  nodeSetSocketAvailability(sock_from_min_vector, data_type == CD_PROP_FLOAT3);
95  nodeSetSocketAvailability(sock_from_max_vector, data_type == CD_PROP_FLOAT3);
96  nodeSetSocketAvailability(sock_to_min_vector, data_type == CD_PROP_FLOAT3);
97  nodeSetSocketAvailability(sock_to_max_vector, data_type == CD_PROP_FLOAT3);
98  nodeSetSocketAvailability(sock_steps_vector,
99  data_type == CD_PROP_FLOAT3 &&
101 }
102 
103 namespace blender::nodes {
104 
105 static float map_linear(const float value,
106  const float min_from,
107  const float max_from,
108  const float min_to,
109  const float max_to)
110 {
111  /* First we calculate a fraction that measures how far along
112  * the [min_from, max_from] interval the value lies.
113  *
114  * value
115  * min_from [------>|------------------------] max_from
116  * factor (e.g. 0.25)
117  *
118  * Then to find where the value is mapped, we add the same fraction
119  * of the [min_to, max_to] interval to min_to.
120  *
121  * min_to [--->|-----------] max_to
122  * v
123  * min_to + (max_to - min_to) * factor
124  */
125  const float factor = safe_divide(value - min_from, max_from - min_from);
126  return min_to + factor * (max_to - min_to);
127 }
128 
129 static float map_stepped(const float value,
130  const float min_from,
131  const float max_from,
132  const float min_to,
133  const float max_to,
134  const float steps)
135 {
136  /* First the factor is calculated here in the same way as for the linear mapping.
137  *
138  * Then the factor is mapped to multiples of 1.0 / steps.
139  * This is best understood with a few examples. Assume steps == 3.
140  * ____________________________________
141  * | factor | * 4.0 | floor() | / 3.0 |
142  * |--------|-------|---------|-------|
143  * | 0.0 | 0.0 | 0.0 | 0.0 |
144  * | 0.1 | 0.4 | 0.0 | 0.0 |
145  * | 0.25 | 1.0 | 1.0 | 0.333 |
146  * | 0.45 | 1.8 | 1.0 | 0.333 |
147  * | 0.5 | 2.0 | 2.0 | 0.666 |
148  * | 0.55 | 2.2 | 2.0 | 0.666 |
149  * | 0.999 | 3.999 | 3.0 | 1.0 |
150  * | 1.0 | 4.0 | 4.0 | 1.333 |
151  * ------------------------------------
152  * Note that the factor is not always mapped the closest multiple of 1.0 /steps.
153  */
154  const float factor = safe_divide(value - min_from, max_from - min_from);
155  const float factor_mapped = safe_divide(floorf(factor * (steps + 1.0f)), steps);
156  return min_to + factor_mapped * (max_to - min_to);
157 }
158 
159 static float smoothstep_polynomial(float x)
160 {
161  /* This polynomial is only meant to be used for the [0, 1] range. */
162  return (3.0f - 2.0f * x) * (x * x);
163 }
164 
165 static float map_smoothstep(const float value,
166  const float min_from,
167  const float max_from,
168  const float min_to,
169  const float max_to)
170 {
171  const float factor = safe_divide(value - min_from, max_from - min_from);
172  const float factor_clamped = std::clamp(factor, 0.0f, 1.0f);
173  const float factor_mapped = smoothstep_polynomial(factor_clamped);
174  return min_to + factor_mapped * (max_to - min_to);
175 }
176 
177 static float smootherstep_polynomial(float x)
178 {
179  /* This polynomial is only meant to be used for the [0, 1] range. */
180  return x * x * x * (x * (x * 6.0f - 15.0f) + 10.0f);
181 }
182 
183 static float map_smootherstep(const float value,
184  const float min_from,
185  const float max_from,
186  const float min_to,
187  const float max_to)
188 {
189  const float factor = safe_divide(value - min_from, max_from - min_from);
190  const float factor_clamped = std::clamp(factor, 0.0f, 1.0f);
191  const float factor_mapped = smootherstep_polynomial(factor_clamped);
192  return min_to + factor_mapped * (max_to - min_to);
193 }
194 
195 static void map_range_float(FloatReadAttribute attribute_input,
196  FloatWriteAttribute attribute_result,
197  const GeoNodeExecParams &params)
198 {
199  const bNode &node = params.node();
200  NodeAttributeMapRange &node_storage = *(NodeAttributeMapRange *)node.storage;
201  const int interpolation_type = node_storage.interpolation_type;
202  const float min_from = params.get_input<float>("From Min");
203  const float max_from = params.get_input<float>("From Max");
204  const float min_to = params.get_input<float>("To Min");
205  const float max_to = params.get_input<float>("To Max");
206 
207  Span<float> span = attribute_input.get_span();
208  MutableSpan<float> result_span = attribute_result.get_span();
209 
210  switch (interpolation_type) {
211  case NODE_MAP_RANGE_LINEAR: {
212  for (int i : span.index_range()) {
213  result_span[i] = map_linear(span[i], min_from, max_from, min_to, max_to);
214  }
215  break;
216  }
217  case NODE_MAP_RANGE_STEPPED: {
218  const float steps = params.get_input<float>("Steps");
219  for (int i : span.index_range()) {
220  result_span[i] = map_stepped(span[i], min_from, max_from, min_to, max_to, steps);
221  }
222  break;
223  }
225  for (int i : span.index_range()) {
226  result_span[i] = map_smoothstep(span[i], min_from, max_from, min_to, max_to);
227  }
228  break;
229  }
231  for (int i : span.index_range()) {
232  result_span[i] = map_smootherstep(span[i], min_from, max_from, min_to, max_to);
233  }
234  break;
235  }
236  }
237 
238  if (ELEM(interpolation_type, NODE_MAP_RANGE_LINEAR, NODE_MAP_RANGE_STEPPED) &&
239  params.get_input<bool>("Clamp")) {
240  /* Users can specify min_to > max_to, but clamping expects min < max. */
241  const float clamp_min = min_to < max_to ? min_to : max_to;
242  const float clamp_max = min_to < max_to ? max_to : min_to;
243 
244  for (int i : result_span.index_range()) {
245  result_span[i] = std::clamp(result_span[i], clamp_min, clamp_max);
246  }
247  }
248 }
249 
250 static void map_range_float3(Float3ReadAttribute attribute_input,
251  Float3WriteAttribute attribute_result,
252  const GeoNodeExecParams &params)
253 {
254  const bNode &node = params.node();
255  NodeAttributeMapRange &node_storage = *(NodeAttributeMapRange *)node.storage;
256  const int interpolation_type = node_storage.interpolation_type;
257  const float3 min_from = params.get_input<float3>("From Min_001");
258  const float3 max_from = params.get_input<float3>("From Max_001");
259  const float3 min_to = params.get_input<float3>("To Min_001");
260  const float3 max_to = params.get_input<float3>("To Max_001");
261 
262  Span<float3> span = attribute_input.get_span();
263  MutableSpan<float3> result_span = attribute_result.get_span();
264 
265  switch (interpolation_type) {
266  case NODE_MAP_RANGE_LINEAR: {
267  for (int i : span.index_range()) {
268  result_span[i].x = map_linear(span[i].x, min_from.x, max_from.x, min_to.x, max_to.x);
269  result_span[i].y = map_linear(span[i].y, min_from.y, max_from.y, min_to.y, max_to.y);
270  result_span[i].z = map_linear(span[i].z, min_from.z, max_from.z, min_to.z, max_to.z);
271  }
272  break;
273  }
274  case NODE_MAP_RANGE_STEPPED: {
275  const float3 steps = params.get_input<float3>("Steps_001");
276  for (int i : span.index_range()) {
277  result_span[i].x = map_stepped(
278  span[i].x, min_from.x, max_from.x, min_to.x, max_to.x, steps.x);
279  result_span[i].y = map_stepped(
280  span[i].y, min_from.y, max_from.y, min_to.y, max_to.y, steps.y);
281  result_span[i].z = map_stepped(
282  span[i].z, min_from.z, max_from.z, min_to.z, max_to.z, steps.z);
283  }
284  break;
285  }
287  for (int i : span.index_range()) {
288  result_span[i].x = map_smoothstep(span[i].x, min_from.x, max_from.x, min_to.x, max_to.x);
289  result_span[i].y = map_smoothstep(span[i].y, min_from.y, max_from.y, min_to.y, max_to.y);
290  result_span[i].z = map_smoothstep(span[i].z, min_from.z, max_from.z, min_to.z, max_to.z);
291  }
292  break;
293  }
295  for (int i : span.index_range()) {
296  result_span[i].x = map_smootherstep(span[i].x, min_from.x, max_from.x, min_to.x, max_to.x);
297  result_span[i].y = map_smootherstep(span[i].y, min_from.y, max_from.y, min_to.y, max_to.y);
298  result_span[i].z = map_smootherstep(span[i].z, min_from.z, max_from.z, min_to.z, max_to.z);
299  }
300  break;
301  }
302  }
303 
304  if (ELEM(interpolation_type, NODE_MAP_RANGE_LINEAR, NODE_MAP_RANGE_STEPPED) &&
305  params.get_input<bool>("Clamp")) {
306  /* Users can specify min_to > max_to, but clamping expects min < max. */
307  float3 clamp_min;
308  float3 clamp_max;
309  clamp_min.x = min_to.x < max_to.x ? min_to.x : max_to.x;
310  clamp_max.x = min_to.x < max_to.x ? max_to.x : min_to.x;
311  clamp_min.y = min_to.y < max_to.y ? min_to.y : max_to.y;
312  clamp_max.y = min_to.y < max_to.y ? max_to.y : min_to.y;
313  clamp_min.z = min_to.z < max_to.z ? min_to.z : max_to.z;
314  clamp_max.z = min_to.z < max_to.z ? max_to.z : min_to.z;
315 
316  for (int i : result_span.index_range()) {
317  clamp_v3_v3v3(result_span[i], clamp_min, clamp_max);
318  }
319  }
320 }
321 
323  StringRef source_name,
324  StringRef result_name)
325 {
326  ReadAttributePtr result_attribute = component.attribute_try_get_for_read(result_name);
327  if (result_attribute) {
328  return result_attribute->domain();
329  }
330  ReadAttributePtr source_attribute = component.attribute_try_get_for_read(source_name);
331  if (source_attribute) {
332  return source_attribute->domain();
333  }
334  return ATTR_DOMAIN_POINT;
335 }
336 
338 {
339  const std::string input_name = params.get_input<std::string>("Attribute");
340  const std::string result_name = params.get_input<std::string>("Result");
341 
342  if (input_name.empty() || result_name.empty()) {
343  return;
344  }
345 
346  const bNode &node = params.node();
347  NodeAttributeMapRange &node_storage = *(NodeAttributeMapRange *)node.storage;
348  const CustomDataType data_type = static_cast<CustomDataType>(node_storage.data_type);
349 
350  const AttributeDomain domain = get_result_domain(component, input_name, result_name);
351 
352  ReadAttributePtr attribute_input = component.attribute_try_get_for_read(
353  input_name, domain, data_type);
354 
355  if (!attribute_input) {
356  params.error_message_add(NodeWarningType::Error,
357  TIP_("No attribute with name \"") + input_name + "\"");
358  return;
359  }
360 
361  OutputAttributePtr attribute_result = component.attribute_try_get_for_output(
362  result_name, domain, data_type);
363  if (!attribute_result) {
364  params.error_message_add(NodeWarningType::Error,
365  TIP_("Could not find or create attribute with name \"") +
366  result_name + "\"");
367  return;
368  }
369 
370  switch (data_type) {
371  case CD_PROP_FLOAT: {
372  map_range_float(*attribute_input, *attribute_result, params);
373  break;
374  }
375  case CD_PROP_FLOAT3: {
376  map_range_float3(*attribute_input, *attribute_result, params);
377  break;
378  }
379  default:
381  }
382 
383  attribute_result.apply_span_and_save();
384 }
385 
387 {
388  GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry");
389 
390  if (geometry_set.has<MeshComponent>()) {
392  }
393  if (geometry_set.has<PointCloudComponent>()) {
395  }
396 
397  params.set_output("Geometry", geometry_set);
398 }
399 
400 } // namespace blender::nodes
401 
403 {
404  static bNodeType ntype;
405 
407  &ntype, GEO_NODE_ATTRIBUTE_MAP_RANGE, "Attribute Map Range", NODE_CLASS_ATTRIBUTE, 0);
414  &ntype, "NodeAttributeMapRange", node_free_standard_storage, node_copy_standard_storage);
416  nodeRegisterType(&ntype);
417 }
AttributeDomain
Definition: BKE_attribute.h:41
@ ATTR_DOMAIN_POINT
Definition: BKE_attribute.h:43
void nodeSetSocketAvailability(struct bNodeSocket *sock, bool is_available)
Definition: node.cc:3726
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4527
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4623
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4559
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
Definition: node.cc:4599
#define GEO_NODE_ATTRIBUTE_MAP_RANGE
Definition: BKE_node.h:1416
#define NODE_CLASS_ATTRIBUTE
Definition: BKE_node.h:360
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1298
#define BLI_assert_unreachable()
Definition: BLI_assert.h:96
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float safe_divide(float a, float b)
MINLINE void clamp_v3_v3v3(float vec[3], const float min[3], const float max[3])
#define UNUSED(x)
#define ELEM(...)
#define TIP_(msgid)
#define N_(msgid)
static uint8 component(Color32 c, uint i)
Definition: ColorBlock.cpp:126
CustomDataType
@ CD_PROP_FLOAT
@ CD_PROP_FLOAT3
@ NODE_MAP_RANGE_STEPPED
@ NODE_MAP_RANGE_SMOOTHERSTEP
@ NODE_MAP_RANGE_SMOOTHSTEP
@ NODE_MAP_RANGE_LINEAR
@ SOCK_VECTOR
@ SOCK_BOOLEAN
@ SOCK_FLOAT
@ SOCK_GEOMETRY
@ SOCK_STRING
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define C
Definition: RandGen.cpp:39
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
constexpr IndexRange index_range() const
Definition: BLI_span.hh:659
OperationNode * node
bNodeTree * ntree
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
#define floorf(x)
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
TypedWriteAttribute< float3 > Float3WriteAttribute
TypedReadAttribute< float > FloatReadAttribute
TypedReadAttribute< float3 > Float3ReadAttribute
TypedWriteAttribute< float > FloatWriteAttribute
std::unique_ptr< ReadAttribute > ReadAttributePtr
static void map_range_float(FloatReadAttribute attribute_input, FloatWriteAttribute attribute_result, const GeoNodeExecParams &params)
static void map_range_float3(Float3ReadAttribute attribute_input, Float3WriteAttribute attribute_result, const GeoNodeExecParams &params)
static float map_linear(const float value, const float min_from, const float max_from, const float min_to, const float max_to)
static void map_range_attribute(GeometryComponent &component, const GeoNodeExecParams &params)
static float smootherstep_polynomial(float x)
static float smoothstep_polynomial(float x)
static float map_smoothstep(const float value, const float min_from, const float max_from, const float min_to, const float max_to)
static float map_stepped(const float value, const float min_from, const float max_from, const float min_to, const float max_to, const float steps)
static AttributeDomain get_result_domain(const GeometryComponent &component, StringRef source_name, StringRef result_name)
static float map_smootherstep(const float value, const float min_from, const float max_from, const float min_to, const float max_to)
static void geo_node_attribute_map_range_exec(GeoNodeExecParams params)
static void geo_node_attribute_map_range_update(bNodeTree *UNUSED(ntree), bNode *node)
static void fn_attribute_map_range_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static bNodeSocketTemplate geo_node_attribute_map_range_in[]
void register_node_type_geo_attribute_map_range()
static void geo_node_attribute_map_range_init(bNodeTree *UNUSED(ntree), bNode *node)
static bNodeSocketTemplate geo_node_attribute_map_range_out[]
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
Definition: node_util.c:67
void node_free_standard_storage(bNode *node)
Definition: node_util.c:55
static const int steps
Definition: sky_nishita.cpp:28
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
bool has(const GeometryComponentType component_type) const
Compact definition of a node socket.
Definition: BKE_node.h:95
struct bNodeSocket * next
Defines a node type.
Definition: BKE_node.h:221
NodeGeometryExecFunction geometry_node_execute
Definition: BKE_node.h:327
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:253
ccl_device_inline int clamp(int a, int mn, int mx)
Definition: util_math.h:283
PointerRNA * ptr
Definition: wm_files.c:3157