Skip to content

Instantly share code, notes, and snippets.

@cloutsocks
Created December 11, 2018 14:50
Show Gist options
  • Save cloutsocks/eba25c9e451a0e798abc0902bc3aae06 to your computer and use it in GitHub Desktop.
Save cloutsocks/eba25c9e451a0e798abc0902bc3aae06 to your computer and use it in GitHub Desktop.
import bpy
# Mark Active Layers
actives = ["buildings", "floor"]
for l in bpy.data.scenes["Scene"].render.layers:
# Disable all Layers
l.use = False
# Denoising Options
l.cycles.denoising_feature_strength = 0.2
l.cycles.denoising_strength = 0.2
for name in actives:
bpy.data.scenes["Scene"].render.layers[name].use = True
# Set samples and light bounces
bpy.data.scenes["Scene"].cycles.samples = 3000
bpy.data.scenes["Scene"].cycles.max_bounces = 12
bpy.ops.wm.save_mainfile()
print("Updated. Activer layers set to: {}. Samples set to: {}".format(", ".join(actives), bpy.data.scenes["Scene"].cycles.samples))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment