diff --git a/lib/objects.py b/lib/objects.py index 91655e1..a9923c1 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -6,13 +6,18 @@ def add_single_vertex_object(cls, context, name): mesh = bpy.data.meshes.new("ND — " + name) obj = bpy.data.objects.new("ND — " + name, mesh) - bpy.data.collections[context.collection.name].objects.link(obj) + + bpy.context.collection.objects.link(obj) + bm = bmesh.new() bm.verts.new() bm.to_mesh(mesh) bm.free() + obj.select_set(True) + context.view_layer.objects.active = obj + bpy.ops.object.shade_smooth() obj.data.use_auto_smooth = True obj.data.auto_smooth_angle = radians(30)