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
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
24 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
19 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
20 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
2 votes
1 answer
64 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
33 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
0 votes
0 answers
4 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
38 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
14 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
59 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
30 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,134
0 votes
1 answer
71 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,134
1 vote
2 answers
65 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
  • 454
3 votes
2 answers
73 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,841
0 votes
2 answers
67 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,737
0 votes
0 answers
53 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
  • 11
0 votes
1 answer
49 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
132 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
0 answers
22 views

Is it possible to guarantee a maintained reference to MeshVert/BMVert elements after adding/removing others?

I want to reference/tag a particular set of verts, then manipulate the mesh and still have them have them distinguishable for new ones.
jdecent's user avatar
0 votes
1 answer
25 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
48 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
  • 454
2 votes
1 answer
264 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
75 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
  • 55
0 votes
0 answers
43 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
  • 950
2 votes
1 answer
80 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
16 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
0 votes
0 answers
27 views

determine index of selected vertices and calculate perimeter

In the interface, with Select loop > Edge loop I can select the circumference of ex. the hip of my mesh and also display the vertices number. Is there a way through scripting, with which I can ...
Ortho12's user avatar
5 votes
3 answers
637 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.7k
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
0 answers
48 views

How does BMesh data structure work?

I am trying to understand the BMesh data structure. I am totally new to CAD software design. I was reading the source code and "non-manifold" was a completely new word to me. So, I did some ...
Sherajus Salehin's user avatar
0 votes
1 answer
19 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
0 votes
0 answers
44 views

BMesh from_mesh messes up split_normals?

I'm struggling to copy a mesh into another one with proper conservation of split_normals (using from_mesh). It seems that they are being changed somehow, although mesh should be a 100% copy. This is ...
Jake's user avatar
  • 1
0 votes
0 answers
20 views

Move mesh while it overlaps with another (scripting)

I want to load one model and place it at $(0, 0, 0)$, then load a second one, place it at $(0, 0, 0)$, then randomly move it until it doesn't intersect with the first one. Here's my approach, after ...
EOF's user avatar
  • 101
0 votes
1 answer
230 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,229
0 votes
0 answers
37 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
50 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,134
0 votes
1 answer
67 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
34 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
  • 507
1 vote
1 answer
102 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
26 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,134
0 votes
1 answer
256 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
  • 507
2 votes
1 answer
307 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
  • 32.6k
2 votes
1 answer
285 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
265 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,304
2 votes
2 answers
1k views

How can I convert a CURVE to a MESH object

I am trying to convert all the curves in a blendfile to meshes - like this, as explained here: ...
simone's user avatar
  • 693
1 vote
1 answer
269 views

Python - How to make box out of selected verts' bounding box in local space?

I want to make a box out of selected verts' bounding box in local space
Karan's user avatar
  • 1,737
3 votes
1 answer
235 views

Creating geometry using bmesh.ops removes/invalidates previous vertices

I have a bmesh holding some geometry. I store pointers to some of the vertices because I need them later. Then I add a sphere using bmesh.ops.create_icosphere. ...
Germanunkol's user avatar
0 votes
0 answers
103 views

Blender Script (bpy) to Change colours of Voxel Faces

I have a 3d voxel model of a human bust that looks very poor. Even after reducing the colour for each voxel face to a single colour, the resultant model does not look good. I want the model to have a ...
mahnoor.fatima's user avatar
3 votes
1 answer
213 views

Python - How to create capsule from sphere via Bmesh?

I want to make a capsule by changing the distance between the two halves of the sphere to a certain depth ...
Karan's user avatar
  • 1,737
2 votes
1 answer
267 views

Python - How to make a new object out of selected verts via Bmesh?

I want to make a new object out of selected verts via Bmesh ...
Karan's user avatar
  • 1,737

1
2 3 4 5
8