Change properties for multible Objects


Im trying to write a little script wich changes the ray visibility property of all objects I seleted. Im new in this area of Blender and I dont know much of scripting with Phyton, but I`ll be pleased about learning how it works.

This is the code I want to run, but nothing happens:

import bpy

def main(context):
    for obj in context.selected_objects: = false

Thank you

try this

import bpy
for obj in bpy.context.selected_objects: = False

Yes it works! Thank you :smiley:

you only defined the function main, but there is no call to it.

either make this an operator (see the templates) or do it like this:

import bpy

for ob in bpy.context.selected_objects: = False