Concerning the p/8 and p/48 folders
2016-03-03, 20:03 (This post was last modified: 2016-03-04, 3:08 by Travis Cobbs.)
2016-03-03, 20:03 (This post was last modified: 2016-03-04, 3:08 by Travis Cobbs.)
Hello!
I am looking for information on the p/8 and p/48 folders in regards to their location when searching the library for a part. Allow me to explain.
I am helping out with a Python-based .dat/.ldr parser (https://github.com/Tribex/LDRParser) that I eventually plan to use in my Blender import plugin (https://github.com/le717/LDR-Importer). As it stands, the parser does not support the 8/48 folders and I am looking into implementing it. I do have those folders supported in my plugin but lately I have begun to think I have implemented it incorrectly. I could not find a spec containing the info I am looking for, hence this topic. (If I am in the wrong section, please move it.)
Currently, I have the search path set up as so (assume HighRes and LowRes are strings representing a three option, mutual selection (so basically, radio buttons). The third value is StandardRes but unused.):
My questions are:
1. Is this the correct search order I should be using?
2. Are use of the 8/48 mutual as I have it or not?
3. Any other errors I have in this code?
Thanks!
I am looking for information on the p/8 and p/48 folders in regards to their location when searching the library for a part. Allow me to explain.
I am helping out with a Python-based .dat/.ldr parser (https://github.com/Tribex/LDRParser) that I eventually plan to use in my Blender import plugin (https://github.com/le717/LDR-Importer). As it stands, the parser does not support the 8/48 folders and I am looking into implementing it. I do have those folders supported in my plugin but lately I have begun to think I have implemented it incorrectly. I could not find a spec containing the info I am looking for, hence this topic. (If I am in the wrong section, please move it.)

Currently, I have the search path set up as so (assume HighRes and LowRes are strings representing a three option, mutual selection (so basically, radio buttons). The third value is StandardRes but unused.):
Code:
ldrawDir = "C:/LDraw"
paths = []
paths.append(modelLocation)
paths.append(join(ldrawDir, "models"))
// Unofficial parts
if exists(join(ldrawDir, "unofficial"))
paths.append(join(ldrawDir, "unofficial", "parts"))
if opt == HighRes
paths.append(join(ldrawDir, "unofficial", "p", "48"))
else if opt == LowRes
paths.append(join(ldrawDir, "unofficial", "p", "8"))
paths.append(join(ldrawDir, "unofficial", "p"))
// Standard library
paths.append(join(ldrawDir, "parts"))
if opt == HighRes
paths.append(join(ldrawDir, "p", "48"))
else if opt == LowRes
paths.append(join(ldrawDir, "p", "8"))
paths.append(join(ldrawDir, "p"))
My questions are:
1. Is this the correct search order I should be using?
2. Are use of the 8/48 mutual as I have it or not?
3. Any other errors I have in this code?
Thanks!
