Make python Regex Strings raw to avoid py3.12 SyntaxError

This commit is contained in:
bgbsww
2024-09-26 18:12:20 -04:00
committed by Yorik van Havre
parent e41def8c74
commit 64ecfe7a0e
26 changed files with 75 additions and 75 deletions

View File

@@ -971,12 +971,12 @@ class ViewProviderBuildingPart:
iv = self.Object.Shape.writeInventor()
import re
if colors:
if len(re.findall("IndexedFaceSet",iv)) == len(obj.Shape.Faces):
if len(re.findall(r"IndexedFaceSet",iv)) == len(obj.Shape.Faces):
# convert colors to iv representations
colors = ["Material { diffuseColor "+str(color[0])+" "+str(color[1])+" "+str(color[2])+"}\n IndexedFaceSet" for color in colors]
# replace
callback.v=iter(colors)
iv = re.sub("IndexedFaceSet",callback,iv)
iv = re.sub(r"IndexedFaceSet",callback,iv)
else:
print("Debug: IndexedFaceSet mismatch in",obj.Label)
# save embedded file