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

Model with defined !TEXMAP has no texture shown #937

Open
app4soft opened this issue Oct 8, 2024 · 0 comments
Open

Model with defined !TEXMAP has no texture shown #937

app4soft opened this issue Oct 8, 2024 · 0 comments
Labels

Comments

@app4soft
Copy link

app4soft commented Oct 8, 2024

Describe the bug
I tried to use all possible ways to link raster image texture, but LeoCAD does not show textures for the custom created part in some cases.

Actually LeoCAD supports only texture like !TEXMAP ... <image_name>, which is placed in <library_folder>/parts/texture/<image_name>.

But LDraw Specification allows two more options:

  • use <image_name> file stored in the same folder with LDraw-file, if there is no such image in <library_folder>/parts/texture/ folder;
  • use !DATA <image_name> command to store textures inside LDraw files in Base64, and link it as !TEXMAP ... <image_name>

To Reproduce

Steps to reproduce the behavior:

  1. Case A:
    1.1. Create text as model.ldr and open it in text editor
    1.2. Copy !TEXMAP example code (from http://www.leocad.org/docs/texmap.html) into model.ldr file;
    1.3. Create and place bottom.png and side.png images in the same folder where model.ldr stored;
    1.4. Save it and open in LeoCAD
  2. Case B:
    2.1. Create text as model.ldr and open it in text editor
    2.2. Copy !TEXMAP example code (from http://www.leocad.org/docs/texmap.html) into model.ldr file;
    2.3. Embed bottom.png and side.png with a Base64 encoding into model.ldr directly using !DATA bottom.png and !DATA side.png commands (see sticker.ldr sample from !DATA spec: https://www.ldraw.org/article/47.html);
    2.4. Save it and open in LeoCAD

Expected behavior

!TEXMAP should work as expected, according to LDraw Specification and to the next algorythm:

  1. If !TEXMAP linked to image.png check is there !DATA image.png in the LDraw-file defined with Base64;
  2. If there is no !DATA image.png command in the LDraw-file, check is there <library_folder>/parts/texture/image.png file, where <library_folder> is a path to LDraw Part Library folder;
  3. If there is no <library_folder>/parts/texture/image.png, check is there <my_folder>/image.png file, where <my_folder> is a path to folder containing actual LDraw-file (i.e. <my_folder>/model.ldr, e.g. /home/user123/Documents/model.ldr or just ~/Documents/model.ldr on Linux);
  4. If there is no <my_folder>/image.png file, then use a fallback as implemented in Texmap parts with missing texture should use the fallback #213;
  5. If fallback used, show also a notification window with the list of missing textures (or at least print a list of missed textures in the LeoCAD's CLI output during model loading).

Screenshots

Screenshot_2024-10-08_03-07-28

Version (please complete the following information):

  • OS: Debian 12
  • LeoCAD Version continuous (AppImage)

Crash information:
Some versions of LeoCAD will show a message that they saved a minidump file when they crash, if you see this message please attach the file.

Additional context

Related issues:

@app4soft app4soft added the bug label Oct 8, 2024
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

1 participant