How to increment SOP layers and distort instances procedurally?

Hi everyone,

I’m trying to replicate a patch that I’ve done in vvvv gamma a while ago:

But I’m stuck at two points:

  1. How to increment column layers procedurally? Of course I can duplicate “grid” or “copy” nodes multiple times but I doesn’t seem like an elegant solution. I did it with nested loops in vvvv but how can something similar be achieved in TD?

  2. How can I get the access to each rectangle’s coordinates and distort them with some coefficient depending on the column? I found out that I can use “geo” node to apply transformations and texture randomness but I have no idea how to distort rectangles this way.

Any help is very appreciated, thanks!

Hi @anya_mycelium,

for these kind of iterative operations there is a SOP solution in shape of the Copy SOP and it’s stamping feature.

While usually information always travels from left to right in a network, stamping allows for passing parameters back and adjusting inputs to the Copy SOP with it.

In your case the first input to a Copy SOP would be a Rectangle SOP while the second input would be a Grid SOP. To deform the rectangle we will just use a Noise SOP.
Now we need to adjust the Noise’s Amplitude and Seed with information on column and copy.
These two things can be retrieved as stamp attributes:
First we need the index of the input point of our template input (the grid sop) which can be specified as me.inputPoint.index (compare docs here: copySOP Class - Derivative) The index can be converted to a column number by taking it’s modulo over the number of columns.

Next we need the current copy number which can be retrieved similarly with me.copyIndex.
Finally we need to access these stamp parameters in the Noise SOP using the fetchStamp() method.

A simple approach of this can be seen in attached file.

Another approach would be using instancing and a glsl material to offset the vertices of the rectangle per instance and a noise function.
Yet another approach would be using CHOPs - also fun but maybe part of a different post :slight_smile:

hope this helps
cheers
Markus
base_stamp.tox (1.7 KB)

1 Like

Hi Markus,

Thank you so much for explanation and an example, now it’s super clear! Didn’t know that “copy” is so powerful, definitely will use it a lot, so will go through documentation.

PS: Seems like connecting parameters by scripting makes the workspace more compact and clean btw! My vvvv patch for this looked quite bulky) But I guess it was closer to the CHOP approach you’ve mentioned.

Happy holidays and thanks again!