I have a For Each that doesn't have an input, I'm creating geo with "Multiparam block (tabs)" (parameter interface). Then modifying geo by accessing the current iteration number and concatenating it with multi-param block parameter(s) like so:
ch(strcat("../<PARAMETER_NAME>", detail(-1, "iteration", 0)+1))
Current difficulty: can't move objects separately after 1 iteration. An object after 2nd iteration will move an object from the 1st iteration. I want to move them independently (manually).
Example (desired result): create the first object, and move it. Create a second object, move it independently from the first one, and so on. Make sure that both of them are merged at the end. All of it is inside For Each loop.
Basically, create objects inside For loop and move them independently.
Expected VS current result:
Tried this VEX to try my assumptions(probably missing something fundamental):
vector pos = @P;
int iteration = int(detail(-1, "iteration", 0)); // Get the iteration number. -1 gets it from the Spare input
int numObjects = 2; // Total number of objects to move
int objectId = (@id - 1) % numObjects; // Calculate the object ID based on @id attribute
if (iteration == objectId + 1) // iteration starts from 1
{
if (objectId == 0)
{
// Move the first object in the first iteration
pos.x += ch("../window_placement_x1");
pos.x += ch("../window_placement_y1");
}
else if (objectId == 1)
{
// Move the second object in the second iteration
pos.x += ch("../window_placement_x1");
pos.x += ch("../window_placement_y1");
}
}
@P = pos;
Parameters (just in case):
For each loop (just in case):
GIF example (correct transform):
GIF example (incorrect transform after adding the second frame):
GIF example of how it currently behaves:
If this is not how it is supposed to be, please, guide me in how it should be done.
Thank you for taking the time to have a look 💛