ImportLDraw icon indicating copy to clipboard operation
ImportLDraw copied to clipboard

LDraw material finish `FABRIC` causes model loads to fail

Open sgebbie opened this issue 6 months ago • 1 comments
trafficstars

The LDraw colour spec[^1] has been extended[^2] with:

  • Revision: 01-Apr-2025
  • FABRIC [VELVET | CANVAS | STRING | FUR]

The current implementation of LegoColours::__readColourTable() in loadldraw/loadldraw.py, fails with:

  • TypeError: 'NoneType' object is not subscriptable

when attempting to import a .dat or .ldr model, while referencing the latest parts library[^3].

$ ~/opt/blender/blender-4.3.2-linux-x64/blender
Info: Deleted 1 object(s)
21:04:02.26 [importldraw] The LDraw Parts Library path to be used is: /home/stewart/opt/lego/ldraw/library
21:04:02.26 [importldraw] Use LSynth Parts requested
21:04:02.26 [importldraw] Standard-res primitives selected
Traceback (most recent call last):
  File "/home/stewart/.config/blender/4.3/scripts/addons/io_scene_importldraw/importldraw.py", line 399, in execute
    loadldraw.loadFromFile(self, self.filepath)
  File "/home/stewart/.config/blender/4.3/scripts/addons/io_scene_importldraw/loadldraw/loadldraw.py", line 4530, in loadFromFile
    LegoColours()
  File "/home/stewart/.config/blender/4.3/scripts/addons/io_scene_importldraw/loadldraw/loadldraw.py", line 839, in __init__
    LegoColours.__readColourTable()
  File "/home/stewart/.config/blender/4.3/scripts/addons/io_scene_importldraw/loadldraw/loadldraw.py", line 680, in __readColourTable
    hexDigits                  = LegoColours.__getValue(subline, "VALUE")[1:]
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
TypeError: 'NoneType' object is not subscriptable
Saved session recovery to "/home/stewart/work/gethos/projects/3d-models/tmp/quit.blend"

Blender quit

[^1]:Documentation: Colour Definition (!COLOUR) Language Extension - Material [^2]:LDraw - Documentation: Colour Definition Reference [^3]:LDraw.org Parts Update 2025-04

sgebbie avatar May 03 '25 13:05 sgebbie