No worries, Brother! I’m here for you! So, I think I have the info I need, and it is really almost as simple as before. I will say that my understanding of Blender and Python gets me only so far, but a job like this seems too easy to mess up (famous last words, I know). So…
Since glossy ray visibility is an object-level property, we need to iterate over all the objects, test which ones are lights, and if we find a light, change the glossy ray visibility to
False. There will be three lines of Python code this time instead of two. These are the steps:
Enter your first line:
for object in D.objects:
and press enter. Youll get a new
... prompt where you’ll type:
if object.type == 'LIGHT':
and press enter. You’ll get another new
... prompt indented another 4 spaces where you’ll type:
object.visible_glossy = False
and press enter. Remember to press
Enter one more time to execute your code block.
This code reads as, “for each object in the collection of objects bpy.data (D is just a convenience variable so I don’t have to type bpy.data a whole bunch)…” Remember we have to work on the object-level, so we are using a different collection D.objects instead of D.lights. The next line reads, “if this object’s type is equal to ‘LIGHT’…” We want Python to do something only to certain objects, and that is why we use the
== test to test if the type of the object is, in fact, equal to ‘LIGHT’. It won’t change ray visibility on things that aren’t lights. Maybe there could be an issue if you have other lights in your scene you don’t want to change their glossy visibility, but I haven’t confirmed that yet. The final line reads, “Change the object’s glossy ray visibility property to
False.” Then we let the loop run until it has gone through all the objects in your scene.
This is how it looks small scale in the scene from before:
If you get it working and would be able to share a render, I’d like to see it! Let us know if you need any further assistance!