Would love to get some help from the pros :)
I've come up with this recursive function that prints the hierarchy of a layer. To my surprise this terrible hackjob ended up working but there must be a better way to do this.
Would you please point me in the right direction?
Hey Marc! How's this (deleted previous post because had a mistake :P)?
Thanks Joshua :)
Should have been a bit more precise. This is just an abstraction of another problem where I can't use native Framer methods. So I'd like you to replace '.subLayers" with ".foobar()" or something else in your mind.:D
Ahah! Makes sense. Back to the coding board :P.
Jordan, halp plz :)
Hey Marc, I'm not sure what you're trying to achieve because you mentioned you can't use Framer methods, however in your example you're using layers and their 'superlayer' attribute.
The solution Joshua provided is correct, but if you want to do it without Framer functions here are two alternatives. Both options rely on the 'layers' array and assume that your first element in the array is your outmostLayer (according to your example).
Goes without saying: these functions shouldn't have the same name, it was just to illustrate both have the same output.
Hope this helps!
Nice JL Flores Mena! You're awesome! Sorry Marc Krenn got distracted with work stuff :).