You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
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:
If !TEXMAP linked to image.png check is there !DATA image.png in the LDraw-file defined with Base64;
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;
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);
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
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.
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:
<image_name>
file stored in the same folder with LDraw-file, if there is no such image in<library_folder>/parts/texture/
folder;!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.1. Create text as
model.ldr
and open it in text editor1.2. Copy
!TEXMAP
example code (from http://www.leocad.org/docs/texmap.html) intomodel.ldr
file;1.3. Create and place
bottom.png
andside.png
images in the same folder wheremodel.ldr
stored;1.4. Save it and open in LeoCAD
2.1. Create text as
model.ldr
and open it in text editor2.2. Copy
!TEXMAP
example code (from http://www.leocad.org/docs/texmap.html) intomodel.ldr
file;2.3. Embed
bottom.png
andside.png
with a Base64 encoding intomodel.ldr
directly using!DATA bottom.png
and!DATA side.png
commands (seesticker.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:!TEXMAP
linked toimage.png
check is there!DATA image.png
in the LDraw-file defined with Base64;!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;<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);<my_folder>/image.png
file, then use a fallback as implemented in Texmap parts with missing texture should use the fallback #213;Screenshots
Version (please complete the following information):
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
!TEXMAP
spec - https://www.ldraw.org/texmap-spec.html!DATA
spec - https://www.ldraw.org/article/47.htmlRelated issues:
The text was updated successfully, but these errors were encountered: