Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helpers and Third Party parts are not shown in the "Parts" list #941

Open
app4soft opened this issue Oct 10, 2024 · 3 comments
Open

Helpers and Third Party parts are not shown in the "Parts" list #941

app4soft opened this issue Oct 10, 2024 · 3 comments
Labels

Comments

@app4soft
Copy link

app4soft commented Oct 10, 2024

Describe the bug

"Helpers" and "Third Party" parts, which names starts with "|" (Vertical bar, U+007C), are not shown in "Parts" list.

UPDATE: Parts with "|" in the prefixes are shown only in "All Parts" list, but not in categories they are assigned to.

But such parts are visible via "Prefernces > Categories > Unassigned" and its possible to create a custom category with such parts via "Preferences > Categories" (even assigned to newly created catgories such parts still are invisible in the parts list).

To Reproduce

Steps to reproduce the behavior:

  1. Install latest LDraw Parts Library (both complete.zip and ldrawunf.zip from https://library.ldraw.org);
  2. Try to find in "Parts" list parts with the names started with "|" symbol

Expected behavior

LeoCAD should support "Helpers" and "Third Party" parts to be shown in the "Parts" list.

If there is no categories "Helpers" and "Third Party" yet, then "Helpers" and "Third Party" parts should be shown in "All Parts" category.

Screenshots

LeoCAD_helpers1

LeoCAD_helpers2

Version (please complete the following information):

  • OS: Debian
  • LeoCAD Version: continuous

Crash information:

None

Additional context

Its now allowed to include "Helpers" and "Third Party" parts to the official LDraw Parts Library.

Both these categories has parts named with the "|" prefix character.

@app4soft app4soft added the bug label Oct 10, 2024
@nathaneltitane
Copy link

similar to #394 ?

@app4soft
Copy link
Author

app4soft commented Oct 11, 2024

No, #394 could be simple fixed with switching to "All Parts" in "Parts" list.

@nathaneltitane, Actual issue is about parts started with some Special Prefix Characters (as you mentioned = in #394 (comment)):

Actually in LeoCAD, parts with ~ and _ prefixes are visible in "Parts" list.

But parts with = (including _=, ~=, etc.) and | (including ~|, _~|, =|, _=|, etc.) prefixes are invisible in "Parts" list.

Special Prefix Characters

Some programs rely on the parts.lst file rather than the LDRAW_ORG meta-statement. Special prefix characters are added to the start of the part description to prevent the parts being included in the list by these programs:

  • The descriptions of all subparts (i.e. line 4 = '0 !LDRAW_ORG Subpart') must start with '~'
  • The description of all obsolete parts, maintained for backwards compatibility must start with '~'
  • The use of '~' for non "s" part files is at the author's discretion, to hide mouldings that are not released independently. This is one case where merely reading the LDRAW_ORG line is insufficient for tools to know how to treat the file.
  • The descriptions of all aliases (i.e. line 4 = '0 !LDRAW_ORG Part Alias') must start with '='
  • The descriptions of all third party parts must start with '|' or '~|' (as appropriate)
  • The descriptions of all physical colour parts (i.e. line 4 = '0 !LDRAW_ORG Part Physical_Colour') should start with '_' (This usage is depreciated)

Possible solution

@leozide, In LeoCAD there should be "Helpers" category added for parts in Parts Library parts/helpers/ folder and for parts with !CATEGORY Helpers;

Also, there should be extra checkbox options added to "Parts" list settings (or to "Preferences > Categories"):

As Third Party parts (with | and/or !CATEGORY Third Party) could be in various categories, adding "Third Party" category in LeoCAD is not needed (users may create "Third Party" category via "Preferences > Categories" itself if needed)

Also, as all "Helpers" should be named with 0 |Helper ... and there is no !CATEGORY in such files, software such LeoCAD should use its first word (without ~_=| prefixes) in the first line of file as category (i.e., such files should identified as with !CATEGORY Helper).

All "Helpers" are stored in are stored in parts/helpers/ subfolder in Parts Library.

Sample

Sample "Helper 2D Ruler 100 LDU" part:

@app4soft
Copy link
Author

app4soft commented Oct 17, 2024

@leozide, Addition on this issue:

  1. Parts with ~_=| prefixes are shown in "All Parts" list;
  2. But, parts with | in the prefixes are not shown in appropriate categories, even such parts has !CATEGORY command defined.
  3. If create a new category with matching keywords, parts with | in the prefixes appears in a such new category;
  4. All parts with | in the prefixes are recognized as "Decorated Parts", even there are parts not decorated at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants