This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Alex Bystrov
Posted Mar 26 - Read on Facebook

Hey everyone, need a little help here. I have a quite large amount of layers, some of them are nested in sublayers or even in several levels of sublayers, some of them are imported from Photoshop. For imported layers I used this to be able to address them directly:

contentLayers = Framer.Importer.load "imported/content"
for layerGroupName of contentLayers
window[layerGroupName] = contentLayers[layerGroupName]

Here is the tricky part: I need to put ALL the layers into one superLayer to transform the whole app. Can't figure out an easy way to accomplish this because:
1. I need to address a list of first-level layers only (to save the existing sublayer structure);
2. If that's not possible, I can do it manually, but I have no idea how to change the loop that I use for imported layers (above) to nest them all inside my new superLayer too.

Any suggestions?

2 Comments

Benjamin Den Boer

Hey Alex, you can simply place all of your layers within a group in Photoshop/Sketch and target that group directly. (And change its superLayer) :-) Is that what you're looking for?

Alex Bystrov

heh, thanks Benjamin Den Boer! I could do that, but after that I will need to rewrite 30+ lines of code reffering to those layers (and I'm just a silly designer). But I just figured out how do coffeescript loops work, so the solution turned out to be pretty simple, adding this after each import:

for name, layer of contentLayers
layer.superLayer = main

So problem solved, thank you anyway, bro :)

Read the entire post on Facebook