0
$\begingroup$

I got a lot of scripts that run... And 99% of the time is lost on one operation in one of my scripts :

def func_cut_boolean_modifier(obj,nameplate_size):
    active_obj=obj
    func_activate_object(active_obj)
    bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
    remover_element = "remover " + nameplate_size
    bpy.ops.object.modifier_add(type='BOOLEAN')
    bpy.context.object.modifiers["Boolean"].object = bpy.data.objects[remover_element]
    bpy.context.object.modifiers["Boolean"].solver = 'EXACT'
    bpy.ops.object.modifier_apply(modifier="Boolean")
    func_activate_object(active_obj)

The modifier_apply is eating all. It's a simple function on a boolean. How can solve that problem? Thanks for the help...

$\endgroup$
3
  • $\begingroup$ Yes, Boolean is slow. You can try changing the solver to 'FAST', or see if you can achieve the result without using boolean... It's hard to advice anything else without seeing what you use your boolean on. $\endgroup$ Commented Feb 18, 2022 at 18:56
  • $\begingroup$ I'm already using fast :( I use it to remove 2 symetrical parts with 2 cubes. I have a question. If I add more vertices to the cubes, will the boolean function work faster? for now they are simple cubes cutting complex and deformed shapes. $\endgroup$ Commented Feb 18, 2022 at 22:31
  • $\begingroup$ Your code says you're using 'EXACT'. If you're cutting with cubes, perhaps you can just write a script in Python that makes two plane cuts where the cubes would cut, removes all vertices in a given coordinate range, and then create faces from vertices laying on the planes that were used to cut. This should be much faster than boolean. A boolean will probably work slower if you have more vertices... $\endgroup$ Commented Feb 19, 2022 at 9:47

0

You must log in to answer this question.

Browse other questions tagged .