Fixed errors from 9bca705

This commit is contained in:
Andrej730
2023-04-10 12:27:18 +05:00
parent 8b302f8d21
commit d1dee1e908
+2 -2
View File
@@ -152,7 +152,7 @@ class Drawing(blenderbim.core.tool.Drawing):
if obj: if obj:
obj_data = obj.data obj_data = obj.data
bpy.data.objects.remove(obj) bpy.data.objects.remove(obj)
if obj_data.users == 0: # in case we have drawing element types if obj_data and obj_data.users == 0: # in case we have drawing element types
cls.remove_object_data(obj_data) cls.remove_object_data(obj_data)
@classmethod @classmethod
@@ -163,7 +163,7 @@ class Drawing(blenderbim.core.tool.Drawing):
elif isinstance(data, bpy.types.Mesh): elif isinstance(data, bpy.types.Mesh):
bpy.data.meshes.remove(data) bpy.data.meshes.remove(data)
elif isinstance(data, bpy.types.Curve): elif isinstance(data, bpy.types.Curve):
bpy.data.curves.remove(C.object.data) bpy.data.curves.remove(data)
@classmethod @classmethod
def delete_object(cls, obj): def delete_object(cls, obj):