Need help modifying texture node (attempting Voronoi enhancement)

I need some help with a patch that I posted: D4602

From the patch:

BROKEN [WIP]: Minimal Viable Product: Proposed Voronoi Texture enhancements

This is my first baby-step contributing to Blender. I have several enhancements I’d like to make to the Voronoi texture, and this is simply a proof-of-concept/ first step:

“Fac” is a linear value, but it really represents the magnitude of an “Offset” vector. My first task (as I tried to do in this patch) is to expose the offset vector, in addition to the scalar “Fac”.

The Offset output I created currently is just returning (0,0,0) instead of the intended offset. I’m sure I made a newbie mistake, but I just don’t see it. Can you help me figure out while the value of Offset isn’t populating?

I will attach a sample .blend file to the post that links to this diff.

Thank you,


Sample blender file: VoronoiMinimalChangeTest.blend

The green streaks are places the values happen to match because Fac is close to zero.

All help and comments welcome. Thanks in advance.

@LazyDodo was a great help on this code review so far, and he made great suggestions, but I had a few things I wanted opinions on before proceeding:

  1. WRT User Interface: I want to offer the user three options on how to tessellate space for Voronoi. The current tessellation is “Cubic”. I also want to offer “Hexagonally Prismic” and “Rhombicly Dodecahedric”; with the last being the new default. I think “Cubic” is very straightforward for users, but the other two sound much too technical. Can anyone recommend how I can name the options so they will be clear to users? (“Grid” and “Honeycomb” might be appropriate for the first two options. How do “Double Honeycomb” or “Perpendicular Honeycombs” sound for the last?)
  2. I found a few inconsistencies between how the Voronoi says it works and how it actually does. I’d like to correct this, but alter the inputs and/or outputs on load to preserve the old behavior. @LazyDodo gave me a good example of something similar here: Blender commit rBb48e6799f151b82d6af6487a851051b88a438007 but this raises several questions:
    • Given how far this is organizationally from the voronois code, Is this the correct way to transform legacy nodes on load?
    • If I’m only adding, and not renaming node inputs and outputs, how is the best way to detect nodes written by older versions of Blender (before my changes?)
    • If I have an input that is currently ignored (in specific detectable situations) that I want to utilize: If the ignored input is attached to something already, how can I sever this connection and replace it with the correct constant value?
  3. Is there a particular developer best to discuss changes to this Texture node with, so I can avoid some naive mistakes?

Thanks all,