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
2
votes
1answer
4k views

Create a UV Sphere / Object in Blender from Python

Referencing to this code: Create a Cube in Blender from Python ...
6
votes
1answer
1k views

Applying per-vertex colors to new Bmesh

I'm having trouble applying vertex colors through Python to a mesh. The mesh is imported from a file which has vertex info, face info (vertex indices), and a list of colors that corresponds to each ...
0
votes
0answers
16 views

Why is deselecting vertices with bmesh not working?

I want to make use of the bmesh module to update mesh selection. To select vertices works as expected, but to unselect vertices does not work for me... Am I ...
19
votes
6answers
12k 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 ...
1
vote
0answers
30 views

Merging multiple Objects, removing excess inner geometry for 3d printing 2.82

I tried searching but could only find old non-2.8+ related info I am trying to merge 30 disks to a supporting geometry, and the intersecting geometry will not let me 3d print properly. Boolean search ...
0
votes
2answers
174 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 ...
0
votes
0answers
22 views

Simulating and visualising arbitrary curvature flows in Blender - Is it possible?

I would like to simulate the evolution of surfaces under various different curvature flows e.g. mean and gauss among others. I have a background in Mathematics and have ran basic simulations before ...
2
votes
1answer
54 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 ...
1
vote
1answer
53 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 ...
0
votes
1answer
37 views

Recursive search for selected vertices

i am working on a tool and need to get selection islands in the mesh. I want to keep only the biggest connected vertex selection in the mesh. I wrote a function that recursively searches a ...
0
votes
1answer
48 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 ...
2
votes
1answer
179 views

Remesh a selected surface

Is there any modifier that allows me to remesh let's say a one selected surface (triangulation)? I'm working on complex boolean objects. The problem when I apply boolean operations the mesh gets nasty ...
1
vote
0answers
14 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: ...
0
votes
1answer
45 views

Trying to swap vertex with uv by script

Basically, I want to create a tool that can swap between one vertex coordinate with specialized UV data named 'SwappedUV' for whole vertex in active object (if not exist, it'll create new UV layer ...
0
votes
1answer
24 views

Creating a new vert with bmesh resets previously created verts

I'm creating new vertices using bmesh at 3d cursor position but every time I add a new one, all the previously created vertices jump to their original positions (if ...
0
votes
1answer
50 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 ...
0
votes
1answer
148 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 ...
1
vote
1answer
684 views

There is a way to add custom split normal use Python API?

I can't find a way to achieve custom split normal effect. I want to use python (mesh normal/hard edge or soft edge) data collected from Maya then write to Blender mesh. How to do it using the ...
0
votes
0answers
15 views

Need help with inconsistent edge selection in python (using bmesh)

I've been writing a script for generating buildings but am running into issues with edge selection and (I suspect) bmesh. Specifically, I've written a function that determines an edge's direction ...
0
votes
1answer
134 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: ...
0
votes
1answer
35 views

best way to select edge to use bmesh.ops.bevel

I would like to bevel some of the edges of my object. I tried this code (works but is not consistent) ...
0
votes
1answer
46 views

Select vertices, edges, faces of individual objects

I add 1 circle using this code ...
3
votes
1answer
377 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 ...
2
votes
2answers
421 views

Python BMESH: For loop breaking trying to split mesh via UV Islands

Perhaps I am not using bmesh properly. I'm trying to create a script that splits a mesh by it's UV islands. The script attempts to iterate through each face of mesh and... select a face. select ...
1
vote
2answers
75 views

merge vertices at center bmesh

I have a script that makes 2 circles extrude them then bridge loop them and finally solidify. After solidify is done I noticed that the inner vertices are overlapping instead of merged. (See ...
1
vote
0answers
24 views

How can I run Bmesh ops interactively inside an operator with a popup?

I would like to add some bmesh operators to one of my operator class. The operator has pop up menu invoked by return wm.invoke_props_dialog( self) so the values are ...
1
vote
2answers
622 views

What is the best way to copy/append geometry from one bmesh to another

I get geometry from bisecting some mesh bm_tmp by a plane and I want to copy/append the resulting geometry r['geom_cut'] (only ...
1
vote
1answer
18 views

how to symetrize a part of the mesh in its normal orientation/position in edit mode?

how can i symmetrize this mesh in this position? i mean to do it by the median point and by the normal orientation rather than local or global transforms orientation, in this case in the X axis in ...
1
vote
1answer
432 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 ...
1
vote
2answers
43 views

Get bmesh and list of vertices

I try to get the are_inside function working from: https://blender.stackexchange.com/a/80781/21443 No matter what I try, I just get new errors. My scene is as ...
0
votes
0answers
24 views

How to average the normals of mesh to corner angles using Bmesh

I am trying to do the same as bpy.ops.mesh.average_normals(average_type='CORNER_ANGLE') but using Bmesh instead, since Bmesh doesn't have a command for this i thought i would have to edit each vert ...
0
votes
0answers
20 views

Blender Script: How can I replace one vertex of a face?

I am writing an exporter addon for Blender 2.79 and I would like to know if it's possible access a face by script and replace one of its vertex by some other. One solution that I found is creating a ...
1
vote
0answers
46 views

ensure_lookup_table creates indices in random order?

I have a python script that creates a sphere, then randomly selects a face and extrudes it. This creates new geometry and deletes the old geometry, so I need to call bm.faces.ensure_lookup_table. ...
1
vote
1answer
301 views

Knife tool with bmesh API

I need to find the intersection curve between two (open) meshes, and I can do that interactively with the knife tool. In search for a way to do it from a script, I came across the following highly ...
0
votes
1answer
122 views

Boolean on two simple bmesh

I'm a newbie in blender and I'm trying to play around with the boolean difference modifier. I have two concentric disks and I want to perform the boolean differece between them. I'm using the python ...
3
votes
1answer
684 views

Access color of a point given the 3D position (on the surface of a polygon)

My problem consists in accessing the color of a given point (I know the 3D coordinates (x,y,z) that lies on one surface of a mesh. I use raytracing to get the 3D position of the point casting a ray ...
0
votes
0answers
83 views

Get Face Angle values info via python

I would like to get face angle information (same information you can see when "Mesh Display->Face Info: Angle" is enabled. I want to loop over the mesh to find triangles that fit certain angle ...
0
votes
0answers
36 views

How to retopolgise game character made of separate meshes with difficult to reach areas

I can't figure out how best to retopologise a character for a game engine when the character consists of multiple parts. Correct me if I wrong but I believe for a game engine such as unity my ...
0
votes
2answers
129 views

How can I get a vertex count for an edge loop in Python for Blender 2.8?

I have an object that consists of two polygons. I'm trying to get a vertices count for the first polygon so I can select it's last two vertexes by index. I know that it starts at Index 1. I can use ...
1
vote
2answers
224 views

Navigate the disk cycle, like you can navigate the loop and radial loop cycles in bmesh?

So, in bmesh you can navigate the loop cycle via loop.link_loop_next loop.link_loop_prev You can navigate the radial loop cycle via ...
0
votes
0answers
21 views

Select faces inside selected edges?

How could I do this with bmesh maybe? I need to select faces inside selected edges. This works only 50% of the time and I need it to work 100%. I'm currently selecting the weighted edges then ...
1
vote
1answer
114 views

Uniquely addressing vertices in python

This has been driving me crazy for some time, because it seems so simple, but I just cannot find a way to do it despite exhaustive searching. Say I'm in bmesh, and I create a vertex, and I add it to ...
0
votes
0answers
27 views

Mesh shapes keeps changing while rigging

I have checked everything like double vertices but while mesh still keeps on changing its shape when I am trying to change the rotation of bone. Why the mesh is not retaining its shape? UPDATE- I ...
1
vote
0answers
366 views

Blender 2.8 (Python) - how to put mesh into edit mode

For this line of code: bm = bmesh.from_edit_mesh(mesh) I am encountering the error 'ValueError: The mesh must be in editmode' I am not certain how to fix this ...
0
votes
0answers
21 views

Particle distribution map from cycles material data?

any ideas on how to translate cycles material to a texture/vertex distribution map ? it's for biome scattering. Preferably a non destructive way by not baking anything Best Answers will be rewarded.
4
votes
2answers
1k views

Use the bevel-tool from python script

I want to use the bevel-tool to add a face between two other faces. The bevel-tool should use the selected edge(s) as geometry.location is given via a selected edge. This is what I have This is ...
2
votes
0answers
44 views

bmesh from_edit_mesh points to old dead bmesh after free

I've been struggling with a bmesh problem for a while now and I can't wrap my head around it. When I free my bmesh data and try to make a new bm instance with the same object, it points to the old ...
0
votes
0answers
33 views

Building Object, Mesh, and UV Map with Python

I am trying to learn how to create new objects from vertices and face data and also include a uv map. I used the following code: ...
1
vote
2answers
129 views

Help modeling this dome

I am very new to blender and still using 2.78, I have this idea in my head and but can't think of how to model a dome shape with a cross on top if that makes sense. I attached a sketch of how I want ...

1
2 3 4 5