How to update a component from ruby in sync with c++?

My setup is the following :

  • a network pipe (c++ SDK) receive commands to create components or to update existing components.
  • because the sdk doesn’t provide anyway to clear the entities of a component, I do that via a jump to ruby. I need that to update the content of a component.

The problem I have is that clearing a component of its entity via ruby seems to trigger a garbage collection of the component. It becomes deleted. I am trying to fill it with new geometry (curves) in C++ but I am too late, when I do, the component is already in this state. And disappear.

How to do that efficiently ? @bugra ?

At the end of each operation, empty component definitions will be purged. So you can’t clear the contents of a component in one operation and then try to populate it in another operation. I don’t believe there is a way around that but I’ll ask @tt_su.

It seems we need to implement a way to clear components via C.

Can you:

  • Get and hold an array of all the entities you wish to delete
  • Create a temporary group inside the component (which will NOT be in the array,)
    and add your new curves to this temporary group.
  • Iterate the deletion array popping and deleting each member until the array is empty.
    (Dispose of the array.)
  • Now the only thing within the component’s entities will be the temporary group.
  • Explode the group.