Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 55

Blender Python Bmesh module, added in 2.63, provides an alternative method of manipulating meshes "giving Python access to the functions used by Blender’s own mesh editing tools.". Use this tag for question about using the Bmesh module in Python scripts and add-ons.

13 votes
Accepted

What is the technical difference between an Ngon and a bunch of Triangles?

This question is very generic - but you give a very specific example (Subsurf) which happens to treat ngons differently to many triangles (to be clear - differently to a triangulated ngon). The answe …
ideasman42's user avatar
11 votes
Accepted

Is there a way to select edges marked as sharp via python?

There isn't a single command for this, but a script to do this is quite simple: Note that with BMesh, the same smooth option is used for faces and edges (not smooth == sharp). … import bpy import bmesh obj = bpy.context.edit_object me = obj.data bm = bmesh.from_edit_mesh(me) for e in bm.edges: if not e.smooth: e.select = True bmesh.update_edit_mesh(me, False) …
ideasman42's user avatar
4 votes

How to fix ngons overlapping wire edges?

There are 2 ways I would suggest to fix up a model with edges like this. Using Fill holes: This tool was written for almost this exact case, it has the advantage it will fill in UV's. vertex-colors …
ideasman42's user avatar
3 votes
Accepted

Order of vertices added using Python script and bmesh

BMesh only ensure vertices are added in-order when they are added to a newly created (or converted) mesh (which is OK for importers and geometry generators). …
ideasman42's user avatar
9 votes
Accepted

How to add a UV Map to a Mesh Using Python

There is also a snippet in BMesh docs. …
ideasman42's user avatar
20 votes
Accepted

how to use BMesh to add verts, faces, and edges to existing geometry

So instead, just exit editmode and blender will handle converting the modified bmesh into the object mode mesh data. … import bpy, bmesh obj = bpy.context.object me = obj.data bm = bmesh.from_edit_mesh(me) v1 = bm.verts.new((2.0, 2.0, 2.0)) v2 = bm.verts.new((-2.0, 2.0, 2.0)) v3 = bm.verts.new((-2.0, -2.0, 2.0)) bm.faces.new …
ideasman42's user avatar
2 votes
Accepted

How to access vertex_color layer directly from inside BMVert

Vertex colors are stored in face loops, you can't ignore/overlook this. However its reasonable that you might want to generate vertex colors per vertex and not have to deal with looping on vertex-loo …
ideasman42's user avatar
1 vote
Accepted

Script to separate an object's mesh without using bpy.ops

No, currently the only method for splitting objects uses bpy.ops, there aren't always API equivalents for each blender operator.
ideasman42's user avatar
5 votes
Accepted

Manipulate Vertex group names in the bmesh API

Vertex group names are stored in the object, not the mesh. The order of groups just has to be aligned between the mesh and the object. So yes, you have to name the group on the object.
ideasman42's user avatar