Questions tagged [bmesh]

Blender Python Bmesh module, added in 2.63, provides an alternative method of manipulating meshes "giving Python access to the functions used by Blender’s own mesh editing tools.". Use this tag for question about using the Bmesh module in Python scripts and add-ons.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

How to update mesh data?

I want to resort the order of vertices of faces in Blender by python. It looks like the resort function works well. But I think the new data does not update to the mesh successfully. How to modify my ...
Bill XU's user avatar
  • 19
0 votes
1 answer
24 views

How to resort vertices' order of faces?

I would like to rearrange the order of vertices for each face, so that I can use the new order for the "FIXED" --- quad_method of the Triangulate Modifier. However, I am unsure whether it is ...
Bill XU's user avatar
  • 19
2 votes
1 answer
35 views

My python code for creating vertex groups and adding existing vertices to them is grouping wrong vertices and creating unwanted faces

I have a existing mesh of a human body and I have created vertex groups that contain groups of vertices that are associated with different parts on the left side of the body mesh. I want to use python ...
app-o-matix's user avatar
0 votes
0 answers
36 views

When looping the selection_history of a bemesh it Crashes With Error: HIPEW initialization failed: Error opening HIP dynamic library

I'm Making a tool for boundary weight paint pinning from selection with bmesh Am i supposed to report this as a Bug ? Edit: the script works with no issues when using selection_history.active instead ...
ValyArhal's user avatar
2 votes
1 answer
21 views

How to specify length/direction with a BMesh operator

Using bmesh.ops.extrude_edge_only(bm, edges=[], use_normal_flip=False, use_select_history=False) (https://docs.blender.org/api/current/bmesh.ops.html#bmesh.ops....
Ryan Blanchard's user avatar
0 votes
1 answer
27 views

How do I extract the vertices indices from an Geometrical nodes model that belong to a given edge (always a start and end vertice)

I am looking to retrieve al the starting and ending vertices per edge of an object (standard box in this case). For this I have created the following code: ...
Peter_Ko's user avatar
0 votes
0 answers
18 views

bmesh.ops holes_fill vs edgeloop_fill vs edgenet_fill

Can anyone help me understand the difference between bmesh.ops.holes_fill, bmesh.ops.edgeloop_fill and ...
atb's user avatar
  • 131
0 votes
0 answers
18 views

Python bmesh: Using selected edges on a curved object to create a face

I am creating a parameterised model of a segmental tunnel-lining ring using Python and I have managed to create all the appropriate vertices and edges for the 'num_segs' number of segments in the ring....
redblue's user avatar
1 vote
0 answers
15 views

bmesh smooth property isn't set

I want to select all sharp edges using a script. I tried something like what's suggested here: https://blender.stackexchange.com/a/41352/177165 which uses a bmesh edge's ...
danilo's user avatar
  • 13
3 votes
0 answers
34 views

Updating BMesh element indices

I've noticed that after calling bmesh.utils.edge_split the new elements (vert, edge, loops) have -1 indices. They stay -1 even after calling ...
atb's user avatar
  • 131
1 vote
3 answers
142 views

Connect multiple vertex pairs

I would like to have a script that connects multiple pairs of vertices. My selection order is vertex-13, vertex-14, vertex-11, vertex-9, vertex-19 and then vertex-16. And the result is supposed to ...
Lala_Ghost's user avatar
1 vote
0 answers
31 views

Reading animation into BMesh and output to png sequence not working - animation looks weird

I am new to Blender scripting, and am trying to animate a flag blowing in the wind, read the vertex positions etc. per frame into memory using BMesh, write the <...
smukherjee12's user avatar
0 votes
0 answers
30 views

How can I cut an arbitrary cuboid into a chosen face of a mesh?

I am looking to cut a cuboid shape out of a mesh. I have been looking around for a lead to the solution, but everything I find is for a centered square. I am hoping there is a way to define the shape ...
Thomas's user avatar
  • 1
0 votes
1 answer
35 views

Find Bmesh face, given mesh polygon

Blender's OBJ exporter has a main loop that iterates over object mesh polygons, rather than using Bmesh. I have added a customer integer data layer to an object's Bmesh and now want to access it ...
Octavius_Ace's user avatar
1 vote
0 answers
24 views

Preserve vertex references after bmesh operations are performed [closed]

I am trying to do programmatic modelling in blender using bmesh. I am using lists of vertices, finding edges and faces that connect them and performing various ...
Oshawk's user avatar
  • 11
3 votes
1 answer
128 views

Intersecting surface area between two three-dimensional meshes

I have two three-dimensional meshes that intersect. I would like to find the surface area of the larger mesh that intersects the smaller one: I can do this by joining the objects together, selecting ...
kozina-adjacent's user avatar
1 vote
1 answer
35 views

Overwrite instead of combine results of bmesh's convex hull operator

When using bpy.ops with the convex hull operation as shown below, the mush comes out combined, but I want it instead to have the convex hull only. Can you see what I'm missing in my script? See image ...
Zak Nelson's user avatar
1 vote
0 answers
9 views

Bmesh selected faces list in modal operator is always a step behind

I am trying to get the list of the selected faces of a mesh using a modal operator which runs once a mouse button is pressed. The issue I have is that the faces listed by the operator are always a ...
Luca Saiani's user avatar
0 votes
0 answers
56 views

How do I select specific filled surface and extrude/blend/operate on it?

I have been using Blender for less than a week now. I am actually amazed by the software's capabilities! Anyway, I have started using Blender for a project where I have automate some of the operations ...
jay22kar's user avatar
0 votes
0 answers
16 views

Script Indices Change Between Operations

I have an issue with my code where randomly in the middle the indices of faces, edges, and vertices switch between two different patterns. It's not randomized, and yet it isn't consistent where the ...
caddev20's user avatar
0 votes
0 answers
107 views

Visualize Surface curvature using Color Attributes

In design models, there is often a minimum radius of curvature. For example an alloy wheel can usually not have shapes sharper than R 3mm, or the wheel will break. In the modelling workflow, it would ...
LarsS's user avatar
  • 11
0 votes
1 answer
47 views

Create normal along edge length

Using the bmesh module, I have an edge extracted from other bmesh ops. I'm trying to use the distance_point_to_plane utility to find the distance from another point,...
Psyonic's user avatar
  • 2,309
1 vote
1 answer
165 views

How to copy a few faces from one bmesh to another

I have a function that returns several faces from a mesh using ray_cast under the mouse pointer. Some surrounding faces are collected based on the angle from the hit face and passed to another ...
Psyonic's user avatar
  • 2,309
1 vote
2 answers
107 views

How to check if selected edges forms a continuous line?

How to check, if selected edges is a continuous line? Note that one edge is deselected.
APEC's user avatar
  • 570
3 votes
2 answers
148 views

Most effective technique to detect changes in mesh-data's?

What would be the most effective way to track changes in the user mesh-data's? I would like to receive a notification signal if a user mesh data has changed. I see a few (fast) approaches possible: ...
Fox's user avatar
  • 1,892
0 votes
2 answers
121 views

How to join mesh using bmesh?

I wrote a script to join mesh using bmesh module but the meshes are joining in one location. ...
Karan's user avatar
  • 1,866
0 votes
0 answers
85 views

Blender Python BVHTree.overlap not detecting overlaps

Why is overlap not being detected with any of the 3 selected objects and the lake (center) overlapping them? Meshes are in the same plane, same collection. Thanks in advance, cheers! Screenshot: <...
SKNB's user avatar
  • 111
0 votes
1 answer
73 views

Create bmesh & save into OBJ format without opening blender

I want to create a mesh outside of blender, using bmesh module, and save it into an OBJ or whatever, completely through a python script. ...
MohammadHossein Jamshidi's user avatar
1 vote
0 answers
235 views

How to split a mesh into multiple parts at arbitrary locations with Python?

I ran the following Python script, from the link below, in Blender and it works very well splitting the selected mesh into 4 equal parts. However, I'd like to cut the mesh at specific locations not ...
Epsilon's user avatar
  • 143
0 votes
1 answer
28 views

Missing link_faces on mesh

I have a script that iterates through the polygons and link_faces of a mesh, and it has worked great. I am trying to make a conversion to .usd instead of .fbx in my mesh pipeline for a couple ...
Zane Jensen's user avatar
0 votes
2 answers
60 views

Is it possible to count vertices with only two connected edges without bmesh?

Is it possible to count the number of vertices of only two connected edges without bmesh? Like with object data we can count triangles ...
APEC's user avatar
  • 570
2 votes
1 answer
282 views

EXCEPTION_ACCESS_VIOLATION on bpy.ops.mesh.decimate()

Hey I'm running blender 3.3.1 and I am having an issue in my script where I am getting the error EXCEPTION_ACCESS_VIOLATION, the second time that I select a group of polygons. I believe it may be ...
Zane Jensen's user avatar
0 votes
0 answers
87 views

Limited dissolve & convex hull operators are giving incorrect results when run through script. What is the correct way to run them via a script?

I have a simple mesh like below. I want to do a Limited Dissolve (15 degrees) followed by a Convex Hull operation on the same. When I do it via Blender UI, I get the result as expected. But when I do ...
Jeet GT's user avatar
  • 65
0 votes
0 answers
46 views

How to get solid right angles with python?

Using the script below I encounter the same non-orthogonal corners as already asked here, but my bmesh is three dimensional, not flat. Is my current skin modifier ...
jjk's user avatar
  • 970
2 votes
1 answer
109 views

Why does a very simple edit mode bmesh operation crash Blender?

I'm trying to create an addon that runs in edit mode, using bmesh to transform the various elements. I'm getting a crash with the most basic example I can come up with: ...
wwww's user avatar
  • 37
0 votes
0 answers
20 views

How to assign rigidbody to bmesh

I am creating a shape with bmesh (for performance reasons, I am using bmesh rather than primitive_cube_add) and want to assign a rigidbody to it, however I get error: ...
Laurent Crivello's user avatar
5 votes
3 answers
987 views

How to calculate the total UV area used?

I'm trying to find the total UV area used relative to the image bounds - i.e. a percentage/ratio of used space vs. available space. I know you can use ...
Greg Zaal's user avatar
  • 10.8k
0 votes
0 answers
18 views

With Python, how do I add data to an existing mesh? [duplicate]

Let's say I create an object with the GUI. Its mesh is called "Cube.001" and has 8 vertices. How do I now add - for example - a 9th vertex at position ...
Claus's user avatar
  • 1
0 votes
1 answer
22 views

fixing odd geometry

I am dealing with geometry imported from a (very problematic) source and it is often such that I just want to keep the outer volume of a weird mesh. Here an example of something that is almost (but ...
David Chinellato's user avatar
1 vote
1 answer
358 views

How can I separate the vertices of a mesh based on vertex distance?

This question is a follow-up on: How can I split all unconnected parts of a mesh? That question was closed, I believe because it was ambiguously asked (and seemed to have prior answers). The question-...
NeverConvex's user avatar
  • 1,257
0 votes
0 answers
40 views

How to make snap operator not use transplate?

Just appoint two vertices\edges\face, The snap operator autocomplete. I have achieved the vertices mode, Calculate the translation matrix from vertex1 to vertex2, Then translate the object1's location,...
ff114's user avatar
  • 21
1 vote
1 answer
66 views

How to use one face to cut another face in a bmesh

I have several faces on the same plane, there is always a largest face and several smaller faces "inside" the larger one. I've currently got all the faces stored in a list and sorted so the ...
Psyonic's user avatar
  • 2,309
0 votes
1 answer
79 views

Size of link_loops of a mesh circle is zero?

I have a mesh circle with 32 vertices and I am trying to get the edge loop of the circle (which is actually all vertices in sequence) with following code: ...
Loma Harshana's user avatar
1 vote
2 answers
37 views

Loop to distort a copy of a base mesh, but the loop keeps distorting the previously used mesh?

I have three functions: make_plane(): creates a subdivided plane, applies smooth shading, adds a subsurf modifier, renames it an moves it to a collection warp_plane(): takes a copy of a the plane ...
n0ah's user avatar
  • 517
1 vote
1 answer
148 views

Print center of faces for all objects

I am trying to write a simple script that should print the location of the center of the faces of all objects in the scene. I understand that the easiest way is to use bmesh, but I am having some ...
Alex Mekx's user avatar
  • 117
2 votes
1 answer
32 views

Bmesh code from 3D object

Does anyone know of an addon or script that can take a 3D object that was modeled in Blender and turn it into Bmesh based code? Would be super handy. I can't seem to find anything, but hopefully one ...
Psyonic's user avatar
  • 2,309
0 votes
1 answer
352 views

Copying and rotating object via Blender Python API

I'm new to the Blender API, so I've been doing a lot of playing around with it. I'm having some issues trying to do something that should be simple. My goal: make a copy of a "base" object, ...
n0ah's user avatar
  • 517
2 votes
1 answer
418 views

Python function to extrude plane in edit mode

For a project I'm working on, I've taken the lazy way out. I wish to create a box similar to this in Python: The final version will have more than two edge loops and they won't be uniformly spaced, ...
Marty Fouts's user avatar
2 votes
1 answer
374 views

What do `select_flush` and `select_flush_mode` do exactly?

I'm not sure that select_flush is supposed to do and what is the difference between select_flush and ...
elena's user avatar
  • 21
2 votes
1 answer
358 views

Python - How to use bmesh to remove vertices from vertex groups in edit mode?

Is there any way to use bmesh to remove vertices from vertex groups in edit mode? It's possible to use it to read this data, clear all groups, and nothing more. Example: ...
Rhaenys's user avatar
  • 1,344

1
2 3 4 5
8