← All ideas
  • Published 11 Dec 2019

Performance of bmesh operators.

Hi. I'm trying to utilize Blender features for procedural modeling in Sverchok. Bmesh data structure is great but existing operators, looks like, does not designed for procedural modeling.

For example bmesh.ops.inset_individual operator .

It works perfectly in this way.

bm = bmesh.new()
bm.from_mesh("My huge mesh")
bmesh.ops.inset_individual(bm, faces=bm_faces, thickness=my_value, **kwargs)

And result will look like this. image But in procedural modeling we would like to have more control! And would like to see something like this: image As you see I try to apply different values offset values for each face. In this case the code looks like this:

values = [random.random() for _ in bm.faces]
for face, value in zip(bm.faces, values):
.    bmesh.ops.inset_individual(bm, faces=[face], thickness=value, **kwasrgs)

But performance in such approach increases exponentially with linear increasing number of faces.

Actually I does not see reasons for such increasing. Probably when the operator is finishing its work it checks something what involves all elements of input mesh. Probably it would be possible to make a property for this checking in this way:

bmesh.ops.inset_individual(bm, faces=[face], thickness=value, **kwasrgs, post_process=False)

2019-12-11_16-48-48.png

100%

Development Status: Open

Upvote 3 Downvote 0
___sv
11 Dec 2019

3 Comments

IIIFGIII

Emmm... Maybe better to post it on Blender Devtalk

1
___sv Author

IIIFGIII Thanks, I will try.)