This Script I wrote for remeshing purposes does not work properly. Sometimes it works. Sometimes it produces many (as many as frames) duplicates of the active Object.
import bpy frame_end = bpy.context.scene.frame_end sel_Objects = bpy.context.selected_objects cuts =  if(len(sel_Objects) == 2): for i in range(frame_end): bpy.context.scene.frame_set(i) bpy.ops.object.select_all(action='DESELECT') sel_Objects.select = True sel_Objects.select = True bpy.context.scene.objects.active = sel_Objects bpy.ops.object.duplicate() bpy.ops.object.join() to_delete = bpy.context.scene.objects.active bpy.ops.object.editmode_toggle() bpy.ops.mesh.intersect(mode='SELECT', use_separate=True) bpy.ops.mesh.separate() bpy.ops.object.editmode_toggle() bpy.context.scene.objects.unlink(to_delete) bpy.data.objects.remove(to_delete) cuts.extend(bpy.context.selected_objects) bpy.ops.object.select_all(action='DESELECT') for cut in cuts: cut.select = True bpy.context.scene.objects.active = cuts bpy.ops.object.join()
The script should performe the following actions:
Before you have two animated Objects intersecting each other while the animation.
After running the script you should still have the two animated Objects but also the intersections of the two objects merged into one mesh.
But this is how it looks like:
The problem @this point is that the script doesn't clear several duplicates of , in this case the torus.