Questions tagged [bmesh]

Blender's new mesh system that was added in 2.63, with full support for N-sided polygons instead of only triangles and quads.

Filter by
Sorted by
Tagged with
4
votes
1answer
1k views

Cut BMesh with python

Goal: Efficiently cut out (holes) or trim off regions of dense meshes defined by editable polyline or bezier curves which are snapped to a mesh surface. Uses: My narrow use is to cut teeth out of ...
0
votes
1answer
214 views

How to get Blender to add new face-ids but not recalculate old face-ids?

I am writing a procedural planet generation addon. I thought it would be nice to give the user the ability to create continents. He can create a continent, give it a name and add some faces to it (...
10
votes
3answers
3k views

How to keyframe mesh vertices in Python

I'm updating all the vertex coordinates of a mesh frame-by-frame in python and need to animate but can not figure out how. Here is a small abstracted script - the python isn't pretty, but it makes an ...
2
votes
1answer
681 views

Does bmesh guarantee order of vertex in a edge according to the time they were added

I would like to represent directions in a single edge in a mesh similar to a curve. However I cannot use curves themselves due to performance issues when dealing with huge amount of curves and not ...
4
votes
2answers
2k views

Use the bevel-tool from python script

I want to use the bevel-tool to add a face between two other faces. The bevel-tool should use the selected edge(s) as geometry.location is given via a selected edge. This is what I have This is ...
3
votes
1answer
2k views

Error after script selects object and tries to change to “EDIT” mode

This script builds a 3-digit, 7-segment red LED display and cycles through 0-315 in steps of 45. But it doesn't quite work. When changing the first digit to "EDIT" mode in order to change the ...
1
vote
0answers
230 views

Exclude specific vertices from selected vertices

I have a mesh, and i use 'select boundary loop' to select all the vertices on the outline of my mesh. after that i need to exclude from this selection some vertices from a list of vertices stored in ...
5
votes
2answers
939 views

Selecting a face in a script so that you can edit eg resize it?

I was trying to write a script to generate an object from primitives but came across a problem I couldn't solve. The code generates a cylinder and finds the face as well as putting it into edit mode. ...
1
vote
1answer
2k views

Can't write bmesh object back to mesh datablock

I'm struggling to learn Blender's structures and types and use Python to modify meshes. In trying to sort out image updating, bmesh and mesh data, I copied the following code from the Blender 2.64 ...
1
vote
0answers
62 views

How to select vertices sequentially in a script and see it happen in 3D viewer [duplicate]

I am trying to make a visual explanation of vertex sequence for a mesh object. I pieced this script together from the internet. It runs, but I don't see anything happen. How can I get the effect to be ...
1
vote
1answer
90 views

Bmesh.ops.mesh_to_bmesh usage returns cryptic error

I was messing around with bmesh and tried to use the mesh_to_bmesh operation, however, I was returned this error... ...
5
votes
3answers
1k views

BMesh polygons with holes

Is it possible to create a BMesh polygon (BMFace) with holes via Python? Use case. I need that for my addons that import geographical data. A polygon for Rome has a hole for Vatican City.
1
vote
1answer
1k views

Custom data of vertices, Vertex Layers

I found this answer (first answer) Python: assign custom tag to vertices I'm pretty excited of this. But I have some questions: 1) How to get all vertices which have 'my_id' custom data? 2) How to ...
2
votes
1answer
494 views

Python: fix normal of a new polygon

I've been working on retopo tools. I have created polygon loops with "bmesh.faces.new()". But i get a problem with face normal orientation. Some faces get inverted direction. Here is my test: http://...
2
votes
1answer
914 views

Python BMesh: index of new verts?

When i try to create verts with BMesh i get always the same verts index. ...
3
votes
2answers
740 views

Creating pockets using bmesh/python

I'm trying to figure out how to create a pocket using bmesh (Python Console). The regular workflow to create the example below could be as follows — Add a Cube in Object Mode, tab into Edit Mode and ...
5
votes
1answer
678 views

Getting the number of faces a certain vertex is part of

I am in edit mode and using bmesh to get all faces. I am iteration through the faces and their vertices. Now I want to know on how many faces the vertex, I currently have, is part of. For example this ...
3
votes
2answers
2k views

how add properties to operator modal draw?

UPDATE Here another example in order to clarify this question, I did a video in order to resume the problem https://www.youtube.com/watch?v=yShhJOzkJBk: here the addon working without the BGL CODE.....
7
votes
1answer
4k views

Select neighbour faces from a mesh with python

I am new to blender and python and try to get the hang of it. PS: Everything should be achieved via python script. I want to create a low poly model via ico-sphere. That's really easy because I just ...
2
votes
1answer
293 views

How calc value of translate with constraint_orientation=“VIEW”?

I want to translate some vertices in X axis with constraint_orientation="VIEW" but I dont' know how calc the values??... next code should work but I don´t know how calc the value in this parameters ...
6
votes
3answers
2k views

Finding the lists of connected indices associated with disjoint mesh elements

Is there a fast way (without looping over all edges/faces/verts) using ops.mesh or bmesh to get the lists of indices associated ...
2
votes
1answer
1k views

bisect plane normal (mesh and bmesh) how calc the 3th vector to mathutils.geometry?

UPDATE 1: how calc the 3th vector to mathutils.geometry.normal(vectors)?? After @Chebhou answer I tried my "bisector tool" again... with mesh and bmesh.. now the problem is the 3th vector to calc ...
2
votes
1answer
660 views

Fix t-junction in mesh

I'm currently modifying a mesh using a Python script. I just realised that my mesh have a few t-junctions, which I would like to fix. Is there any way to fix t-junctions in Blender? If so, is it also ...
1
vote
1answer
409 views

Blender Alters .Obj vertex list

I have a wavefront .obj file and a sharp edge list which are mapped with the vertex index form the .obj file. Now I want to add some functionality in the .obj file based on the sharp edge list. But ...
7
votes
2answers
4k views

Assigning material to every second face via python

I want to do something like this with a python script and selecting the vertex in the middle: I tried with many ideas as: ...
5
votes
1answer
516 views

How can I find out the correct order of vertices to create a quad face with bmesh?

Let's say I have 4 vertices and want to create a quad face with bmesh. Is there way to figure out the right order of the vertices to not get a face like this But rather a face like this.
6
votes
1answer
1k views

Are there any tools for making irregular polygons regular?

Are there any tools in Blender that take irregular polygons and make them regular (approximate a circle)? I'm specifically looking for a solution that works with preexisting polygons. Also, it would ...
2
votes
1answer
425 views

how access to new vertices after bmesh.ops.bisect_edges?

I'm trying to access to new vertices after apply bmesh.ops.bisect_edges API say that newly created vertices and edges will be in geom_split. I can print"geom_split" data, but I can't access to new ...
4
votes
1answer
648 views

Replacing all mesh elements in a Mesh object

I'm working on the Animation Nodes Addon and want to create some new nodes which can work with mesh data like polygons. To output the created mesh I have to put it onto an object like this: ...
1
vote
1answer
652 views

Python: Access mesh selection history data

I want to write an addon that can combine two selections with a logical AND. For example, the user use via normal gui bpy.ops.mesh.select_similar(type='LENGTH') ...
18
votes
1answer
17k views

How can n-gons be selected?

Editing a mesh for a while I didn't notice that I created a n-gon. After adding a subsurf modifier the mesh heavily deformed, it took while until I found this: Is there an easy way to select n-gons?
0
votes
0answers
790 views

Using closest_point_on_mesh on object manipulated as bmesh

I am trying to script some object manipulation using the bmesh module. During steps of this scripting I would like to be able to use the closest_point_on_mesh ...
3
votes
0answers
103 views

how to find all faces linked to a specific face [duplicate]

I need to find all parts of a mesh which are separated by seams, or which are unconnected sub meshes. As an illustration see the following image: I need to get the sets of faces for each of the 5 ...
3
votes
1answer
1k views

Set active vertex through python

I am having a problem trying to set the active vertex in blender. I have a list of vertices but I cannot set the active vertex. I am able to retrieve the active vertex through select_history of the ...
0
votes
0answers
185 views

Dead bmesh loaded from operator in edit_mode

I'm trying to make an operator for my algorithm that worked fine runned just from script main function, but bmesh in edit mode loaded from operator is dead... So i just can't do anything with it. ...
2
votes
1answer
2k views

bmesh/python - list directly or indirectly connected verts

For a single vertex, how can I create a list of all the vertices connected directly or indirectly to it? Similar to Select Linked but without actually selecting anything.
3
votes
1answer
1k views

What is the loop order of bmesh faces?

Let's suppose I create a bmesh with the following commands: import bmesh bm = bmesh.new() bm.from_mesh(obj.data) bmesh.ops.triangulate(bm, faces=bm.faces) Have a ...
4
votes
1answer
1k views

Order of vertices added using Python script and bmesh

I am using Blender 2.71 and Python 3.4.0 and I would like to add a row of vertices in such a way that I can call them using bmesh.verts[] in the same order that I ...
1
vote
2answers
1k views

What is the fastest way of creating a large mesh/object built from smaller mesh “building blocks”

I realize similar questions have been asked before and I followed the advice given there but I hope to gain more insight on the matter here. I've added a lot of details, I hope it's not too much. I ...
3
votes
2answers
2k views

How to use bmesh.ops.transform?

I could not find an example for the Bmesh function: bmesh.ops.transform(bm, matrix = matrix, space, verts_extrude_b1) What is the matrix argument and what do you ...
1
vote
1answer
833 views

How to duplicate and move a selected edge in normal direction?

I want to duplicate a selected edge and translate it to another location, based on the normal direction. (source: shshop.da.to) This is my current code: ...
1
vote
1answer
614 views

Is there a better way to rotate the order of vertices of currently selected faces in edit mode?

I've been playing with duplifaces and it turns out the orientation of the copied geometry depends on the order of the vertices in the face (https://developer.blender.org/T30547). Since I'm unhappy ...
0
votes
0answers
44 views

Halfedge UV-coordinates [duplicate]

I am programming a Python script, which takes a mesh from a external tool and adds it to the blender scene. I transmit a texture and the mesh, and it actually works. But I have trouble with the UV ...
4
votes
1answer
1k views

Manipulate Vertex group names in the bmesh API

When importing an object with my own script (Yes, I need one, no functional script exists) I want to import it with help of the bmesh-module. It seems to be the ...
2
votes
1answer
921 views

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

I've seen several posts suggesting that it's better to write functions that manipulate bpy.data directly, instead of using the bpy.ops operators. I can understand the argument about how operators such ...
4
votes
2answers
3k views

How to fix ngons overlapping wire edges?

I am trying to make a retopo of my human head. But it seems that I already have several ngons because I couldn't create an edge loop. So I checked it with mesh lint and it showed me the ngons But ...
3
votes
2answers
6k views

How can I triangulate a mesh without changing the object?

I have to triangulate the object's mesh because the format I export to only understands triangles. Now I not only want to export geometry but also the uv-mappings for the mesh. Let's call the ...
0
votes
3answers
2k views

Re-Polygonize a tessellated / triangulated mesh?

I have this mesh: As you can see, the faces are triangulated. I want to know if there is a way to re-polygonize the entire mesh (make use of NGon support in Blender 2.63+), or a modifier or something ...
4
votes
1answer
862 views

How to access vertex_color layer directly from inside BMVert

I want to access vertex colors directly from inside BMVerts, but I don't know how. I am able to access vertex colors indirect for inside BMFaces: ...
14
votes
4answers
12k views

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

I read somewhere that Ngons were nothing more than triangles masked as an Ngon. Some testing reveals this is not true, at least to some extent. Here are two sub-surfed cylinders, one with an Ngon, ...

1
3 4 5
6
7