(2022-03-20, 21:34)Lars C. Hassing Wrote: Hi guys,Welcome back.
it's been a while, I got involved in other projects in 2008
and haven't really followed LDraw since then,
though I did spend a lot of time with LDraw 1998-2008.
(2022-03-20, 21:34)Lars C. Hassing Wrote: ...........So basically everything loaded is public/global?
If an .mpd file with "0 FILE xxx.dat" is met and xxx.dat has already been seen and loaded,
you will get a warning and the second xxx.dat is skipped.
The first xxx.dat can be referenced from anywhere.
...........
l3p and L3Lab cannot cope with two MPD files in PARTS both having the same "0 FILE xxx.dat" line.
...........
/* Hmm, MPD scoping says that MPD subfiles are public. However,
L3xx allows nested MPDs which makes scoping somewhat unclear.
Right above you are warned if the same filename appeared in
another MPD (or elsewhere). MPD subfiles of a part or a
primitive should be kept private...
-and not cleared in FreeModel() */
which suggests that I had some thoughts about scoping back then
(for technical reasons/conflicts from a programmers perspective, not about the logical application/usage)
but at that time it was never an issue.
This is fine when loading a single model tree with the purpose to generate pov code.
But I really don't think it should become the standard.
Strict local scoping ensuring every ldraw file (mpd or plain) lives in a closed container so it only has to be loaded once and always looks the same (except for colors) no matter what file references it.
Otherwise working with multiple models/files in a single program will become an instance administrative nightmare.