Make Mesh intersection material transparent

Once again I turn to the forum in hope of getting help.
My idea is:
I have several objects, and a separate object (for example a Cone). I want the objects to become half transparent on the place where the cone intersects them.
Basically the cone should be like a tool for insight into the object depths.
The cone itself should be invisible.
I am looking for either a material, or preferably a script way to implement this, since it should be usable in an add on.
My idea was to determine the intersection surfaces ob the objects and lower the material’s alpha in the script. However I have no idea how to do that.
I would appreciate if anyone knows a way! Thank you!

Greetings, Aschenstern

I’d do it with booleans…
Duplicate your objects, and give them an transparent material.
Use a boolean modifier with the original objects, set to “difference”; And for the copies, also a boolean modifier set to “intersect”.
Creating a python script for doing this should be fairly easy.


Thank you so much! It worked!!