replace Drawing.remove_object_data with more general method

This commit is contained in:
Andrej730
2023-09-25 11:55:56 +05:00
parent eee799bfc4
commit 9f7dffb29d
+1 -11
View File
@@ -249,17 +249,7 @@ class Drawing(blenderbim.core.tool.Drawing):
obj_data = obj.data
bpy.data.objects.remove(obj)
if obj_data and obj_data.users == 0: # in case we have drawing element types
cls.remove_object_data(obj_data)
@classmethod
def remove_object_data(cls, data):
"""also removes all related objects"""
if isinstance(data, bpy.types.Camera):
bpy.data.cameras.remove(data)
elif isinstance(data, bpy.types.Mesh):
bpy.data.meshes.remove(data)
elif isinstance(data, bpy.types.Curve):
bpy.data.curves.remove(data)
tool.Blender.remove_data_block(obj_data)
@classmethod
def delete_object(cls, obj):