mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
replace Drawing.remove_object_data with more general method
This commit is contained in:
@@ -249,17 +249,7 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
obj_data = obj.data
|
obj_data = obj.data
|
||||||
bpy.data.objects.remove(obj)
|
bpy.data.objects.remove(obj)
|
||||||
if obj_data and 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)
|
tool.Blender.remove_data_block(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)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def delete_object(cls, obj):
|
def delete_object(cls, obj):
|
||||||
|
|||||||
Reference in New Issue
Block a user