Skip to main content
Solved

How to add nodes to existing group?

  • November 18, 2024
  • 2 replies
  • 51 views

Astrosias

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 ?

Best answer by tank666

figma.com
View original

2 replies

tank666
  • 4873 replies
  • Answer
  • November 18, 2024

Astrosias
  • Author
  • 1 reply
  • December 20, 2024

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings