Changeset View
Changeset View
Standalone View
Standalone View
io_mesh_stl/blender_utils.py
| Context not available. | |||||
| scene = bpy.context.scene | scene = bpy.context.scene | ||||
| obj = bpy.data.objects.new(name, mesh) | obj = bpy.data.objects.new(name, mesh) | ||||
| scene.objects.link(obj) | collection = bpy.context.view_layer.collections.active.collection | ||||
| scene.objects.active = obj | collection.objects.link(obj) | ||||
| obj.select = True | obj.select_set('SELECT') | ||||
| def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False, triangulate=True): | def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False, triangulate=True): | ||||
| Context not available. | |||||
| # get the modifiers | # get the modifiers | ||||
| try: | try: | ||||
| mesh = ob.to_mesh(bpy.context.scene, use_mesh_modifiers, "PREVIEW") | mesh = ob.to_mesh(bpy.context.depsgraph, use_mesh_modifiers) | ||||
| except RuntimeError: | except RuntimeError: | ||||
| raise StopIteration | raise StopIteration | ||||
| Context not available. | |||||