Jump to content

functions to access list of nodes added or removed since last world update.


photo

Recommended Posts

Posted

This is something that has been perculating in my head for a while now.

I have been doing a lot of editor plugins which are very specific to things I have in our world script. This means that I have a lot of calls from the editor space to the world space to take a account of when nodes are added or removed.

It would a lot easier to build generalised editor plugins if I could do something like the following in the world script.

 

 

int num_nodes = -1;
 
void update() {
    if (engine.editor.isLoaded() && engine.editor.getNumNodes() != num_nodes) {
         forloop (int i = 0; engine.editor.getNumNewNodes()) { addNode(engine.editor.getAddedNode(i); }
         forloop (int i = 0; engine.editor.getNumRemovedNodes()) {removeNode(engine.editor.getRemovedNode(i);}
         num_nodes = engine.editor.getNumNodes();
    }

 

alternatively if the world script could define the following hook functions at the top level. (like init and update)
 

 

void nodes_added() {
    ....
void nodes_removed() {
   ....

 

 

  • 2 weeks later...
Posted

Hi Danny!

 

Take my apologies for the late reply! Could you please write usage code so we'll clearly understand what exactly you're trying to solve and why do you need such callbacks?

×
×
  • Create New...