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
2 votes
1 answer
24 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 ...
user avatar
  • 21
2 votes
1 answer
23 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: ...
user avatar
  • 1,082
1 vote
0 answers
48 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: ...
user avatar
  • 579
0 votes
0 answers
9 views

Adding Vertex Group to BMesh Vertex

I am trying to add or remove an object's active vertex group to the selected BMesh vertex so that I can set its weight. In this post, Accessing weights of a bmesh, I learned how to access the BMesh ...
user avatar
0 votes
1 answer
41 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
user avatar
  • 496
3 votes
1 answer
54 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. ...
user avatar
0 votes
0 answers
28 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 ...
user avatar
2 votes
1 answer
61 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 ...
user avatar
  • 496
2 votes
1 answer
41 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 ...
user avatar
  • 496
2 votes
1 answer
55 views

Python - How to add convex hull to selected verts?

The left convex hull is created in object mode and the right convex hull is created in edit mode I want the convex hull of ...
user avatar
  • 496
2 votes
2 answers
54 views

Bmesh.calc_tangent_edge_pair - how does it work?

I'm trying to understand how bmesh.calc_tangent_edge_pairs works so I can replicate it in another software. I have looked at (what I believe) is the source code, but to be honest it didn't help much ...
user avatar
3 votes
2 answers
81 views

How do I programmatically control the color of instances?

I'm loading MD simulation data into Blender and want to set the color of instances to indicate an attribute value that has been calculated separately beforehand. The current workflow looks like this: ...
user avatar
  • 51
0 votes
1 answer
29 views

Why can't vertex indices be sorted by Z_VIEW in blender python?

Run the following code: import bpy bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.sort_elements(type='VIEW_ZAXIS', elements={'EDGE'}) python console prompt ...
user avatar
3 votes
1 answer
115 views

How to delete vertices that are not part of a face using python

I want to delete vertices that are not part of a face (as for example the selected ones in the image) using python. What I tried so far is: switch to face select mode select all faces switch to ...
user avatar
  • 299
2 votes
1 answer
56 views

I am learning bmesh in blender python and want to extract the index of a new faces created after using bmesh.ops.bevel

I have written a small script to bevel selected edges and want to be able to select the newly created faces in bmesh. It returns a dictionary of the faces, edges, and verts with the types in long-form ...
user avatar
0 votes
0 answers
34 views

BMesh how to perform select similar operations such as select edge ring, or select similar face angle

I'm trying to write a script that intersects 2 selection operations, hence I need to save edge selection, deselect, and reselect the stored edge selection. I tried with the conventional method, but ...
user avatar
  • 4,572
3 votes
1 answer
78 views

Is it possible to get the UV position of a selected face in the 3d view and display it in a panel?

I want to be able to display the UV coordinates of a selected face (or vert but if I can get one to work I assume the other will too). I cobbled together a rough script that'll show the UV coordinates ...
user avatar
  • 327
0 votes
0 answers
22 views

Quick script for joining bmesh verts; Only last operation is performed

So I built a simple script to take a set of selected verts, mark the most recently selected as target and connect all other verts to target with bmesh.ops.connect_verts ...
user avatar
0 votes
0 answers
24 views

Having issues setting coords on bmesh

So I'm trying to build a small script to map down verts of target mesh to verts of a source mesh after cutting hole with knife project ...
user avatar
0 votes
1 answer
62 views

Delete polygon using python

I have a script that returns the 4 vertices of a polygon. How can i delete this polygon? I've tried using bmesh but need the face index and not vertices. This is a ...
user avatar
0 votes
1 answer
43 views

Customized Mesh with blender python [closed]

I'm interested in creating a plane with a customized mesh from a python script. Is there a way to achieve this?
user avatar
  • 141
0 votes
1 answer
46 views

bmesh as global variable in a modal function?

I am updating as well as trying to optimize an add-on that I haven't touched in a couple of years. I learned python as I was making that add-on back in the day, actually, and now am reading that the ...
user avatar
  • 193
0 votes
1 answer
59 views

BMesh object rotation

I create a BMesh from a list of vertices like that: ...
user avatar
  • 615
1 vote
1 answer
72 views

rotate bmesh around bounding box center, not global

how do I rotate the mesh around its center using the bmesh.rotate ...
user avatar
  • 45
1 vote
0 answers
27 views

how can I access absolute vertex positions from mesh with armature?

I downloaded an animated mesh in FBX form from mixamo. When I import it to blender, the object looks like this in the outliner: I need to access vertex positions of my mesh at every frame of the ...
user avatar
  • 61
1 vote
1 answer
55 views

Blender crashes using a bmesh python operator

The following python operator crashes blender. I'm using 2.93.5 on Win10. Strangely however, if I use the python terminal built into blender I can import bpy, bmesh ...
user avatar
0 votes
0 answers
40 views

Adding Edit Mode "Transform" Panel to UI

I am trying to make a custom panel that includes the "Transform" panel that appears in edit mode. I do not need to do anything special, I just want this panel added for convenience. I do ...
user avatar
0 votes
0 answers
23 views

Extracting internal forces of cloth simulation springs for manipulation in Python script

Is it possible to extract the simulated forces per-frame per-vertex in the 4 springs as described here Link? I have come across this Mesh Tension Tool which infers strain(tension) through mesh ...
user avatar
1 vote
1 answer
54 views

How to select all faces of a Circle object prior to bpy.ops.uv.cube_project(cube_size=10)

...
user avatar
  • 11
1 vote
1 answer
46 views

copy cursor rotation to geometry in edit mode with python

using bmesh I want to use cursor matrix to rotate some selected geometry (edges or faces). using just cursor rotation, and using rotation and location to rotate around cursor
user avatar
  • 54
5 votes
1 answer
274 views

How do I measure the length of a selected edge with Python?

Which operation would I use to acquire the length of the edge I have selected so that I could store that in a variable for later use?
user avatar
  • 53
1 vote
1 answer
52 views

Select top and/or bottom face of bmesh cone

I would like to ask if there is a better way to select the bottom and top face of a cone then how I do it now ...
user avatar
  • 160
1 vote
1 answer
91 views

How to identify the edges at the "outside" of a mesh in python? [duplicate]

In python (ideally bmesh, and not bpy.ops) is there a way to identify the edges at the "outside" of a mesh, such as the ones selected in the cylinder shown below (image edited for clarity)? ...
user avatar
  • 579
0 votes
0 answers
34 views

Remove overlapping area

Blender version: 2.79 ( I can not change this at the moment! ) I am trying to remove the area from a mesh that is overlapping with the area from another. Here is a screenshot: I tried this code: <...
user avatar
2 votes
1 answer
71 views

Scaling down one face of a mesh using Python API

I am generating a mesh from a collection of points read from a json file. That collection of points will define the vertices, and from them I will derive the faces of the final mesh Code is working ...
user avatar
2 votes
2 answers
413 views

How to assign a material to a single face of a mesh using Python API

I have tried the following but the mat is not assigned to any of the faces. ...
user avatar
2 votes
2 answers
374 views

How to select vertices by their index in edit mode?

I've created a mesh object by generating two Bezier curves and converting that to a mesh using this script ...
user avatar
  • 21
0 votes
1 answer
101 views

Update/overwrite an existing mesh within a collection Python Blender

I have made the following python script which contains one function, this function creates one simple mesh. ...
user avatar
  • 1
2 votes
0 answers
54 views

How to set split normals in edit mode python

I'm making a function similar to the normal editing function Point to Target. When I run the following code, the split normals are changed from the first to the second image, but once I switch back to ...
user avatar
  • 121
0 votes
0 answers
19 views

Bender model has changed

When blender model is imported to unity as .fbx file, the model has been changed like thiseven though this model having no rigs and inverted normals. And i tried this way also (changing faces quards ...
user avatar
1 vote
0 answers
38 views

Vertex as x,y co-ordinates from face center for animated object

I'm trying to obtain the selected face vertex locations for an animated Object as x,y co-ordinates relative to f.calc_center_median() as the origin center [0,0] (...
user avatar
  • 941
1 vote
1 answer
51 views

bmesh transforming multiple objects into a single mesh (separate objects)

I am trying to duplicate multiple objects resulting in the same location/rotation relative to each other. I can get my code to work for a single object but when multiple objects are used obviously the ...
user avatar
1 vote
1 answer
55 views

Why Does Blender Keep Crashing When I Try to Run a "Mesh Object From Scratch" Script?

I'm trying to create a cylinder with vertices all throughout the tubing. A normal cylinder does not have these vertices, so I decided to create a mesh object from scratch. After finally cleaning up a ...
user avatar
  • 344
1 vote
1 answer
244 views

Using Python and bmesh - How can I UV unwrap a cylindrical object to a flat plane?

I have the following object: The UV grid on the left hand side is what my script currently does. Here is the code: ...
user avatar
0 votes
0 answers
67 views

How do I extrude a mesh along normals with python?

I am trying to do the following: use a mesh to knife project onto another mesh duplicate the faces that have been cut extrude the duplicated faces by a given amount in one operation. I managed to do ...
user avatar
  • 579
0 votes
0 answers
32 views

Calculate edges in selected loops in python

My task is to count the number of edges in each of the selected loops (paths of edges that are separate from each other). I looked for solutions on the forums, but I didn't find them anywhere. It is ...
user avatar
0 votes
0 answers
336 views

Convert Open3D Mesh to Blender Mesh via Python API

Say I have a very simple triangular mesh with 10 points and 6 triangles, generated via the code below. The mesh has vertices, colors for each vertex, normals, among every other parameter available ...
user avatar
  • 101
0 votes
0 answers
46 views

Insert a key frame on a coordonate in a bmesh [duplicate]

I am new to this forum and also to bpy. I would like to insert a series of keyframes but I do not know the data path to use with bmesh, could you help me. Thank you. ...
user avatar
1 vote
1 answer
85 views

Is it possible to extract the bmesh python module and use it standalone, in other python projects?

I have been searching around the web for python mesh processing libraries that can do "simple" mesh editing functions like edge beveling, or face extrusion. There's not really anything out ...
user avatar
0 votes
0 answers
26 views

How to connect edges and create face on disconnected vertex through scripting api

I'm trying to create new faces on a mesh as per the image. End result should be the triangle split to 3 faces each having 4 edges. For some reason following code does not connect the edges, the new ...
user avatar
  • 227

1
2 3 4 5
8