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
15 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 ...
0
votes
0answers
12 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
22 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
40 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
76 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
18 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
15 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
45 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
44 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. ...
0
votes
1answer
22 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
15 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
9 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
23 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
15 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
0answers
16 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
20 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
39 views

Add custom vertex attribute with bmesh without using context

Update: This two examples are working : Face Corner Attribute ...
0
votes
0answers
26 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 ...
5
votes
1answer
318 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
56 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
34 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
43 views

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

I've got this code: ...
1
vote
1answer
96 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
21 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
21 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: ...
6
votes
0answers
79 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
32 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 ...
1
vote
0answers
38 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
32 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
28 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 ...
0
votes
1answer
44 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
56 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
29 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
0answers
19 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
111 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
54 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
50 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
23 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
43 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
24 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 ...
3
votes
1answer
112 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 ...
3
votes
2answers
232 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
54 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
vote
1answer
95 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 ...
1
vote
0answers
95 views

How to access/calculate tangent and bitangent vectors from BMLoop via script?

This question has an answer when using MeshLoops: Script access to tangent and bitangent, per face: how? But I'm working with BMLoops to collect vertex data. I haven't yet found a good way to ...
0
votes
0answers
20 views

Does the "diameter" in "bmesh.ops.create_uvsphere" actually mean "radius"?

I created a sphere using bmesh.ops.create_uvsphere(bm, u_segments=32, v_segments=16, diameter=1) but later I noticed the radius of the sphere was 1 grid. As the ...
1
vote
0answers
45 views

How to set loop (ie, vertex-face) normals from bmesh?

I'm trying to set face normals using a bmesh. I'm running this in response to a mouse click in an operator. In the below code, I'm able to run through my loops and set the vertex normals. While this ...
0
votes
0answers
19 views

bmesh How to remove data from the object after the function is performed, just like ctrl + z would do, but after many steps

I want to make a graph. There is a single horizontal line on x axis which is subdivided. I am able to select a particular vertex that I want with a function and bMesh to raise it by 1 unit let's say. ...

1
2 3 4 5
7