Author Topic: $depth system variable not working  (Read 1072 times)

I am working on an FX map that activates/deactivates certain octaves depending on the size of the map that I am generating. To do that, I need to access the FX-Map system variables.

However, upon my first test it appears that no matter in which octave of my FX tree I am, the variable "$depth" always appears to return 0 instead of the level that I am editing. So either this is a bug, or there is something that I understood wrong about the $depth variable.

I attached an image of my FX tree and the function I created for the quadrant nodes.

This was reproduced with Substance designer 2018.1.1

I can't replicate. You may want to attach your graph.

edit: my image was removed. I'll upload it again tomorrow.
edit2: are you outputting an integer2 for those parameters?
Last Edit: June 18, 2018, 11:36:33 pm

I should have attached it right away, dumb me  :o

So here comes the file with the graph showing the issue. When zou open the FX tree you will notive that I attached the same function to the "Pattern" parameter of the last four quadrant nodes. I was expecting to get different values for $depth, depending on the depth of the quadrant node. However, in each function the $depth evaluates to zero.

Best Regards,


Indeed you can't change the pattern dynamically inside a quadrant.

What you can do is adding a switch before your quandrant :

You can also set different patterns as input and drive the Input Image Index using $depth

Hope it helps  :)
Last Edit: June 19, 2018, 08:23:30 pm
Q.A Analyst

That helps indeed!

So I just chose the one parameter where I can't use $depth... Which makes sense, that I cannot change the render pattern dynamically (though if it worked, it would open up new crazy worlds of FX-tree rendering )

I have to apologize for my laziness, not trying it out with another parameter and see if it works there. All I wanted to do is to be able to turn the rendering of a quadrant node off. So the switch is the solution for that.

Thanks for looking into this!

All the best,

You're welcome !

I asked our product owner about this one as I'm not a FX-map specialist, you don't have to feel lazy as the solution wasn't so simple  :)

Have fun with FX maps
All the best !
Q.A Analyst

Nice write up Luc! Thanks!