Fix #1491. Bug where drawings couldn't have a slash in their names.

This commit is contained in:
Dion Moult
2021-05-28 17:26:00 +10:00
parent acc9bd736f
commit 7fe2e93dea
2 changed files with 6 additions and 4 deletions
@@ -1059,7 +1059,7 @@ class RefreshDrawingList(bpy.types.Operator):
continue
if "IfcAnnotation/" in obj.name:
new = bpy.context.scene.DocProperties.drawings.add()
new.name = obj.name.split("/")[1]
new.name = "/".join(obj.name.split("/")[1:])
new.camera = obj
return {"FINISHED"}
@@ -99,9 +99,11 @@ def updateDrawingName(self, context):
return
if self.camera.name == self.name:
return
self.camera.name = "IfcGroup/{}".format(self.name)
self.camera.users_collection[0].name = self.camera.name
self.name = self.camera.name.split("/")[1]
self.camera.name = "IfcAnnotation/{}".format(self.name)
unique_name = "/".join(self.camera.name.split("/")[1:])
self.camera.users_collection[0].name = "IfcGroup/{}".format(unique_name)
if self.name != unique_name:
self.name = unique_name
def refreshActiveDrawingIndex(self, context):