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.

101 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
102 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 ...
4
votes
0answers
80 views

Getting Color Values Produced by Dynamic Paint

I am having trouble with the python code to get the colors of vertices when using Dynamic Paint. If I try painting a cube using the Vertex Paint mode I can get the rgb values of the vertices using the ...
3
votes
0answers
18 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 ...
3
votes
0answers
21 views

Persistence of element tag and select using bound bmesh

For bmesh code I often used tag to flag a visited element. On noticing the tags persisted it was required to "detag" the entire bmesh element collection ...
3
votes
1answer
573 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 ...
3
votes
1answer
385 views

How to subdivide concave face into quads

I'm aware of bpy.ops.mesh.vert_connect_concave() and the result is similar to what I'm looking to implement. However, with ...
2
votes
0answers
22 views

Python to get Rgb of mesh faces

This is my first use of Python in blender, although I have had Python experience elsewhere some time ago (Arcpy). I have a mesh object with several faces that has a material calculated for each face ...
2
votes
0answers
804 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 ...
2
votes
0answers
110 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 ...
2
votes
1answer
88 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 ...
2
votes
0answers
123 views

Detecting mesh overlaps of objects inside another object

How can we detect the overlap between two objects one has been placed inside the other? I'm writing a placement algorithm and it seems regular BVH mesh overlap doesn't work for this case. Is there a ...
2
votes
0answers
127 views

Python: bmesh.verts not loading all vertices of mesh

As the title says, I am using bmesh.verts to load in all the vertices of a mesh to then check if their coordinates are within a certain box, and if they are select them. The problem is that the ...
2
votes
0answers
387 views

Separate mesh into separate batches with python

I am working on an export / import addon for a custom model file format which stores its geometry in the so-called "render batches", the structures aimed at optimizing geometry for effecient live ...
2
votes
0answers
19 views

split edge at multiple points without distorting uv or other data

Here's a bmesh edge: +-----------------------------+ Say I want to cut it at multiple points, in the middle and 3/4 from the end like so: ...
2
votes
0answers
240 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 ...
2
votes
1answer
81 views

Bmesh: Immediately encounter strange error after adding new layer and running bmesh op

The script is simple: ...
2
votes
0answers
449 views

Unwrap mesh with spherical projection in python

I would like to have the same result with python as in the UI when I do unwrap > sphere projection on a mesh. I know it's possible to use the operator ...
2
votes
0answers
195 views

Shrinkwrap with ray_cast isn't accurate

I'm trying to create my own similar Shrinkwrap-Modifier with raycast. Unfortunately the result isn't accurate and I don't know why. It work's with Spheres, all other primitives are inaccurate. ...
2
votes
0answers
711 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: <...
2
votes
0answers
269 views

Mark Seams on Edges of Camera View

I am trying to write a script to mark a seam on an object around the vertices of the object that are in the field of view of the camera. Unfortunately, some of my ...
1
vote
0answers
10 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. ...
1
vote
0answers
25 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 ...
1
vote
0answers
22 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 ...
1
vote
0answers
21 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 ...
1
vote
0answers
68 views

how to convert shape to volume?

I have a 3d model (.stl) of building and I want to use it in other software. The walls of the model are built with shapes, and I need the walls as volume. There problem is that the model was made by ...
1
vote
0answers
25 views

Python: Nonsensical edge addresses when using bmesh.ops.create_circle

TL;DR: Two different faces created using bmesh.ops.create_circle have the same edges... sort of? ...
1
vote
0answers
34 views

Naming object issues

I'm trying to add some items to the scene and rename them but ran into some issues. Example code: ...
1
vote
0answers
341 views

When to use “.ensure_lookup_table()”?

For modifying meshes (in the hereunder example removing vertices), I use the script as follows: ...
1
vote
1answer
41 views

Change proportion on base mesh

I discovered a video that shows a very quick way to make base mesh (skin modifier as everyone already knows) but it's a timelapse, so there's no explanation at all. In 01:00 he starts to scale vertex ...
1
vote
0answers
43 views

Calculating edges and polygon indices in python numerically to build mesh

I can calculate the vertices and faces but how does one calculate edges and polygon indices numerically in python? ...
1
vote
0answers
86 views

How to get normal of the edge

In the Blender api, it is possible to get the normal of the vertex and face, but it is not possible to get the normal of the edge. Is there any formula for calculating normal of the edge or some other ...
1
vote
0answers
23 views

is there a way to generate a mesh from pts using bmesh without a loop in python?

I am very new but far as I know there are at least two ways that one could generate a mesh via python from raw points (such as from a xyz file or something else that isn't directly supported in ...
1
vote
0answers
143 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 ...
1
vote
1answer
71 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
0answers
53 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
0answers
181 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
195 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 ...
1
vote
0answers
118 views

Is there any XOR option for Boolean Modifier?

Let say we got two object, I want to get the sum of the difference for calculating error between two meshes. As the sum of red and blue area following image showed: Somehow the Boolean Modifier doesn'...
1
vote
0answers
481 views

Rotating selected vertices around given point using a matrix? (python, bmesh, modal, without bmesh.ops.rotate)

Is there a way to rotate bm.verts around a given point (another vertex, cursor etc) by multiplying v.co with Marix.Rotation and not using bmesh.ops.rotate? Like this: ...
1
vote
1answer
98 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
0answers
53 views

How to find the distance from a face of one object to the surface of another object, along the face's normal

I feel like this has probably been answered, but I searched and couldn't find an exact solution. What I want is a quick way to take a selected set of faces on an object (or the vertices that make up ...
1
vote
0answers
101 views

How do I remove the original faces when extruding with Bmesh?

I followed this and ended up with a closed mesh. ...
1
vote
0answers
294 views

Calculate a surface by checking if meshes intersect

In addition to this unresolved question, I would like to add another problem: The main problem is that I made a few hundreds of random non overlapping circles that belong to the same mesh object, and ...
1
vote
0answers
732 views

Edge Loops and Python. Enumerating and Analysis

Does Blender Provide any Edge Loop identification in Mesh or BMesh? If yes, what is the link or document that describe such support? Showing edge indices of a selection. Image Above. Crude Console ...
1
vote
0answers
1k views

How can I change the resting position of a rig from T-pose to A-pose

The avatar is in a T-Pose and the weighing etc. works, but I want to put it in an A, standing position so that I can more easily create clothing for it. But whenever I reposition the rig, the weights ...
1
vote
1answer
512 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
0answers
60 views

Merging 2 BMVert's with Python

Is it possible with bmesh to specify merge together 2 BMVerts easily? Or must I do it the manual way and delete faces, remove vertices, and recreate faces at the ...
1
vote
0answers
230 views

Exclude specific vertices from selected vertices

I have a mesh, and i use 'select boundary loop' to select all the vertices on the outline of my mesh. after that i need to exclude from this selection some vertices from a list of vertices stored in ...
1
vote
1answer
455 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
0answers
18 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. ...