value_node.ts 865 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. function value_node_init() {
  2. array_push(nodes_material_input, value_node_def);
  3. map_set(parser_material_node_values, "VALUE", value_node_value);
  4. }
  5. function value_node_value(node: ui_node_t, socket: ui_node_socket_t): string {
  6. return parser_material_vec1(node.outputs[0].default_value[0]);
  7. }
  8. let value_node_def: ui_node_t = {
  9. id : 0,
  10. name : _tr("Value"),
  11. type : "VALUE",
  12. x : 0,
  13. y : 0,
  14. color : 0xffb34f5a,
  15. inputs : [],
  16. outputs : [ {
  17. id : 0,
  18. node_id : 0,
  19. name : _tr("Value"),
  20. type : "VALUE",
  21. color : 0xffa1a1a1,
  22. default_value : f32_array_create_x(0.0),
  23. min : 0.0,
  24. max : 1.0,
  25. precision : 100,
  26. display : 0
  27. } ],
  28. buttons : [ {
  29. name : _tr("default_value"),
  30. type : "VALUE",
  31. output : 0,
  32. default_value : f32_array_create_x(0),
  33. data : null,
  34. min : 0.0,
  35. max : 10.0,
  36. precision : 100,
  37. height : 0
  38. } ],
  39. width : 0,
  40. flags : 0
  41. };