### Author Topic: \$number into Division Operator issue  (Read 778 times)

#### Maximilien Vert

Hello,
I am trying to recreate a splatter circular with some custom parameters.
I just start playing with the fx-map node, so this is a noob question.

Those images bellow show the function in the "Branch Offset" parameters of a Quadrant that I iterated 8 times. I wanted to make a dynamic function that can fill perfectly a circular shape with right amount of square pattern.
So I decided to plug the \$number ( wich is equal to 8 ) into a Division Operator to find the right offset angle but it does not seems to work. In the other hand, when I use a Multiplication Operator with \$number there are no problem, it act like a float1.

Anyone can explain what's wrong ?

Thank you.

#### bruce_4

In your top graph, if you take the float 8 and plug it into both the division node and the multiply node do you get the correct effect?

I suspect \$number is 1 in both graphs.  In your FX map setup with Quadrant and Iterate, is Iterate your set to root?  (I'm not sure if you can get the Iterate variable from the iterate node into the Quadrant node).

You might need to create a top level variable in the entire graph that then both the iterate node and the quadrant node reference.  Also I'm not sure if you should use \$number.  Clearly I'm not entirely sure what I"m doing, but I always create new variables and not the ones that are built into SD.

#### Esger van der Post

\$number does not return the total number of iterations. It returns the iteration number of the shape that is drawn. So the first square that is drawn, will have \$number=1 The second square will have \$number=2 and so on.

If you want to be able to adjust the number of iterations and automatically update this number in your quadrant you should make a new variable in your main graph and use a 'get' node wherever you want to use this value.

#### bruce_4

Sorry to hijack but:

Could you use that to set custom inputs based on iteration number?  Like "If \$number = 0 then Input Image 0, else Input Image 1"?

Then chain a ton of these to pick random shapes?  I've been having draw layer issues, this seems like a quick way around it (Can't try it right now).

#### Maximilien Vert

Indeed, I tried to plug the float 8 in the mulitply node and that was not the same result cause as Eggfruit says, \$number is not the total number of iteration. Now I understood this, thx.

Eggfruit, when you said "main graph", do you mean the fx-map graph ? Or the Color/luminosity of the quadrant is enough ?

I tried to create the variable of the iteration and all the different variables (with the sequence node) in the iteration graph but now the \$number does not seem to work anymore...

Again thank you very much !

#### bruce_4

For the main graph, you need to go all the way out (so outside of the FX map).  If you double click on the background with no node selected, it will select the main graph parameters.  Go to the very bottom and add a new input parameter and give it a name and set it up to match the kind of variable you want.  (Probably a Float 1).  Then back inside your FX map in whichever section you are building your equation, use the Get Float and type in the new variable you created.  That will let you then set it's value when using the node.

#### Maximilien Vert

Oh I see. I didn't know that. I thought that the variables in the FX-map was only working for that node and couldn't interact with the main graph but that just stupid.
Now it's working, thank you very much !

#### Esger van der Post

Yes, what bruce said is exactly what I meant. I'm glad that worked out.

Quote
Sorry to hijack but:

Could you use that to set custom inputs based on iteration number?  Like "If \$number = 0 then Input Image 0, else Input Image 1"?

Then chain a ton of these to pick random shapes?  I've been having draw layer issues, this seems like a quick way around it (Can't try it right now).

I'm not entirely sure, but I think it will still draw all of 1 shape first before moving on to the next. I think the fx map does multiple 'passes' when you have multiple shapes. So it first runs through each iteration with shape 1, than again with shape 2 etc.

#### bruce_4

Yes, what bruce said is exactly what I meant. I'm glad that worked out.

Quote
Sorry to hijack but:

Could you use that to set custom inputs based on iteration number?  Like "If \$number = 0 then Input Image 0, else Input Image 1"?

Then chain a ton of these to pick random shapes?  I've been having draw layer issues, this seems like a quick way around it (Can't try it right now).

I'm not entirely sure, but I think it will still draw all of 1 shape first before moving on to the next. I think the fx map does multiple 'passes' when you have multiple shapes. So it first runs through each iteration with shape 1, than again with shape 2 etc.

I've been running into an issue where it seems FX Map draws inputs based on the Input order, so if I have like 4 inputs, Input 4 always is drawn onto of everything no matter what. I"ve been trying to figure out where in the stack I could adjust the input to draw.

#### Esger van der Post

Quote
I've been running into an issue where it seems FX Map draws inputs based on the Input order, so if I have like 4 inputs, Input 4 always is drawn onto of everything no matter what. I"ve been trying to figure out where in the stack I could adjust the input to draw.

Yeah, I don't think there is a way around this when it comes to fx-maps.
You could try playing around with the new shape splatter nodes. They allow blending of color shapes based on height, which may be a solution. (They can do this because they use pixel processors instead of fx-maps)