Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
33 views

Should I convert my quad mesh to triangles? If so, can I do it in this script?

I have topographical data which is height on a square lat/lon grid and I've generated a mesh with the script shown below. My polygons are all quadrangles (close to, but not quite squares in this case) ...
0
votes
0answers
24 views

Overlapping faces : how to create new faces (interception and complements) with Python API?

Suppose I have a mesh with two overlapping faces (in general, all vertices are different): ...
0
votes
0answers
14 views

Regular Bmesh operators

I'm new to Bmesh and Blender in general, but I would like to know if there's an equivalent for the knife tool in Bmesh. Long story short, I want to do a very regular mesh over a mesh plane; only ...
1
vote
1answer
35 views

Bmesh : how do I keep track of vertices in edited topology?

I'm trying to write a script to bisect Ngon rectangles, horizontally or vertically, at a given percentage of the distance along their sides. (The sides may consist of more than one edge). Some of the ...
0
votes
1answer
20 views

Delete components script crashes

I wrote an addon that removes components (using BMesh) depending on the context of the selection. The problem is that he crashes a Blender. I cannot establish a pattern, but most often this happens ...
0
votes
1answer
26 views

Boolean on two simple bmesh

I'm a newbie in blender and I'm trying to play around with the boolean difference modifier. I have two concentric disks and I want to perform the boolean differece between them. I'm using the python ...
3
votes
2answers
32 views

Argument values in `bmesh.ops.similar_verts()`

Can someone please help me understand the values for the arguments in the function bmesh.ops.simlar_verts(bm, verts, type, thresh, compare) I understand that: <...
1
vote
1answer
65 views

How to update Blender's naming index thing (.001, .002, etc.) after joining objects

I've been trying to reuse certain parts of code as functions in my bpy scripts. But that means that the same bmesh will be created as 'my_bmesh.001' the next time I run that function. To deal with ...
0
votes
0answers
41 views

What happened to my straight lines in 2.8?

I modeled these letters in 2.7 no problem. I just brought them into 2.80 and the straight lines have this "back forth" look along the geometry. The normals are all outside, I tried to re-do the ...
0
votes
0answers
12 views

Python bmesh.update_edit_mesh() doesn't work as I expect

I've been doing something like: cube = bmesh.ops.create_cube(bm) bmesh.update_edit_mesh(mesh) print(mesh.vertices) The return is ...
0
votes
0answers
16 views

How select Material Slot with one active face in python

hello guys i have a problem by selecting the material slot. when selecting the material slot, has no active Face... how can i make him select an active Face under the selected Faces ?
0
votes
0answers
12 views

Is there a way to create multiple bmverts from a list of 3d coordinates in bulk (ie not calling vert.new for each coordinate)

I would like to bulk transfer a list of hundreds of thousands of 3d coordinates into a bmesh (using python) and the only way seems to be to add them one bmvert at a time with vert.new(coord). I am ...
1
vote
1answer
16 views

How to get “bpy.ops.mesh.select_more()” working for a bmesh?

When I select some meshes of my object by hand or with a script, the selection of some meshes "fades out". With "Select - Select More/Less - More) I can select these mesehs, too. But with a script I ...
0
votes
0answers
16 views

How to create Modal Operator that extrudes, moves and rotates selected in Edit Mode?

I'm trying to learn about modal operators in blender. I'm a complete novice and I'm struggling with the idea of how to correctly map the mouse movement onto the bmesh operators. I'm essentially ...
1
vote
0answers
38 views

Detecting mesh overlaps of objects inside another object

How can we detect the overlap between two objects one has been placed inside the other? I'm writing a placement algorithm and it seems regular BVH mesh overlap doesn't work for this case. Is there a ...
0
votes
1answer
43 views

Uniquely addressing vertices in python

This has been driving me crazy for some time, because it seems so simple, but I just cannot find a way to do it despite exhaustive searching. Say I'm in bmesh, and I create a vertex, and I add it to ...
3
votes
0answers
22 views

Getting Color Values Produced by Dynamic Paint

I am having trouble with the python code to get the colors of vertices when using Dynamic Paint. If I try painting a cube using the Vertex Paint mode I can get the rgb values of the vertices using the ...
2
votes
0answers
43 views

Python: bmesh.verts not loading all vertices of mesh

As the title says, I am using bmesh.verts to load in all the vertices of a mesh to then check if their coordinates are within a certain box, and if they are select them. The problem is that the ...
0
votes
0answers
23 views

Are BMesh MeshLoops an only/preferred way to iterate over mesh triangle polygons?

I'm writing a simple script that has to iterate over triangular faces of mesh (not n-gon polygons). I need to access theire data (vertices, edges, material indexes) Basically I'm doing it like this: ...
0
votes
0answers
61 views

Bmesh equivalent to `foreach_get` and `foreach_set` for use with Numpy?

On a regular object I can use foreach_get to efficiently copy data into Numpy arrays and use numpy ufuncs instead of looping through the contents of the bmesh. ...
1
vote
1answer
56 views

Using python and bmesh to scale/resize a face in place

I'm playing around with bmesh and have run into something I can't figure out how to do and can't find any related documentation on. I have extruded a face directly outward (after subdividing a ...
1
vote
2answers
35 views

How to remove dead BMVerts from a list?

I am trying to fix a bug in my script that happens in rare instances. I believe the bug occurs due to the very last thing the script is doing, which is: ...
0
votes
2answers
51 views

How to determine whether my bm.select_history.active is a BMVert, BMFace or a BMEdge?

I am trying to write a conditional statement for my script. If the user has one Active Edge Selected, then the script will run. Otherwise it won't. I know that if I have an active edge, then bm....
0
votes
0answers
67 views

How to work with Bmesh correctly?

I'm writing a window generator script. Here is a current version of my script: https://gist.github.com/romanvolodin/3bfd349795443118a2298819349a0b3c Windows config: https://gist.github.com/...
0
votes
1answer
38 views

bmesh.ops.scale how to scale vert selection relative to active edge, but not along the edge vector?

I am looking into vectors and matrices but don't yet understand how I could achieve one of my goals for a script I'm making. I want to use bmesh.ops.scale() and scale selected verts relative to my ...
0
votes
0answers
33 views

Modify skin radius using bmesh

this might be a very basic question. I am trying to modify the skin radius using a bmesh command. The index of the vertex is known. I just wonder what the bmesh command is to access the skin radius ...
1
vote
2answers
195 views

Python: Bisect mesh into n parts, without separate 'LOOSE'

Using Python I want to split a mesh into tiles. All the solutions to this question rely on bpy.ops.mesh.separate(type='LOOSE'). But this leads to problems in the ...
1
vote
1answer
34 views

Types of Edges In a Triangulated Mesh

I added the triangulate modifier on a mesh and then applied it. For this mesh in edit mode, I see two types of edges, thick bright ones from the original mesh and thin black ones, newly created by the ...
0
votes
0answers
39 views

List of contiguous faces of bmesh

Is there a way to get the list of the connected faces of the bmesh in their connection order? In other words, if I start from any random face within a continuous bmesh I should get the list of all the ...
0
votes
0answers
38 views

Imitate the F hotkey in python (create face from vertices)

I have a bunch of vertices that i want to connect as a face in python. I managed to do it using the F key in GUI mode, achieving this result: I tried doing the same thing in python using this line of ...
0
votes
1answer
41 views

Getting BMesh Face Index from UV Face Index

I want to iterate over the square blocks of the UV map from left to right (and then top to bottom) and find the index in bmesh of the face(s) contained in each of the block (one block can contain ...
1
vote
1answer
84 views

How to add vertices into specific vertex roups

I have an xml file which contains a list of objects in space ("sectors") each sector has a list of more objects ("seats") which can be the same model or not. For each "sector" I create an object and ...
0
votes
0answers
49 views

bmesh.ops.extrude_face_region leaves a face behind, why?

I am running blender 2.79, this has burned a lot of my time today trying to figure this out. I have a couple function calls ...
1
vote
1answer
99 views

Convert a mathutils.Vector object into 3D coordinates

I've been working with both Python and Blender for the first time over the past few days and keep running into these mathutils Vector objects which I have no idea what to do with. I can't figure out a ...
2
votes
1answer
62 views

Adding multiple shape keys with python and bmesh while creating a mesh

I'm using a python script to generate mesh geometry and to add multiple shape keys in Blender using bmesh. The goal is to have 10 shape keys and each generated vertex is modified by just one of those ...
0
votes
0answers
99 views

Knife tool with bmesh API

I need to find the intersection curve between two (open) meshes, and I can do that interactively with the knife tool. In search for a way to do it from a script, I came across the following highly ...
1
vote
1answer
240 views

Extrude in python

As in title, I'm trying to extrude mesh via python as I have ~1.5k objects to extrude and when I do it in editor it works perfectly but when I run it via python it always go wrong. It just move face ...
2
votes
1answer
59 views

Is it possible to deselect element but keep it active?

In this question I found out uses for being able to deselect the active object. You can basically use the active-but-unselected object as a transform pivot point for the rest of the object selection ...
2
votes
0answers
226 views

Separate mesh into separate batches with python

I am working on an export / import addon for a custom model file format which stores its geometry in the so-called "render batches", the structures aimed at optimizing geometry for effecient live ...
3
votes
1answer
113 views

How to find a mesh loops and rings

I'm trying to find a clear, safe, simple explanation to the ring and loop madness. I select an edge: Then I run this script: ...
0
votes
0answers
306 views

Find boundary coordinates of a set of mesh points

I have a set of bmesh verts created like: import bmesh # ... bm = bmesh.new() # ... bm.verts.new(...) I intend to have all ...
0
votes
0answers
72 views

Find mesh verts relative to a base point

I have the following verts on a bmesh: The verts are created like this: ...
0
votes
1answer
291 views

Boolean creates a hollow object

I am trying to carve out some wear lines on a bullet, from where the barrel of a gun would cut into the metal. I am using a boolean modifier on the bullet, set to difference. It cuts into the object ...
1
vote
2answers
173 views

Navigate the disk cycle, like you can navigate the loop and radial loop cycles in bmesh?

So, in bmesh you can navigate the loop cycle via loop.link_loop_next loop.link_loop_prev You can navigate the radial loop cycle via ...
0
votes
0answers
20 views

Python plugin - Identify faces properly

This is a follow up from this question: Will vertex indices change? In that thread is was established that the index of a vertex is not a reliable identifier. Then in the comments this question was ...
0
votes
1answer
53 views

use python to randomly inset each face, bmesh?

I would like to create some interesting shapes with a script. I'm still pretty new to python and I'm having trouble understanding how to get BMesh to behave the way I want. Here is what I'm trying to ...
2
votes
0answers
16 views

split edge at multiple points without distorting uv or other data

Here's a bmesh edge: +-----------------------------+ Say I want to cut it at multiple points, in the middle and 3/4 from the end like so: ...
4
votes
1answer
155 views

Is there a way to clear sharp edges using bmesh in python?

I'm trying to speed up an addon that had to toggle into Edit Mode for sometimes thousands of object by staying at the object level using bmesh instead of ...
0
votes
0answers
103 views

bmesh.ops.bisect_edges interferes with my list of verts

I am trying to subdivide a face, using bmesh.ops.bisect_edges, followed by bmesh.ops.connect_verts. I collect a list of vertices, before subdividing further, but after I use bmesh.ops.bisect_edges ...
1
vote
0answers
37 views

How to find the distance from a face of one object to the surface of another object, along the face's normal

I feel like this has probably been answered, but I searched and couldn't find an exact solution. What I want is a quick way to take a selected set of faces on an object (or the vertices that make up ...