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
0
votes
2answers
651 views

Rotate bmesh around Vector with Python

I try to rotate a bmesh around a vector as axis. ...
6
votes
2answers
2k views

how to create and extrude a bmesh face

I would like to programmatically create and extrude polygons. I've found several examples of code (e.g. here), but none of them are currently working for me. As a simple example, I am trying to get ...
3
votes
1answer
146 views

OSM skillion roof with bmesh… need an alternative to ray_cast

OSM buildings with the skillion roof shape, are often tagged with only direction and levels. ...
0
votes
0answers
106 views

Is there a library/addon for scripters that supports geometry related selection operations?

I find myself writing various operations that one would expect to be available in blender (somewhere). These operations largely stem around things like selecting subsets of a geometry, finding various ...
1
vote
1answer
422 views

BMesh and Bevel

I'm trying to perform a bevel operation using the bmesh API. My script either crashes blender, with the error message EXCEPTION_ACCESS_VIOLATION, or it doesn't do ...
2
votes
0answers
386 views

Unwrap mesh with spherical projection in python

I would like to have the same result with python as in the UI when I do unwrap > sphere projection on a mesh. I know it's possible to use the operator ...
25
votes
1answer
966 views

Closing “Fibonacci's Hole”

Creating a sphere using the points defined by Spherical Fibonacci Mapping. For the most part it is easy to "skin" by using two consecutive fibonacci numbers as steps to loop on the index. And get ...
4
votes
1answer
1k views

Applying per-vertex colors to new Bmesh

I'm having trouble applying vertex colors through Python to a mesh. The mesh is imported from a file which has vertex info, face info (vertex indices), and a list of colors that corresponds to each ...
1
vote
0answers
59 views

Merging 2 BMVert's with Python

Is it possible with bmesh to specify merge together 2 BMVerts easily? Or must I do it the manual way and delete faces, remove vertices, and recreate faces at the ...
1
vote
1answer
463 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
379 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
183 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
597 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
557 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
1k 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
904 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
740 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
301 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
301 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
306 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
243 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
3k 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
375 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
70 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
785 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
743 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
309 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
1k 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
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
121 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
623 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
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
172 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
713 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
58 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
65 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
990 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.