Referencing to this code: Create a Cube in Blender from Python
import bpy
import bmesh
bpyscene = bpy.context.scene
# Create an empty mesh and the object.
mesh = bpy.data.meshes.new('Basic_Sphere')
basic_sphere = bpy.data.objects.new("Basic_Sphere", mesh)
# Add the object into the scene.
bpyscene.objects.link(basic_sphere)
bpyscene.objects.active = basic_sphere
basic_sphere.select = True
# Construct the bmesh cube and assign it to the blender mesh.
bm = bmesh.new()
bmesh.ops.create_uvsphere(bm) # How to set the arguments right?
bm.to_mesh(mesh)
bm.free()
Can someone explain how to set the arguments write for this function?
bmesh.ops.create_uvsphere(bm, u_segments, v_segments, diameter, matrix, calc_uvs)
I am new to bpy, bmesh and I am looking for some more explaination on how to set these arguments right. My goal is to generate a UV Sphere with Subdivision Surface modiefier and smooth ;). Someone can give me some further explainations on how to create a UV Sphere with the script? Thanks :)