From 74ad3978a02e60e84d7de8a2739420b7290b9af5 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Thu, 22 May 2025 12:17:32 +0200 Subject: [PATCH] BIM: Add support for concatenation of lines in Obj files If a line in an obj file ends with '\', the following line is appended. --- src/Mod/BIM/importers/importOBJ.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/BIM/importers/importOBJ.py b/src/Mod/BIM/importers/importOBJ.py index 569ac41ad0..e3629d048f 100644 --- a/src/Mod/BIM/importers/importOBJ.py +++ b/src/Mod/BIM/importers/importOBJ.py @@ -325,16 +325,18 @@ def insert(filename,docname): colortable = {} content_array = [] for line in infile: + line = line.strip() + while line.endswith('\\'): + next_line = next(infile).strip() + line = line.rstrip()[:-1] + ' ' + next_line content_array.append(line) activeobjectExists = False for line in content_array: - line = line.strip() if line[:2] == "o ": activeobjectExists = True if not activeobjectExists: activeobject = meshName for index, line in enumerate(content_array): - line = line.strip() if line[:7] == "mtllib ": matlib = os.path.join(os.path.dirname(filename),line[7:]) if os.path.exists(matlib):