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

What is Framer? Join the Community
Return to index
Fran Pérez
Posted Nov 24 - Read on Facebook

#Tip

Something I usually do after creating all my layers is store their initial properties for later use:

layer.originalProps = layer.props for layer in Framer.CurrentContext._layerList

Better (thanks Koen): layer.originalProps = layer.props for layer in Framer.CurrentContext.getLayers()

9 Comments

Koen Bok

Better: Framer.CurrentContext.getLayers()

Jordan Robert Dobson

Nice one.

Leigh Nelkin

I'm trying to use this line of code with Framer v.74 and I receive type Error any idea what the new format should be?

Henrique Gusso

Leigh they replaced `getLayers()` with only `layers`. so it looks like this:

layer.originalProps = layer.props for layer in Framer.CurrentContext.layers

Gregory J. Orton

What do you use this for later?

Sigurd Tapio Mannsåker

Maybe a dumb question, but any reason you can't just get those properties from layer.states.default?

Fran Pérez

Yes you can, unfortunately when I wrote the tip it didn't exist :)

Sigurd Tapio Mannsåker

Haha damn, didn't notice the date on the original post. Hello from the future!

Leigh Nelkin

Thank you Henrique Gusso

Read the entire post on Facebook