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
3
votes
1answer
49 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 ...
0
votes
0answers
19 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 ...
0
votes
0answers
21 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 ...
0
votes
1answer
45 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 ...
0
votes
1answer
27 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?
0
votes
1answer
31 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 ...
0
votes
1answer
39 views

BMesh object rotation

I create a BMesh from a list of vertices like that: ...
1
vote
1answer
34 views

rotate bmesh around bounding box center, not global

how do I rotate the mesh around its center using the bmesh.rotate ...
1
vote
0answers
15 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 ...
1
vote
1answer
36 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 ...
0
votes
0answers
23 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 ...
0
votes
0answers
14 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 ...
1
vote
1answer
30 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
4
votes
1answer
141 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?
1
vote
1answer
41 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 ...
1
vote
1answer
57 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)? ...
0
votes
0answers
73 views

How to select edges with a specific sharpness value in python?

I want to select sharp edges with a sharpness value that I can set through a FloatProperty, for instance, 60 degrees, and then apply ...
0
votes
0answers
28 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: <...
2
votes
1answer
40 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 ...
2
votes
2answers
161 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. ...
2
votes
2answers
111 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 ...
0
votes
1answer
28 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. ...
0
votes
0answers
25 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 ...
0
votes
0answers
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 ...
1
vote
0answers
30 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] (...
1
vote
1answer
25 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 ...
1
vote
1answer
50 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 ...
1
vote
1answer
140 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: ...
0
votes
0answers
34 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 ...
0
votes
0answers
22 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 ...
0
votes
0answers
208 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 ...
0
votes
0answers
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. ...
1
vote
1answer
50 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 ...
0
votes
0answers
20 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 ...
0
votes
0answers
13 views

Bmesh Getting individual edges from edge loop

given an edge loop, how do you access the edges contained in an edge loop. The line I attempt this is len(list(set(v.link_edges) & set(loop.edges)))==2: I haven't been able to find a solution in ...
0
votes
0answers
30 views

Using python and BMesh, how do you select edges containing/touching a series of verts?

Using python and BMesh, how do you select edges containing/touching a certain vert? I'm using link_edges, but it has no select attribute, so the v.link_edges.select_set(True) is wrong. ...
0
votes
1answer
19 views

is_manifold only selecting disconnected verts and not bordering vertices

The .is_manifold operator below is only taking completely disconnected verts and not the bordering open area with disconnected verts. There doesn't seam to be an is_border function. Any suggestions? ...
1
vote
1answer
23 views

How do I bend half of a pane to match slope of adjacent pane?

I am trying to bend half of a pane so that it matches the Pane adjacent to it.   I've tried multiple ways and have so far failed to match the required shape. It must also be python scriptable.
0
votes
0answers
37 views

mesh change vertex indices

I have a one-dimensional mesh (basically a snake-like list of vertices connected by edges, without any extrusion or anything) and I edited at some point in the middle adding more vertices. With python,...
0
votes
0answers
48 views

Add custom vertex attribute with bmesh without using context

Update: This two examples are working : Face Corner Attribute ...
0
votes
0answers
37 views

How do I write a blender addon script outside blender without having to pip install all the modules such as bpy, bmesh etc. separately?

I'm trying to create an add-on outside of Blender and I'm not sure how to go about installing dependencies to create it on another IDE. I don't want to use blender's script editor as it would be ...
6
votes
1answer
369 views

How can I generate a correct polygon from an array of unordered vertices?

I am working on a bmesh script that procedurally creates a mesh. I'm having a problem determining how to order the vertices for the generated n-gon face. I know the position of each vertex - but need ...
1
vote
0answers
81 views

How to return name of meshes that are inside of another mesh with python?

I have a problem with some files I've received. I have two sets of models, compartment bounding files (just empty boxes that represent a space) and some geometry that will go into those spaces. Worth ...
1
vote
1answer
49 views

Is there a bmesh way to do bpy.ops.mesh.extrude_context_move?

I've spent 2 days trying to figure this out, and I'm at my wits end. Sorry for the crufty code, but I am trying to replace this chunk here: ...
0
votes
0answers
90 views

What is a low level replacement for bpy.ops.object.transform_apply()?

I've got this code: ...
1
vote
1answer
110 views

How can I close holes in hexahedral meshes?

I want to be able to close holes in hexahedral meshes, I need that in order to produce physical computations on the model. How can I achieve that in the most efficient way? Simple "F" doesn'...
1
vote
0answers
25 views

Error Setting new vertice coordinate values in python - 'BMVertSeq' object does not support item assignment

I have a model containing two meshes which need to be resized with python. Let's call them an artwork and a frame. I want to resize the artwork depending on parameters passed in, but for simplicity ...
3
votes
1answer
34 views

Are `.link_edges` and `.link_faces` guaranteed to be in counterclockwise order?

BMVert().link_edges and BMVert().link_faces seem to always be in counterclockwise order. For example, take this cube: ...
7
votes
0answers
416 views

Is there a way to create a dual mesh using geometry nodes?

I'm trying to create a dual mesh, as described by Alessandro Zomparelly, but procedurally using Geometry Nodes. I've only come this far, but now I need to dissolve the vertices of the original mesh, ...

1
2 3 4 5
7