Fading Fast

john's Avatar

john

26 Feb, 2015 02:58 AM

The attached NodeBox file includes a handy general purpose subnetwork "fade". It sucks in a fading setting (0 = transparent, 100 = opaque) and applies it to any incoming geometry, even a combined set of multiple differently colored shapes.

The example file creates a randomly-colored grid of rectangles and ellipses, joined with a combine node. It then feeds the combined output along with a number node into the fade subnetwork. The fade node is set to render in the viewer.

To test it, scrub the value of the number node and see what happens. Any value less than 0 will be treated as a 0; any value greater than 100 will be treated as a 100.

Let me know if you have any problems or questions. If there is already an easier way of doing this let me know that too!

Hat tip to the NodeBox team for their new Keys node which helped me figure out how to lookup fill color values for incoming shapes.

Enjoy!

John

  1. Support Staff 1 Posted by Frederik De Ble... on 26 Feb, 2015 11:12 AM

    Frederik De Bleser's Avatar

    Nice!

    It also points out an issue that I've been meaning to fix, which is that you ideally like to be able to set one color component (i.e. alpha) without touching the others.

    You could also set the min/max in the fade subnetwork metadata (see screenshot).

  2. 2 Posted by clarasimson12 on 30 Mar, 2015 06:59 AM

    clarasimson12's Avatar

    I have just started working on nodebox, and would like some expert advice regarding this.

  3. Support Staff 3 Posted by john on 31 Mar, 2015 09:24 AM

    john's Avatar

    I'm not an expert yet, but my advice is to keep playing, read through past forum postings, and don't be afraid to ask specific questions when you get stuck.

  4. 4 Posted by Rory on 31 Mar, 2015 10:43 AM

    Rory's Avatar

    This is very nice.

    I didn't know there was a null node, I had been using my own python node to basically pass information on without touching it. This is much simpler.

    Also I was not aware that you could lookup a property of a non-list output. What other properties are available. Could you for example get list.length, or rect.width and so on? Is there a place in the documentation where this technique is discussed?

    I'm not quite clear what the convert_range node is up to. The output seems to be the integer divided by 100. That then feeds into the alpha node of colorise.

  5. Support Staff 5 Posted by Frederik De Ble... on 01 Apr, 2015 04:57 AM

    Frederik De Bleser's Avatar

    The "keys" node can tell you which properties are available.

    Convert range is used in data visualization. It's basically the rule of three: it converts values from an input domain (e.g. Time of the day) to an output domain (e.g. degrees of rotation)

    Best,

    F

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • fader.ndbx 5.43 KB

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

26 Mar, 2023 12:11 PM
26 Mar, 2023 12:02 PM
24 Mar, 2023 09:51 PM
23 Mar, 2023 09:43 PM
23 Mar, 2023 08:23 AM

 

21 Mar, 2023 11:00 AM
21 Mar, 2023 09:32 AM
21 Mar, 2023 04:46 AM
12 Mar, 2023 03:02 AM
11 Mar, 2023 02:11 AM
10 Mar, 2023 06:47 AM