def boolean_difference():
ActiveObj = bpy.context.active_object
if bpy.context.selected_objects[0] != bpy.context.active_object:
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="CT_SOLIDIFY")
BoolMod = ActiveObj.modifiers.new("CT_" + bpy.context.selected_objects[0].name, "BOOLEAN")
BoolMod.object = bpy.context.selected_objects[0]
BoolMod.operation = "DIFFERENCE"
BoolMod.solver = bpy.context.scene.CarverSolver
bpy.context.selected_objects[0].draw_type = 'WIRE'
else:
BoolMod = ActiveObj.modifiers.new("CT_" + bpy.context.selected_objects[1].name, "BOOLEAN")
BoolMod.object = bpy.context.selected_objects[1]
BoolMod.operation = "DIFFERENCE"
BoolMod.solver = bpy.context.scene.CarverSolver
bpy.context.selected_objects[1].draw_type = 'WIRE'
评论列表
文章目录