We’re rewarding the question askers & reputations are being recalculated! Read more.

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
1
vote
1answer
448 views

Python: Edit panel to edit custom bmesh face layers?

With the bmesh module, I added a custom data layer to a mesh, holding information for each face. ...
2
votes
1answer
3k views

When to use bmesh.update_edit_mesh and when Mesh.update?

When is it appropriate to use one over the other? In example, I have the following: ...
0
votes
2answers
2k views

BMesh: How to map vertex-based UV-coordinates to loops?

I have a game model format which stores the UV coordinates for each vertex. To implement seams in the UV mapping, a vertex just appears twice, each having a different UV coordinate (it solves the ...
0
votes
0answers
354 views

get the rotation of a face

I'm trying to get the rotation of bmeshs face. Unfortunately following function doesn't work: ...
2
votes
0answers
180 views

Shrinkwrap with ray_cast isn't accurate

I'm trying to create my own similar Shrinkwrap-Modifier with raycast. Unfortunately the result isn't accurate and I don't know why. It work's with Spheres, all other primitives are inaccurate. ...
2
votes
1answer
1k views

combine objects by name in scene into one object

In my scene, I have multiple objects with the following names: Verts Verts.001 Verts.002 Verts.003 Verts.004 I want to combine all of these objects into one mesh ...
3
votes
1answer
562 views

creating n random points on face of mesh

I'm trying to select 400 or so random points on the face of a mesh using a script (just on the face, not inside the volume) but I'm not sure how to do that. I've tried looking into the following ...
2
votes
0answers
520 views

BMesh Grid Fill doesn't work on closed edge loop

I've been trying to automate the task of deleting the ngon cap on the end of a cylinder and replacing it with quads using the Grid Fill tool. Something similar to this: I'm using this script: <...
10
votes
4answers
970 views

Scripting: low level join meshes / elements (hopefully with bmesh)?

Currently I only know of one way to join meshes - using the join operator: bpy.ops.object.join() This has an annoying overhead of additional operations required ...
2
votes
1answer
852 views

Finding top surface area of a mesh by python

I need to find the top surface area (in one plane) and total surface area (by summing all the faces) of a complicated mesh. For that I need to know how to fit a plane to the top of a mesh to find the ...
1
vote
1answer
1k views

Select vertices by their indices (by vertex id) [duplicate]

I want to select vertices by their indices (by vertex id) Like a python script,so that i can write the vertex id into it, and run the script,and it would automatically select those vertices there is ...
2
votes
2answers
685 views

bmesh - extrude face and end up with closed mesh

When you extrude the only face of a plane via the GUI you get a (closed) cube. If you do the same thing using bmesh you get a cube that is open on the bottom side. ...
2
votes
2answers
1k views

Bmesh: how can I import custom vertex normals

I have a question concerning BMesh and custom vertex normals editing. At the moment I am writing a little blender importer for a custom data format and I am stuck with importing/manipulating custom ...
2
votes
2answers
290 views

How to get the angle between three faces on a non regular non flat surface

I've got a non flat and non regular surface with three selected faces. Is there a way to get the smallest angle between these with python?
1
vote
1answer
291 views

Detect holes on a not flat surface at a set circumference

I've got a not flat surface with not regular faces. Is there a way to recognize if there is a hole at a set circumference?
1
vote
1answer
288 views

How to create a flat mesh and give it a thickness by bmesh?

I'd like to create a flat mesh and give it a thickness by bmesh. Putting together some answers seen on this forum, I thought that a script like the one below should have done the work, but it doesn't. ...
3
votes
1answer
4k views

How do I prevent particle objects from intersecting each other and going though the floor?

The first step is to "throw" a group of steel tubes at a floor. They should bounce, and roll a bit. When they come to rest the next animated step begins: They will use shape keys to morph into an ...
2
votes
0answers
237 views

Mark Seams on Edges of Camera View

I am trying to write a script to mark a seam on an object around the vertices of the object that are in the field of view of the camera. Unfortunately, some of my ...
0
votes
0answers
56 views

Deleting a face, if there are two ore more holes in a circumference with a defined radius at a defined angle

This is a very specific question: I created a plane. On it there are some faces deleted. I want blender to check every other, not deleted face, if there is in a specific circumference (red) at a ...
0
votes
1answer
40 views

Recognize bridging faces of splits at a plane

I've got a plane with multiple splits. Unfortunately there are undeleted vertices bridging these splits. Is there a way to automatically recognizing these bridges and selecting the faces of them?
0
votes
3answers
2k views

UV unwrap each face of an object via python script

I have an object with several faces, and I want to loop over the faces, adjust the view for each differently and then UV unwrap the face from the chosen view. I managed to do it using Blender GUI but ...
5
votes
1answer
365 views

Boolean Operations

I'm trying to manipulate a number of BMesh items in code with the hope of stitching them together, via boolean operators, to produce more complex geometries/meshes. Do BMesh instances support boolean ...
0
votes
0answers
69 views

Weird bmesh performance when creating new vertices

I have 2 different meshes with roughtly the same amount of faces/verts. In the first case I only have 1 object in blend file, in second case around 80. This is the only difference I can think of, in ...
3
votes
1answer
769 views

How to discretize a 3D mesh to generate a 3D binary matrix

I apply the algorithm proposed by TLousky discretize a mesh to discretize the entire mesh. I get this result ...
3
votes
2answers
693 views

Removing doubles on imported 3DXML ngon mesh

Pertaining to building objects created from the script shown in the answer here https://blender.stackexchange.com/a/42590/15543 The import data has seperate vert data for each surface, so each face ...
4
votes
2answers
2k views

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

There is an operator to select sharp edges, and an operator to select edges marked as sharp if you have already an edge marked as sharp selected, but is there a way to select edges marked as sharp ...
3
votes
1answer
300 views

making angle label - spin vertices with python script

I would like to make an simple angle label such as this: using the python script to construct it. The problem is trying to spin a MeshVertex, as the code looks for a Mesh object instead when using ...
5
votes
2answers
1k views

How to delete all faces with distance to other object

I want to delete all faces (of "Mesh") with a distance > 0.5 to the nearest point of an other object ("Sphere"). Unfortunately it deletes the whole object. Thanks for helping! ...
8
votes
1answer
979 views

How do I stop vertex normals getting overwritten when I enter edit mode?

I'm trying to make a script to apply vertex normals based on selected faces. So far I have written the script and it works fine, but if I exit edit mode and then re-enter edit mode, the normals get ...
3
votes
1answer
982 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
98 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 (...
9
votes
3answers
2k 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
601 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
1k 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
1k 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
163 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
659 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
1k 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
54 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
62 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
926 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
728 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
389 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://...
1
vote
1answer
645 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
591 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
614 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 ...
3
votes
2answers
1k 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
3k 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
242 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 ...
4
votes
3answers
1k 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 ...