Custom Node tutorial

Steve Pretty's Avatar

Steve Pretty

25 Jun, 2014 09:49 PM

I've just worked my way through the custom tutorial. This raised a comment and some questions:

Comment - In the shader section of the tutorial, the nodes Multiply 1 and Add 1 dont seem necessary to produce your final result. Your final has a single fixed hue (somewhere around 0.14) - whereas the effect of multiply 1 / add 1 would be to vary the hue. Incidentally, I used the "evaluate" node developed in the earlier section in place of a multiply and add - I thought that was a good idea to show some continuity through the tutorial.

Questions:

  1. Looking at the evaluate node, I found this custom node worked as any other Nodebox node, correctly processing lists. It is clear that this is not being done in the custom Python code, so must be done in the Nodebox code before the python code is used to process individual list elements. So what if I want to write custom code that processed a whole list? An example might be a Fold function, taking a list, an initial accumulator value and a function. Is this possible, and if so, could the tutorial be extended to cover this?

  2. The example functions only return scalar values. What would the code look like if a point was being returned? I guess this would involve creating a new point object, setting x and y values and returning the object. Similarly, can a custom function return a list and how would that code look?

  3. It would be good to see some examples in Clojure.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

22 Feb, 2024 05:51 AM
22 Feb, 2024 01:11 AM
21 Feb, 2024 05:27 PM
21 Feb, 2024 04:49 PM
16 Feb, 2024 05:24 PM

 

06 Feb, 2024 04:45 AM
19 Jan, 2024 09:50 AM
13 Jan, 2024 03:47 AM
05 Jan, 2024 05:10 PM
05 Jan, 2024 04:54 PM
04 Jan, 2024 11:49 PM