Archive 17/01/2023.

Additive XML loading by Node

Bluemoon

The LoadXML method of Scene and Node first wipes off every component and child node before loading. Having a method that loads from XML but instead adds to the already existing components and child nodes will really be helpful.
I would like to know the general opinion on this just to be sure I’m not the only one yearning for it :laughing:

cadaver

You should already be able to do additive loading by the Instantiate family of functions. Though the option for e.g. Scene::Load to not clear the existing content should not be hard to add. Just need to check how it will handle e.g. ID conflicts.

TheComet

The most sane thing to do IMO would be to just refuse to create that particular component and write an error to the log. It should be the programmer’s responsibility to make sure there are no conflicts.

cadaver

Probably the loading code would already just assign another ID. This is something a scene author does not have good control over, since e.g. in the editor when you click “New replicated node” the next free ID is used, but the editor has no way of knowing you have the intention of merging multiple separately authored scenes.

TheComet

Ah, in that case I agree.