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

18 Nov, 2024 11:24 PM
18 Nov, 2024 09:01 PM
07 Nov, 2024 10:53 AM
02 Nov, 2024 11:22 AM
01 Nov, 2024 12:41 AM

 

01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM
30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM
26 Sep, 2024 06:41 AM