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
47 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 ...
1
vote
0answers
88 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
69 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
36 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
84 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
59 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
134 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
159 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
62 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
90 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
80 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
99 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
45 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
492 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 ...
1
vote
1answer
39 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
46 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
1answer
100 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
253 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 ...
1
vote
1answer
292 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
193 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 ...
1
vote
1answer
181 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
494 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
132 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
275 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 ...
4
votes
1answer
273 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
408 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
1answer
685 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
2answers
192 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
1answer
81 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
17 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
286 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
126 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
43 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
53 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
169 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
1k 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
433 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
39 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
334 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 ...
1
vote
1answer
244 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
1answer
979 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 ...
0
votes
1answer
361 views

trying to create a bmesh from csv coordinate list

Hello fellow Blender snakehandlers, I have a list of coordinates in a csv file and I would like to create a mesh with only vertices from it. When I run it, it throws the following error, which I can'...
0
votes
0answers
107 views

How to obtain sequence of selected UV in Python?

Sorry for continuous post from below post. This question is related to it. How to obtain selected UV pairs on same edge in Python? I want to obtain sequence of selected UV in Python. But I did not ...
1
vote
1answer
153 views

How to obtain selected UV pairs on same edge in Python?

I have a problem about Python scripting in Blender. I want to get selected UV pairs on same edge and write below code. ...
0
votes
0answers
60 views

How to hardcode mesh objects as python variable declarations

I am doing an addon, and I need to load constantly some premade objects to reproduce and edit it, I through that making the data directly avaliable from python would help to build fast bmesh variants. ...
1
vote
0answers
67 views

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

I followed this and ended up with a closed mesh. ...
1
vote
1answer
102 views

Can I permanently change some default settings like inset size, remove doubles threshold, new mesh size?

Ver. 2.79. I was hoping I could change some annoying settings by just editing some of the .PY files bundled with blender. Especially default inset amount. Maybe it's not that easy. But for example, I ...
1
vote
1answer
3k views

Create a UV Sphere / Object in Blender from Python

Referencing to this code: Create a Cube in Blender from Python ...
1
vote
0answers
210 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 ...
0
votes
2answers
1k views

BMesh: How to get a list of faces and edges, given the vectors (and delete them)?

I have a list of a centre vertice along with all its surrounding vertices. listOfVectors = [ vertice, neighbour1, neighbour2, neighbour3, ... ] I need to remove ...