Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
8 views

How to create Modal Operator that extrudes, moves and rotates selected in Edit Mode?

I'm trying to learn about modal operators in blender. I'm a complete novice and I'm struggling with the idea of how to correctly map the mouse movement onto the bmesh operators. I'm essentially ...
0
votes
0answers
9 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 ...
0
votes
1answer
37 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 ...
3
votes
0answers
18 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 ...
2
votes
0answers
28 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 ...
0
votes
0answers
17 views

Are BMesh MeshLoops an only/preferred way to iterate over mesh triangle polygons?

I'm writing a simple script that has to iterate over triangular faces of mesh (not n-gon polygons). I need to access theire data (vertices, edges, material indexes) Basically I'm doing it like this: ...
0
votes
0answers
41 views

Bmesh equivalent to `foreach_get` and `foreach_set` for use with Numpy?

On a regular object I can use foreach_get to efficiently copy data into Numpy arrays and use numpy ufuncs instead of looping through the contents of the bmesh. ...
1
vote
1answer
46 views

Using python and bmesh to scale/resize a face in place

I'm playing around with bmesh and have run into something I can't figure out how to do and can't find any related documentation on. I have extruded a face directly outward (after subdividing a ...
1
vote
2answers
24 views

How to remove dead BMVerts from a list?

I am trying to fix a bug in my script that happens in rare instances. I believe the bug occurs due to the very last thing the script is doing, which is: ...
0
votes
2answers
33 views

How to determine whether my bm.select_history.active is a BMVert, BMFace or a BMEdge?

I am trying to write a conditional statement for my script. If the user has one Active Edge Selected, then the script will run. Otherwise it won't. I know that if I have an active edge, then bm....
0
votes
0answers
60 views

How to work with Bmesh correctly?

I'm writing a window generator script. Here is a current version of my script: https://gist.github.com/romanvolodin/3bfd349795443118a2298819349a0b3c Windows config: https://gist.github.com/...
0
votes
1answer
21 views

bmesh.ops.scale how to scale vert selection relative to active edge, but not along the edge vector?

I am looking into vectors and matrices but don't yet understand how I could achieve one of my goals for a script I'm making. I want to use bmesh.ops.scale() and scale selected verts relative to my ...
0
votes
0answers
29 views

Modify skin radius using bmesh

this might be a very basic question. I am trying to modify the skin radius using a bmesh command. The index of the vertex is known. I just wonder what the bmesh command is to access the skin radius ...
1
vote
2answers
123 views

Python: Bisect mesh into n parts, without separate 'LOOSE'

Using Python I want to split a mesh into tiles. All the solutions to this question rely on bpy.ops.mesh.separate(type='LOOSE'). But this leads to problems in the ...
0
votes
1answer
27 views

Types of Edges In a Triangulated Mesh

I added the triangulate modifier on a mesh and then applied it. For this mesh in edit mode, I see two types of edges, thick bright ones from the original mesh and thin black ones, newly created by the ...
0
votes
0answers
38 views

List of contiguous faces of bmesh

Is there a way to get the list of the connected faces of the bmesh in their connection order? In other words, if I start from any random face within a continuous bmesh I should get the list of all the ...
0
votes
0answers
29 views

Imitate the F hotkey in python (create face from vertices)

I have a bunch of vertices that i want to connect as a face in python. I managed to do it using the F key in GUI mode, achieving this result: I tried doing the same thing in python using this line of ...
0
votes
1answer
28 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
61 views

How to add vertices into specific vertex roups

I have an xml file which contains a list of objects in space ("sectors") each sector has a list of more objects ("seats") which can be the same model or not. For each "sector" I create an object and ...
0
votes
0answers
34 views

bmesh.ops.extrude_face_region leaves a face behind, why?

I am running blender 2.79, this has burned a lot of my time today trying to figure this out. I have a couple function calls ...
1
vote
1answer
43 views

Convert a mathutils.Vector object into 3D coordinates

I've been working with both Python and Blender for the first time over the past few days and keep running into these mathutils Vector objects which I have no idea what to do with. I can't figure out a ...
2
votes
1answer
40 views

Adding multiple shape keys with python and bmesh while creating a mesh

I'm using a python script to generate mesh geometry and to add multiple shape keys in Blender using bmesh. The goal is to have 10 shape keys and each generated vertex is modified by just one of those ...
0
votes
0answers
72 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 ...
1
vote
1answer
148 views

Extrude in python

As in title, I'm trying to extrude mesh via python as I have ~1.5k objects to extrude and when I do it in editor it works perfectly but when I run it via python it always go wrong. It just move face ...
2
votes
1answer
46 views

Is it possible to deselect element but keep it active?

In this question I found out uses for being able to deselect the active object. You can basically use the active-but-unselected object as a transform pivot point for the rest of the object selection ...
2
votes
0answers
198 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 ...
3
votes
1answer
89 views

How to find a mesh loops and rings

I'm trying to find a clear, safe, simple explanation to the ring and loop madness. I select an edge: Then I run this script: ...
0
votes
0answers
271 views

Find boundary coordinates of a set of mesh points

I have a set of bmesh verts created like: import bmesh # ... bm = bmesh.new() # ... bm.verts.new(...) I intend to have all ...
0
votes
0answers
59 views

Find mesh verts relative to a base point

I have the following verts on a bmesh: The verts are created like this: ...
0
votes
1answer
186 views

Boolean creates a hollow object

I am trying to carve out some wear lines on a bullet, from where the barrel of a gun would cut into the metal. I am using a boolean modifier on the bullet, set to difference. It cuts into the object ...
1
vote
1answer
152 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
18 views

Python plugin - Identify faces properly

This is a follow up from this question: Will vertex indices change? In that thread is was established that the index of a vertex is not a reliable identifier. Then in the comments this question was ...
0
votes
1answer
41 views

use python to randomly inset each face, bmesh?

I would like to create some interesting shapes with a script. I'm still pretty new to python and I'm having trouble understanding how to get BMesh to behave the way I want. Here is what I'm trying to ...
2
votes
0answers
15 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: ...
4
votes
1answer
126 views

Is there a way to clear sharp edges using bmesh in python?

I'm trying to speed up an addon that had to toggle into Edit Mode for sometimes thousands of object by staying at the object level using bmesh instead of ...
0
votes
0answers
74 views

bmesh.ops.bisect_edges interferes with my list of verts

I am trying to subdivide a face, using bmesh.ops.bisect_edges, followed by bmesh.ops.connect_verts. I collect a list of vertices, before subdividing further, but after I use bmesh.ops.bisect_edges ...
1
vote
0answers
35 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 ...
0
votes
0answers
34 views

How to select geometry below a bmesh bisect line using python?

I'm not overly experienced in python and could use some help. I've been looking for this answer and tried many things for several hours. I'd like to make a little clipping tool using bmesh.ops....
0
votes
0answers
19 views

Bmesh equivalent of detail_flood_fill

I love the sculpt tools "detail_flood_fill" and "simplify_brush" as a way to evenly distribute triangles at a particular resolution. This helps me with some metaball based modelling, giving me a ...
1
vote
0answers
35 views

bpy.ops.bridge_edge_loops() vs bmesh.ops.bridge_loops()

Why is the bmesh bridge tool so limited? There's no argument to control segments(number_cuts) and no argument to control interpolation. Am I missing something? I was under the impression the bpy ...
1
vote
1answer
90 views

How do you select an edge loop with BMesh?

Can someone please explain to me how I go about selecting edge loops in BMesh? I'm new to Blender scripting and am venturing into BMesh but I can not figure out how to actual select an edge loop. Let'...
4
votes
2answers
927 views

How is possible to create a tetrakaidecahedron? How can I 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
0
votes
1answer
225 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 ...
1
vote
1answer
28 views

Scripting: separating selection results in edgeless mesh

Whenever I use a script to separate a mesh by means of a selection the separated mesh contains no edges (only vertices). In contrast, separated meshes always contain edges when either manually ...
0
votes
1answer
188 views

How to use “bmesh.ops.subdivide_edges” on selected edges

I need to cut an edge into equal parts via script. Using the standart subdivide is out of question because i will need more then 100 cuts (und using subdivide several times to achieve this is not ...
0
votes
0answers
35 views

bpy.ops.transform.resize different when manually scaling and scaling with code

I'm trying to scale vertex groups using bpy.ops.transform.resize to make the vertex group a certain measurement. However, I've found that my code results in an incorrect output when compared to ...
0
votes
0answers
24 views

Why is my bmesh script not moving the vertices?

I am learning bmesh. The example given in the doc works well. But my code below does not. It returns no errors and the Cube object does not move. Any advice greatly appreciated! ...
1
vote
1answer
149 views

Can you extrude a mesh like a 'stroke'?

In a 2D app like Photoshop or GIMP, you can add a stroke to an object, and an outline is created for it that's of even distance around the shape. I want to do this for an irregular mesh in Blender. ...
0
votes
0answers
39 views

bmesh from_mesh doesn't work after undo

I have a modal script whereby I am letting the user create a mesh click by click. Each click creates a vert and, if appropriate, an edge joining that vert to the last vert. I would like the user to ...
0
votes
1answer
525 views

How to create edges in existing mesh based on a list of vertex indices with Python

I parse 2 csvs, one with vertex coordinates id,x,y,z,r,g,b 0,0.30778491,0.12740749,0.04903458,174.0,84.0,118.0 1,0.3315943,0.0922608,0.08094925,174.0,84.0,118.0 ...