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!