So I'm trying to do a boolean operation between two objects. Here's how I'm trying to do it.
def engraveText(baseName, textName):
bpy.ops.object.select_all(action='DESELECT')
bpy.context.view_layer.objects.active = bpy.context.view_layer.objects[baseName]
bpy.data.objects[baseName].select_set(True)
obj = bpy.data.objects[baseName]
op = obj.modifiers.new(name="bool", type="BOOLEAN")
op.object = bpy.data.objects[textName]
op.operation = "DIFFERENCE"
bpy.ops.object.modifier_apply({"object": obj}, modifier=op.name, apply_as="DATA")
The error I'm getting is :
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2088, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2073, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/blender_server/src/server.py", line 76, in getEngravedModel
engraved_path = be.engraveNewModel(base_path, face_path, text)
File "/blender_server/src/blender_engraver.py", line 106, in engraveNewModel
engraveText(base_name, text_name)
File "/blender_server/src/blender_engraver.py", line 93, in engraveText
bpy.ops.object.modifier_apply({"object": obj}, modifier=op.name, apply_as="DATA")
File "/usr/lib/python3.7/2.83/scripts/modules/bpy/ops.py", line 199, in __call__
ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Error: Modifier is disabled, skipping apply
If I'm missing any info please let me know.
to_mesh
Hard to know, the error message suggests you are usingbpy
as a python module and running fromflask
. Can you run the code without applying the modifier and then take a peek in blender? $\endgroup$