Skip to main content

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
26 views

How to Export JSON from Blender with Split Normals using Geometry Nodes

I am trying to export a JSON file from Blender and need split normals as data on vertices. I have exported a custom attribute named "norm" using geometry nodes. However, I am struggling to ...
Vishal Soni's user avatar
0 votes
0 answers
20 views

Ray_casting from curve origins doesn't hit any part of the mesh

The terminal prints none, which I guess means the raycast is not hitting anything. To replicate this output. Run the script and navigate to its sidebar in the viewport, select the two nerve curves and ...
Stavros Piliaris's user avatar
0 votes
1 answer
39 views

Trouble debugging this script (loop through non-manifold verts on one mesh and find index of closest edge on a different mesh) - any tips

The eventual purpose of this script will be to try to stitch two halves of two different, sliced-open objects, together. This is to be done by individually moving each of the verts on the open non-...
El Grillo's user avatar
3 votes
1 answer
80 views

How can I pass an object (like a bmesh) to an operator or should I not do that?

I have an operator that creates a certain mesh but I want to keep things modular so I separated each operation into its own operator. Like for example, I have an operator that removes vertices that ...
Megan Love's user avatar
1 vote
0 answers
27 views

Why does a script that runs on a Blender primitive cube not run for an imported stl file of a cube?

I was trying to recreate batFINGER's answer to this question How to get data and edit it on UV map edges? The code looks like this: ...
Ciara's user avatar
  • 11
0 votes
0 answers
42 views

Python exercise to learn - spiral circular shape

I’m trying to use bmesh extrusion and Matrix to do some spiral shape like this : I would like to start from a circle (like it is described on the picture) Here where I’m stuck: ...
Certes's user avatar
  • 61
0 votes
0 answers
61 views

How can I access and modify a boolean attribute in edit mode?

Re Manually setting custom attributes per edge / vertex / etc TLDR : In edit mode, the regular interface to access and edit attributes, ...
Gorgious's user avatar
  • 31.5k
4 votes
1 answer
110 views

How to get updated mesh locations after object collisions?

I am very new to blender. I have a scene like this, The top plane is a cloth, the two cylinders and rectangle are collision objects. I click play on the timeline and get this after a few seconds, I ...
AskedSuperior's user avatar
0 votes
1 answer
111 views

How to get bmesh vertex colors in Blender 4.0?

There's several answers on how to get vertex colors here on StackExchange, but something seems to have changed in 4.0 because none of them work. bmesh.loops.layers.color[0] returns index out of range
eobet's user avatar
  • 332
0 votes
0 answers
15 views

Blender Bmesh set custom normal

I'm trying to adjust the normals of selected vertexes on a vector. The code runs without errors but does nothing. Blender version 4.0.2 ...
Anton Vashkevich's user avatar
0 votes
0 answers
29 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
37 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
66 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
52 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 ...
user avatar
2 votes
1 answer
26 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
29 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
35 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
28 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
18 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
35 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
171 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
34 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
45 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
25 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
152 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
38 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
12 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
64 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
129 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
51 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,339
1 vote
1 answer
235 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,339
1 vote
2 answers
122 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
  • 590
3 votes
2 answers
184 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,942
0 votes
2 answers
181 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
  • 2,381
0 votes
1 answer
94 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
286 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
29 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
65 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
  • 590
2 votes
1 answer
304 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
109 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
48 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
  • 980
3 votes
1 answer
132 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
  • 47
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
1k 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
19 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
26 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
401 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
41 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
79 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,339

1
2 3 4 5
9