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.

0
votes
0answers
6 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
17 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
49 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
12 views

Why does using Bmesh boolean union operation sometimes results in intersecting geometry? [closed]

I have 2 meshes that intersect in 2 different places which I then unify with boolean modifier. When I take a look inside the resulting mesh, I see that it worked well on one part(no intersecting ...
0
votes
0answers
18 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
24 views

BMesh create rotation

I am creating a bmesh from a list of points in 3d space (e.g. a circle): ...
1
vote
1answer
21 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
30 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
39 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
126 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
17 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
36 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
37 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
51 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
60 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
25 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
39 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
33 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
83 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
44 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
14 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
24 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
13 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
24 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
23 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
52 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
56 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
27 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
51 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
24 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
72 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
82 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
44 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
62 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
68 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
49 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
36 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
296 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
41 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
49 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
61 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
132 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
61 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
130 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
96 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
109 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
317 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
85 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 ...