0
$\begingroup$

I want something so that when I hit Render, I get a certain noise pattern but then when I hit render a different time, without changing anything, I get a different one. Is there a time-based randomizer for the sample seed?

I'm using 2.8.

PS The clock button isn't useful for me because I want something where I can be on the same frame and get a different noise pattern

$\endgroup$

2 Answers 2

1
$\begingroup$

Let's put it into an add-on that one can install once and forget about it:

bl_info = {
    "name": "Random Render Seed",
    "author": "Martynas Ziemys",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "CyclesRenderSettings",
    "description": "Random Render seed EVERY TIME before rendering",
    "warning": " ",
    "wiki_url": " "
                "",
    "category": "Render",
}
import bpy, random
from bpy.app.handlers import persistent

@persistent
def RandomSeedHandler(scene):
    bpy.context.scene.cycles.seed = random.randint(10, 1000000000)

def register():
    bpy.app.handlers.render_pre.append(RandomSeedHandler)

def unregister():
    bpy.app.handlers.render_pre.remove(RandomSeedHandler)

if __name__ == "__main__":
    register()

If this is copied to a new text block and saved with .py extension it can be installed as an add-on.

$\endgroup$
0
$\begingroup$

Disclaimer: I can't code, but can copypaste snippets.

This script changes seed on every F12 render in 0-1000 range. Viewport update is laggy, so the number will change only on mouse hovering:

import bpy
from random import randint

def change_seed(scene):

    bpy.data.scenes["Scene"].cycles.seed = randint(0,1000)

bpy.app.handlers.render_pre.append(change_seed)
$\endgroup$
2
  • $\begingroup$ Why is it render_post? Would it not make it possible to reopen a file if it's not saved after render and render with the same seed? That is so annoying when you render to EXRs in order to combine them later and forget to change the seed... It should be render_pre so it randomizes the seed on every render. $\endgroup$ Commented Jun 10, 2019 at 11:13
  • $\begingroup$ @Martin Z, Didn't think that deep, but I'll edit. Thanks for precaution. $\endgroup$
    – Serge L
    Commented Jun 10, 2019 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .