Script to have object or group not affected by Dof?

Hey All,

I’m wondering how possible it is to write a script to have an object (or group) not affected by the Depth of Field of the scene camera. I’ve accomplished this effect in the past by splitting my project into scenes and rendering different scenes with different levels of Dof. But, I do know that there is a toggle within Blender which allows you to turn off an objects motion blur (even with the scenes motion blur still enabled). So I was thinking that something similar may be possible as an object (or group) pertains to Dof.

I don’t know much about scripting and would be for any advice from the community.

Thank you very much,
Matthew

I´m a noob in python codeing, so- may you try object Id´s and renderlayers in the compositor and than you go - But i think you can code something around with the object ID too.

Happy Blending

greets Patrick