Skip to main content

Hi,

I’m writing a plugin that creates a group of nodes. But due to the number of nodes to create (around 100 000) and in order to avoid OutOfMemory errors, I need to do it in batch of 1000.

I currently create a group this way:

  var myGroupNode = figma.group(myInstanceNodes, figma.currentPage)
  myGroupNode.name = "Plugin created group "
  myGroupNode.locked = true

But I can’t find a way to add new nodes inside the group after it’s creation, so I end up with 100 groups of 1000 nodes instead of a single group of 100 000 nodes.

How can I achive this ?

figma.com

Thanks for the anwser, and sorry for replying a month later.

For anyone stumbling on this while trying to do the same thing (adding 10s of thousands of nodes), remember that a default chromium will die at some point if your project reaches the hundreds of MB.
In the end, I had to create a separate png out of these nodes, and import it afterward.