-
Notifications
You must be signed in to change notification settings - Fork 9
bmesh_ops_primitives
Dealga McArdle edited this page Oct 27, 2015
·
4 revisions
- bmesh.ops.create_grid
- bmesh.ops.create_uvsphere
- bmesh.ops.create_icosphere
- bmesh.ops.create_monkey
- bmesh.ops.create_cone
- bmesh.ops.create_circle
- bmesh.ops.create_cube
Currently bpy docs lists the above primitives, but search the docs with bmesh.ops.create
for the full list of primitives and their parameter lists.
To create a uv sphere with bmesh.ops
:
import bpy
import bmesh
def create_uv_sphere(name, u=5, v=4, d=1):
# bmesh.ops.create_uvsphere also accepts a matrix keyword argument,
# which i've dropped from the example.
bm = bmesh.new()
bmesh.ops.create_uvsphere(bm, u_segments=u, v_segments=v, diameter=d)
# create new empty mesh and fill with uvsphere
mesh = bpy.data.meshes.new(name + "_mesh")
bm.to_mesh(mesh)
bm.free()
# create object and link to scene
obj = bpy.data.objects.new(name, mesh)
bpy.context.scene.objects.link(obj)
return obj
create_uv_sphere('my_uvsphere', u=5, v=4, d=1)
During your experimentation you might encounter errors when you pick and mix which arguments to use.
If you get SyntaxError: non-keyword arg after keyword arg
it's explained here in the python docs. Reading that will increase your Python-fu!
Introduction
Objects / Mesh / BMesh
- Empty - null object
- Mesh
- Bmesh
- bmesh.ops - primitives
- bmesh.ops - mesh opsπ§
- Curves (2d, 3d)
- Text (Font Objects)
- Duplication (instancing)
- Metaballs
Time and Motion
- scripted keyframesπ
- Event Handlersπ
- Drivers
Miscellaneous bpy.data.*
Order / Organization
- Groupingπ
- Parentingπ
- Layers
- UI / Layoutπ
Miscellaneous
- Mathutilsπ
- Modifiersπ
- Particle Systemsπ
- vertex colorsπ
- Textures UV DPI
- Propertiesπ§
- Operators (and callbacks)π§
- bgl / blfπ
- Grease Pencil
- Themes
- Areas
Add-ons
- introductionπ
- import / exportπ
- Text Editorπ
- Custom Nodesπ