File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -677,8 +677,17 @@ def __readColourTable():
677677 subline = line_split [line_split .index ("MATERIAL" ):]
678678
679679 colour ["material" ] = LegoColours .__getValue (subline , "MATERIAL" )
680- hexDigits = LegoColours .__getValue (subline , "VALUE" )[1 :]
681- colour ["secondary_colour" ] = LegoColours .hexDigitsToLinearRGBA (hexDigits , 1.0 )
680+
681+ # current `FABRIC [VELVET | CANVAS | STRING | FUR]` is not yet supported.
682+ if colour ["material" ] == "FABRIC" :
683+ debugPrint (f"Unsupported material finish: { colour ['material' ]} for [colour: { name } code: { code } ] in line: { subline } " )
684+
685+ # Note, not all finishes have a secondary value
686+ finishValue = LegoColours .__getValue (subline , "VALUE" )
687+ if finishValue is not None :
688+ hexDigits = finishValue [1 :]
689+ colour ["secondary_colour" ] = LegoColours .hexDigitsToLinearRGBA (hexDigits , 1.0 )
690+
682691 colour ["fraction" ] = LegoColours .__getValue (subline , "FRACTION" )
683692 colour ["vfraction" ] = LegoColours .__getValue (subline , "VFRACTION" )
684693 colour ["size" ] = LegoColours .__getValue (subline , "SIZE" )
You can’t perform that action at this time.
0 commit comments