Official/unofficial parts load/search order #652
Replies: 7 comments 2 replies
-
Interesting. I'd expected (I only have the latest OFFICIAL parts atm)
the the search order to OFFICIAL then UNOFFICIAL to fill in.
…On 3/11/21 7:40 AM, Trevor SANDY wrote:
When the UNOFFICIAL archive library is present, loaded parts will
ultimately point to this archive if those parts happen to also be
OFFICIAL. The offending code is here
<https://github.com/leozide/leocad/blob/57c4f2912dfedec9df27cad909765f40b0809ff1/common/lc_library.cpp#L451>.
This is not usually an expected behaviour because the maturity of
unofficial parts may be less than its official counterpart and the
behaviour (e.g. orientation) may also be different.
Although this scenario (official and unofficial files with the same name
and different behaviour) is an uncommon exception and should actually
not be permitted by the LDraw administrators, it is a valid use case, as
we can see here <trevorsandy/lpub3d#508>, so
I’ll add a flag in my LeoCAD library for LPub3D preference dialogue to
allow the user to specify the official/unofficial search order when the
unofficial library is present. Other popular LDraw editors and viewers
either default to the official part or offer a search order choice.
If you believe this update is useful, let me know and I’ll author a PR
for LeoCAD.
Cheers,
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#652>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAECJNGQNILZ3JLA3K55OGTTDC25PANCNFSM4ZAGRFCQ>.
|
Beta Was this translation helpful? Give feedback.
-
The order was intentional, I thought that unofficial parts could have fixes for official parts so they should have priority. I've tried to get the official answer from LDraw but I couldn't: https://forums.ldraw.org/thread-23765-post-34726.html I think it's ok to change the order for everyone, I don't think need an option for this. |
Beta Was this translation helpful? Give feedback.
-
That forum exchange was pretty un-enlightening.
Another option is to have a settable search path.
…On 3/11/21 4:24 PM, Leonardo Zide wrote:
The order was intentional, I thought that unofficial parts could have
fixes for official parts so they should have priority. I've tried to get
the official answer from LDraw but I couldn't:
https://forums.ldraw.org/thread-23765-post-34726.html
<https://forums.ldraw.org/thread-23765-post-34726.html>
I think it's ok to change the order for everyone, I don't think need an
option for this.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#652 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAECJNBHHEC7JL6DCV7JTJDTDERGTANCNFSM4ZAGRFCQ>.
|
Beta Was this translation helpful? Give feedback.
-
Very well. This update is quite trivial so just I'll close the submitted PR. Cheers, |
Beta Was this translation helpful? Give feedback.
-
I'm tracking this today, looks like LDView searches official parts first too so it either changed or the post is incorrect. https://github.com/tcobbs/ldview/blob/6407a79c2f3a77710afa4cd8b24bb298bce3c76b/LDLoader/LDrawIni.c#L430 |
Beta Was this translation helpful? Give feedback.
-
I don’t understand. What has changed or is incorrectly posted? Indeed, my understanding LDView by default will load/lookup official parts and does not lookup unofficial parts unless the unofficial directory is explicitly specified. The code at the link you provided is triggered when LDraw.ini is present but search directory entries are not specified. Nevertheless, it confirms the default load/lookup order starts with official parts. For Windows and MacOS, you can specify extra search directories from the extra search directories menu action and LDView.ini file. On Unix, it can be done via the LDView.ini file. Cheers, |
Beta Was this translation helpful? Give feedback.
-
Code talks...
…On 3/13/21 1:16 PM, Leonardo Zide wrote:
I don’t understand. What has changed or is incorrectly posted?
The conversation in the LDraw forums had unofficial folders first.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#652 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAECJNAH3T77NVTLKO5SSBTTDOMWPANCNFSM4ZAGRFCQ>.
|
Beta Was this translation helpful? Give feedback.
-
When the UNOFFICIAL library is present, loaded parts will ultimately point to this archive/directory if those parts are present in the OFFICIAL library. The offending code is here for archive libraries, and here and here for disc libraries. This is not usually an expected behaviour because the maturity of unofficial parts may be less than their official counterpart and the behaviour (e.g. orientation) may also be different.
Although this scenario (official and unofficial files with the same name and different behaviour) is an uncommon exception and should actually not be permitted by the LDraw administrators (in their released libraries), it is a valid use case, as we can see here, so I’ll add a flag in my LeoCAD library for LPub3D preference dialogue to allow the user to specify the official/unofficial search order when the unofficial library is present. Other popular LDraw editors and viewers either default to the official part or offer a search order choice.
The thinking behind adding a search order preference flag versus simply defaulting to the official part takes into account the scenario where the user may intentionally have modified official parts in his/her unofficial library. Moreover, looking at the code, loading/searching the unofficial libraries first when they are present is clearly intentional.
If you believe this update is useful, let me know and I’ll author a PR for LeoCAD.
Cheers,
Beta Was this translation helpful? Give feedback.
All reactions