leozide / leocad

A CAD application for creating virtual LEGO models
https://www.leocad.org
2.5k stars 211 forks source link

blender addon fails to load/install required files/libs #878

Open nathaneltitane opened 1 year ago

nathaneltitane commented 1 year ago

image

nathaneltitane commented 1 year ago

image

tampe125 commented 3 weeks ago

I'm bumping this issue since I had the same problem.
At first the problem was with downloading the zip archive, so I manually placed it in the download folder. I moved one step forward, but there' some output from addon installation so LeoCAD complains.
I even tried to install the addon manually inside Blender, but I can't find it in the list of Add-ons.
I suspect something might have been changed in Blender and the addon is no longer compatible (maybe?).

Some extra info: I'm using Blender 4.2.3 LTS, downloaded as AppImage and started it from terminal, nothing fancy.

trevorsandy commented 3 weeks ago

Hello Davide - Some questions if you don't mind...

  1. What platform are you running LeoCAD on ?
  2. What version of LeoCAD are you running ?
  3. What version of the Blender Addon are you running ?

At first the problem was with downloading the zip archive, so I manually placed it in the download folder.

  1. What was the actual download folder - which invariably was not correct ?

but there' some output from addon installation so LeoCAD complains.

  1. Can you provide the log information for the 'complains' ?

I even tried to install the addon manually inside Blender, but I can't find it in the list of Add-ons.

  1. Can you provide some more detail on what steps you took to manually install the addon ?
  2. Can you say exactly where you have placed the addon links (or modules) e.g. ...blender/4.2/scripts/addons ?

Version 1.5.5 and later was tested on Blender 4.2.1 (zip distro) on Windows 11.

Cheers,

tampe125 commented 3 weeks ago

Hello,

below you can find the requested answers:

  1. Ubuntu 20.04.6 LTS
  2. LeoCAD-Linux-ed29dad7-x86_64.AppImage
  3. Blender 4.2.3 LTS
  4. Failed to download Blender addon archive: /home/tampe125/.local/share/LeoCAD Software/LeoCAD/Blender/LDrawBlenderRenderAddons.zip . I manually created the directory path but LeoCAD still failed. I then manually downloaded the ZIP file from the repository, version 04.10.2024 and placed in that folder. LeoCAD says "Addon not configured - Update". I click on Update but nothing changes.
  5. Oddly enough, I tested again on home PC and nothing is displayed. I'll check later on my work PC since there's a different version of Ubuntu
  6. If I open Blender and get in the Addon tab, I can't see anything related to LDraw/LeoCAD/LEGO in general. So I performed the manual installation by clicking on "Install from Disk". Nothing changes on the GUI, but in the console I get the message "Modules Installed () from '/tmp/LDrawBlenderRenderAddons.zip' into '/home/tampe125/.config/blender/4.2/scripts/addons'"
  7. See above, I didn't manually move any file, I simply used Blender interface
trevorsandy commented 3 weeks ago

At first the problem was with downloading the zip archive, so I manually placed it in the download folder. I moved one step forward, but there' some output from addon installation so LeoCAD complains.

The download behaviour is most likely because the AppImage build is not able to resolve required SSL paths - which produces this output on LeoCAD appimage startup:

qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get_peer_certificate

I even tried to install the addon manually inside Blender, but I can't find it in the list of Add-ons.

You must use the addon install script to perform the installation otherwise the addon will not be properly configured. This is most likely why you do not see the addon inside Blender after attempting to install the modules directly from the Blender UI.

I'm trying to replicate your environment (using WSL2) without success. LeoCAD is ok but Blender 4.2.3 immediately segfaults on launch with an EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers not supplied by a valid surface). error. I also tried with a Docker Ubuntu image using Xsrv and could not get Blender to start there either.

The net-net is I wasn't able to actually test the following guidance on manually installing the addon using the addon script.

The following assumes Blender and LDraw are installed at /home/tampe125/software, change accordingly.

  1. Open a console session and set required environment variables:
export LDRAW_DIRECTORY=/home/tampe125/software/ldraw
export ADDONS_TO_LOAD=[{"load_dir":"/home/tampe125/.local/share/LeoCAD Software/LeoCAD/Blender/addons/io_scene_import_ldraw","module_name":"io_scene_import_ldraw"},{"load_dir":"/home/tampe125/.local/share/LeoCAD Software/LeoCAD/Blender/addons/io_scene_import_ldraw_mm","module_name":"io_scene_import_ldraw_mm"},{"load_dir":"/home/tampe125/.local/share/LeoCAD Software/LeoCAD/Blender/addons/io_scene_render_ldraw","module_name":"io_scene_render_ldraw"}]
  1. Download and extract the Blender Addon
cd "/home/tampe125/.local/share/LeoCAD Software/LeoCAD/Blender/"
wget . "https://github.com/trevorsandy/blenderldrawrender/releases/download/v1.5.6/LDrawBlenderRenderAddons.zip"
unzip LDrawBlenderRenderAddons.zip
  1. Install the addon - Enable LDraw Import MM (Disable LDraw Import TN in Blender, use --disable_ldraw_import_mm to Enable LDraw Import TN)
/home/tampe125/software/blender-4.2.3/blender-launcher  --background --python install_blender_ldraw_addons.py -- --leocad --disable_ldraw_import

If there are any problems, you can check the stderr and stdout logs which will be deposited at your present location.

Additionally, before launching the addon dialog in LeoCAD, review the LDrawRendererPreferences.ini file in ./setup/addon_setup/config to ensure keys ldrawdirectory, ParameterFile, ldrawpath have valid values.

Open the addon dialog in LeoCAD and confirm no errors in configuration.

Cheers,