Questions tagged [bmesh]

Blender's new mesh system that was added in 2.63, with full support for N-sided polygons instead of only triangles and quads.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 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
29 views

Add custom vertex attribute with bmesh without using context

Update: This two examples are working : Face Corner Attribute ...
0
votes
0answers
24 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 ...
-1
votes
0answers
19 views

How to cut a square on BMFace and make it hollow?

...
1
vote
0answers
51 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 ...
5
votes
1answer
296 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 ...
4
votes
1answer
2k views

BMesh get edge loop

I'm trying to get edge loop, starting from one edge and continuing as far as the loop goes. The following code does not work, because vertex index order is disrupted, so I have no apparent way of ...
1
vote
1answer
103 views

Fast access to bmesh verts/edges/faces from python?

I'm trying to build a large BMesh from scratch in python. I know you can add vertices (or faces or edges) to a BMesh one at a time: ...
1
vote
1answer
110 views

How to get “bpy.ops.mesh.select_more()” working for a bmesh?

When I select some meshes of my object by hand or with a script, the selection of some meshes "fades out". With "Select - Select More/Less - More) I can select these mesehs, too. But with a script I ...
1
vote
1answer
27 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: ...
3
votes
1answer
108 views

Reverse armature deformation on vertex in python

I have a mesh with armature modifier (active+posed) and wish to do some modifications with vert coords (after armature deformations) saved in shape key on that mesh. But currently it seems not ...
0
votes
0answers
37 views

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

I've got this code: ...
1
vote
1answer
85 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
1answer
271 views

Mesh is Grey after adding an Image/Texture to a material

I need some help making a mesh colorful. The image I add to a material does not show up on my mesh. A snippet of the code is below ...
0
votes
1answer
167 views

Python Script - Addon; Bmesh Clean

I've purchased an Addon called 'Bmesh Clean' which basically systematically cleans up any selected mesh. I'm trying to write my own script that will automate a process, which will include using the ...
5
votes
2answers
1k views

How to create a tetrakaidecahedron and keep only the edges?

The idea I have is to start from the tetrakaidecahedron, have the edges and create something organical as the photomicrograph below. Photomicrograph of open-cell foamed urethane
1
vote
0answers
18 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 ...
2
votes
1answer
20 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: ...
0
votes
2answers
141 views

Triangularization problem in symmetric objects

If I create a symmetric object without the mirror modifier, the triangularizations of the mesh aren't symmetric during rendering. Is this a feature or bug ?
0
votes
1answer
217 views

Getting BMesh Face Index from UV Face Index

I want to iterate over the square blocks of the UV map from left to right (and then top to bottom) and find the index in bmesh of the face(s) contained in each of the block (one block can contain ...
3
votes
1answer
627 views

How do I grab the active texture on a face in python?

So I'm pretty much done with designing a script to export meshes I (or others within my group) make in Blender for use in another piece of software (VoxelStudio). Everything has been slow going due ...
6
votes
0answers
54 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, ...
2
votes
1answer
24 views

UV-Mesh transformation in python

I want to create a large set of spiral galaxies with textures using a python script. I managed to create shader nodes and links to set up a material. For the spiral shape, I need to perform a ...
0
votes
1answer
418 views

Calculate Faces from Point Cloud with Python

I have a bunch of vertices in a point cloud stored in an obj file (i can change the file if need be). How do I calculate the faces from the point cloud using python? Example: ...
1
vote
0answers
35 views

Bmesh: How to select newly created vertices?

I'm running bpy.ops.mesh.knife_project(cut_through=True) using an Edge to Slice a mesh. Next I want to select newly created Edge loop and remove all other vertices. I'm thinking of capturing two ...
1
vote
0answers
29 views

Brainstorming Recreation of MODO Contour Tool

currently working out how to reproduce MODO's contour tool in Blender. I've tried a couple methods and ran into road blocks. Below is a snippet into my attempts. Ideally this script would be a low ...
0
votes
0answers
25 views

Get interior polygons of rooms using Python

I have a room that looks like this: What would be the best way to extract the bottom edges of the inside rooms using Python? To build polygons for each room, kind of like this: I tried to use ...
2
votes
1answer
274 views

Why is mesh.from_pydata resulting in segmentation faults?

I have vertex and face data loaded from a cube that was subdivided many times, with a total of 26138 vertices and slightly fewer faces. I am loading the object in a script, and whenever I try to load ...
0
votes
1answer
39 views

Create cube in bmesh at given position in a efficient manner

I want to create a cube in bmesh at a specific position. How can I accomplish this? I'm interested in as efficient solution as possible btw... there will be A LOT of cubes to create every frame.
1
vote
1answer
46 views

How do I rotate a face around an axis in normal orientation in Python?

I have a set of vertices for a BMFace that I'm trying to rotate around the x-axis but in the face's normal orientation. Currently I'm doing: ...
0
votes
0answers
28 views

How can I get sliced face information after a bmesh bisect?

I want to generate faces from the edges and vertices generated after running the bisect operation on a bmesh. However for non-trivial objects it frequently gets stuck or jumps/misorders the series of ...
1
vote
2answers
3k views

How can we remove overlapping edges?

I am cleaning up a friend's model and often run into this problem: Often, there are multiple edges of various lengths overlapping along the same line. Below is a visual example: ...that overlap to ...
1
vote
1answer
518 views

BMesh and Bevel

I'm trying to perform a bevel operation using the bmesh API. My script either crashes blender, with the error message EXCEPTION_ACCESS_VIOLATION, or it doesn't do ...
0
votes
1answer
97 views

How can I use bmesh vert index as vertex color index?

I want to modify the vertex color by index, the bmesh vertex index value seems unequal to the colorlayer.data index, so it's difficult to draw a vert with several mesh cross. Is there any to fix this ...
1
vote
0answers
17 views

Duplicated vertices created by bmesh.ops.bisect_plane

I want to get a mesh's bisected surface's vertices and edges. I tried to bisect a sphere using bmesh.ops.bisect_plane. ...
0
votes
0answers
22 views

b-mesh area using like particle system

How can I put objects onto a random position of an objects face (or faces) pointing along the face normal axes? I found this here on StackExchange, but I don't understand how to use the area result. ...
4
votes
0answers
107 views

Strategy for script-generating a buckled honeycomb lattice mesh (hex faces) for animating 2D materials?

In this post I show how one can script-generate a square lattice with buckling. By scripting it there's memory of each vertex's identity which can be used later to animate certain behaviors. When ...
1
vote
1answer
51 views

Need to modernize my scripting, this bpy based script from 2.77 doesn't run in 2.92 so I can't post my main question yet [duplicate]

I need to make a custom mesh, don't know how and want to post a question about it. However before I do I want to run an example of something simple. I've been away for several years, this runs on 2.77....
3
votes
1answer
46 views

Color vertex by deformation value in an animation

Hi I have been trying to develop code which shows the amount of deformation on a mesh's edges by coloring the vertices a value which depends on the average change in edge length for the connected ...
0
votes
0answers
19 views

How to delete a face using BMESH.OPS? (SOLVED)

Sorry if the question is asked before, but I tried using the examples I found on StackExchange and it still didn't give me the right mesh. I am trying to create a tube that has a shape of cylinder at ...
3
votes
0answers
19 views

Find texture pixel on 3D mesh

I have a complicated mesh of a real object that I created with a 3D camera. The mesh has a corresponding large texture that maps onto the mesh. I imported the mesh into Blender and then applied the ...
1
vote
0answers
40 views

How to subdivide and calculate volume of an object without using operators

I'm using Blender for an unusual purpose (research) so my issue is probably a bit unusual, and Blender was likely not designed with the flexibility that I may need. I need to calculate the volume of a ...
0
votes
0answers
21 views

visual studio code bmesh gives weird error

i started making scripts in visual studio code for blender a few weeks ago but i ran into a weird problem, when trying to use bmesh specifically bm = bmesh.new() it ...
2
votes
1answer
76 views

How to create cylinder with varying radius at different height

My goal is to create a imperfect cylinder with a script, where some randomness is added to the radius of the cylinder at certain intervals. I am very new to blender unfortunately, and am lost at the ...
22
votes
8answers
18k views

Efficient way to get selected vertices via python (without iterating over the entire mesh)

What's the best/fastest way to construct a list of selected vertices for a mesh object in python? I want to avoid iterating over every vertex in the mesh if possible, since that seems like a really ...
2
votes
0answers
755 views

BMesh Grid Fill doesn't work on closed edge loop

I've been trying to automate the task of deleting the ngon cap on the end of a cylinder and replacing it with quads using the Grid Fill tool. Something similar to this: I'm using this script: <...
1
vote
1answer
57 views

Collect, apply modifiers, and triangulate meshes before export, without touching the original mesh

I try to export a collection of meshes such that The original meshes is not touched by the exporter All modifiers affect the exported mesh The exported mesh is triangulated It should not look like ...
3
votes
2answers
203 views

List vertex colors from a bmesh

I'm working on a custom exporter for an external software. I need to get a list of the vertex colors from a triangulated mesh. To get the triangulated mesh I use this code: ...
0
votes
0answers
52 views

Add modifier to object created programmatically using Python API [duplicate]

I have created an object programmatically and want to add a modifier to it too, programmatically. Here is my current code ...

1
2 3 4 5
7