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.
But in procedural modeling we would like to have more control! And would like to see something like this:
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)
3 Comments
Emmm... Maybe better to post it on Blender Devtalk
devtalk.blender.org/t/performance-of-bmesh-operators-with-multiple-input-values/10909
IIIFGIII Thanks, I will try.)