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.

0
votes
0answers
17 views

Adding vertices to a BMesh

I am trying to create a face using bmesh. I am doing it by adding vertices to the mesh in for loop. V_r contains the list of vertices ...
0
votes
1answer
29 views

How can we remove overlapping edges?

I am cleaning up a friend's model and often run into this problem: Often, there are multiple edges of various lengths overlapping along the same line. Below is a visual example: ...that overlap to ...
0
votes
0answers
11 views

Blender Python Bmesh Shapekeys

I'm currently trying to create an importer, and i'm trying to create the meshes completely via the BMesh module. Adding vertices and faces works perfectly fine so far, but for some reason, after ...
1
vote
1answer
34 views

Select multiple vertices using a list of coordinates with KDTree

I want to select (or to put into active selection) some vertices using their coordinates so I've seen an answer there : Automatic select vertices by given coordinates But it only works when I'm in ...
0
votes
0answers
22 views

Blender python subdivision problem: mistake or bug?

I've been working on a python script in Blender (2.8) and so far everything's been going fairly smoothly, except for an infuriating problem I encountered yesterday. It seems that the 'bpy.ops.mesh....
0
votes
1answer
24 views

Way to get vertex index to use in new vertex group from selected faces

I try and not undertand if i am on the right way, that code i want to set the select faces, make a vertex group, this is a piece of code: ...
2
votes
3answers
65 views

Mesh reverts back to the state before the script was run

I created a script (operator) that converts a selection of quads into a diamond pattern. It works fine but when I try to Inset the newly created selection and change any of the options (like ...
0
votes
0answers
10 views

How to get list of vertices edges, which border on 2 or more different types of material / uv in bmesh? (2.79)

I try to find that in the api ,but I couldn't find. I try with the bmesh.ops.dissolve_limit method, but not work fine ,does not save all the borders bordering with ...
0
votes
1answer
63 views

Setting mesh's origin in python (2.8)

If I create a cube, the origin is originally at the center of mass. I know how to move the origin to the center of one of its faces using the interface, but how can I do the same thing via Python?
1
vote
1answer
26 views

Bmesh bevel is inverted

This looks cool and all, but it's beveled in the wrong direction. How can I flip the direction it bevels, so it looks more like a rounded cube, rather than a rounded plus-sign? ...
1
vote
0answers
22 views

Is there any XOR option for Boolean Modifier?

Let say we got two object, I want to get the sum of the difference for calculating error between two meshes. As the sum of red and blue area following image showed: Somehow the Boolean Modifier doesn'...
0
votes
0answers
20 views

bmesh.ops.dissolve_limit trouble about “delimit” option with set in 2.79

I checked the api for this but I have to say that what I'm looking for is poorly documented: Limited dissolve have 5 options with multiple selection blender 2.79 : Normal, Material,Seam, Sharp, UVs in ...
0
votes
0answers
15 views

bmesh.ops.dissolve_limit not work fine?

I tried to emulate "limited dissolve" with bmesh, but it behaves differently from the various parameters in blender 2.79, delimit mode (in 2.79 with integer value and in 2.8 with string) Result by "...
1
vote
1answer
23 views

Reverse armature deformation on vertex in python

I have a mesh with armature modifier (active+posed) and wish to do some modifications with vert coords (after armature deformations) saved in shape key on that mesh. But currently it seems not ...
3
votes
1answer
121 views

Align Object A to Object B to their respective active faces with python

i want to Align two objects depending on their active faces like in this gif below didn't find any answers but only this clue below from this question: Align to face normal vector but it only align ...
0
votes
0answers
24 views

How to know if certain co-planar faces in Blender form a circle to apply quads later on?

I can get a set of co-planar faces from any mesh. Some of these co-planar faces form a circle while most of them do not. I eventually want to know which faces are forming a circle using Python, so ...
0
votes
1answer
56 views

how can i quickly optimize this mesh out from a curve?

this is a hair that i have done for my character there, so its made out from a curve, after convert it to mesh, it gave me too much verts or poly count, i need to optimize it, i tried the unsubdivide ...
0
votes
0answers
21 views

Add faces to a mesh to make it solid with python and bpy

Basically what I want to do is subdividing a mesh in a lot of smaller meshes, all of them sharing the same the bounding box dimensions. Using bmesh.ops.bisect_plane...
0
votes
0answers
31 views

BMesh create rotation

I am creating a bmesh from a list of points in 3d space (e.g. a circle): ...
1
vote
1answer
26 views

How to create a list containing lists of bm.verts based on their deform layer (vertex group)?

I have been struggling with trying to find a way to do this. It's related to my previous efforts here: How to get list of bm.verts that belong to a deform layer? When I do this ...
0
votes
1answer
35 views

I Can't Create a Face from Several Circles

Just like the problem appears in the image, I want to make a face triangulated around all circles. Instead, a face is created that overlaps everything I selected. What its the technique to join all of ...
1
vote
1answer
50 views

Finding a specific face/vertex/edge based on position value, not indices value

[Looking for answers possible via python] Hi everyone! I'm trying to select a face/vertex/edge based on location rather than selecting it based on its specific index. After the specific face/vertex/...
0
votes
1answer
141 views

Change circle segment depends on diameter

I want to program a tool for checking radial parts of a mesh. The idea is: You push a button, the scripts add an object (circle) to the scene. Then you grab it place it and when you scale this circle ...
0
votes
1answer
22 views

How to get list of bm.verts that belong to a deform layer?

I have a previously assigned Vertex Groups on my object. After creating the bmesh, if I understand correctly that Vertex Group should now be ...
1
vote
0answers
53 views

Rotating selected vertices around given point using a matrix? (python, bmesh, modal, without bmesh.ops.rotate)

Is there a way to rotate bm.verts around a given point (another vertex, cursor etc) by multiplying v.co with Marix.Rotation and not using bmesh.ops.rotate? Like this: ...
1
vote
1answer
41 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
1answer
54 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
16 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
85 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
28 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
54 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
34 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
115 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
54 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
17 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
30 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
15 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
30 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
33 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
60 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
63 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
32 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
69 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
39 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
97 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
109 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
49 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
73 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
72 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
69 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 ...