A Magic Set of Tags

so for the .babylon file type can we extend it to allow for two new things

  1. Expose as Variable
    so on any node :
{
...
 exposeAsVariable : true|false
 exposeGlobally : true|false (Only works if exposeAsVariable is true)
...
}

Where the importer would see that and if the args are true and false that it would take the node just created by the loader and do a scene.exposedVariables[node.name] = node.
Or alternatively true true then it would do like eval( node.name+’ = node’ ) to open it to the global scope.

  1. customScripts
    also on any node :
{
...
 customScripts: String[]
...
}

which effectively is ran by the loader as eval(customScripts[i]) and is ran after the node is created.
that would work in couple with the exposeAsVariable to allow quick manipulations to the node and a really quick and easy way to script entire scenes from your CAD program.

ehhh ehh? ehhh? Any bites?

Well this is a bit far fetched for the purpose of the serialization format to be honest

And customscripts: this is tricky for security reasons

hmmm, dang cause I did it on a custom exporter and it seemed to work great. Maybe at some point i’ll do a PR just as an idea to demonstrate it and it could be discussed more then?

sounds totally fine :wink: