Skip to main content
visa
New Member
September 23, 2026
Question

Plugin API: having Motion timeline open creates a hidden duplicate of the selected layer tree in page.children

  • September 23, 2026
  • 3 replies
  • 48 views

I ran into some weird behavior around Figma Motion during plugin development.

Having the Motion timeline open in Figma, with any layer containing animations selected, causes that layer’s entire tree to get a hidden duplicate with a new ID. The duplicate tree only shows up in currentPage.children, not in Layers list in Figma’s UI.

Also, if the duplicated layer contains any component sets, calling getMainComponentAsync on an instance node will return a new duplicate component that’s neither part of the original or the duplicated tree. The component in both the original and duplicated tree share the component’s original ID, but the one returned by getMainComponentAsync has a new different ID.

Repro steps:

  1. Create a new Design document with some frame layers
  2. Use a plugin to check currentPage.children to verify that the root layers match between Layers list and what’s returned by the API
  3. Add animations to any layers, open timeline, and make sure you have a layer containing animations selected
  4. Check currentPage.children to verify that the selected layer’s tree now has a duplicate with a new ID, not visible in Layers list
  5. Close the timeline and check currentPage.children to verify the duplicate is gone

I couldn’t find any information on whether this is intended behaviour (which I doubt). The issue with instance-component references is preventing me from simply filtering out the duplicates by ID.

3 replies

djv
Figmate
Community Support
September 24, 2026

Hi ​@visa, thanks for the detailed report and clear reproduction steps! 

This definitely looks unexpected; especially since the duplicate disappears when the Motion timeline is closed and getMainComponentAsync() returns another component ID.
 

I’d like to get this in front of the right team to investigate further. Could you share a minimal plugin or code snippet that logs the currentPage.children and getMainComponentAsync() results, along with a test file if possible?


In the meantime, closing the Motion timeline before running the plugin should avoid the duplicate. My team here on the forum will share any additional guidance here as we learn more from the team.

visa
visaAuthor
New Member
September 24, 2026

Here’s a minimal repro case with an animated component and its instance. Open the .fig in Figma and import the plugin from manifest. In the plugin, click refresh to output root layers, components, and instance-component references. Compare the results between having the timeline open with the component selected, and having the timeline closed.

The component reference only shows a mismatch when the component is selected while the timeline is open. If the instance is selected instead, the reference shows correctly.

djv
Figmate
Community Support
September 24, 2026

Thanks, ​@visa! 

I’ve created ticket #215154 on your behalf to connect you with the team to investigate this further. They will review and be in touch as soon as they’re available.