New Video! Randomize Properties in Blender

April 16, 2012

Update: New in Blender 2.64 — For randomizing material properties, the new Object Info node and its random number output could be an alternative to the driver technique described in this video.

This tutorial shows how to attach random number drivers to selected properties to make endless variations of an object in Blender 2.62.

Video Link >>>   Variations: Random Number Drivers in Blender

Go from this

a lego-like model in Blender

a lego-like model in Blender

to this

variations of lego-like blocks automatically generated

variations of lego-like blocks automatically generated

I found it easy to work with drivers on object and mesh properties. But I found it surprisingly difficult to get drivers to work on properties in material, texture, and node datablocks. This video will show you the secrets to coercing drivers to work anywhere:

  • learn multiple ways to create a driver; when one method fails, another will work
  • learn how to fix broken drivers after copying an object
  • workflow tips for managing many drivers, objects, and datablocks
This video is for the intermediate Blender user who already feels comfortable with the Blender UI, but no prior experience is expected with drivers or Python scripting. I’ll do my best to show you not just what buttons to click, but why.

 

Here is the copy-n-paste part referred to in the video:
import bpy
import random

# Random floating point number between lo and hi

def randf(lo, hi):
    return random.uniform(lo, hi)

# Random integer from lo (inclusive) to hi (inclusive)

def randi(lo, hi):
    return random.randint(lo, hi)

# Random values given mean and standard deviation

def gauss(mean, stdev):
    return random.gauss(mean, stdev)

bpy.app.driver_namespace["randf"] = randf
bpy.app.driver_namespace["randi"] = randi
bpy.app.driver_namespace["gauss"] = gauss

 

2 Comments to "New Video! Randomize Properties in Blender"

  1. Germano Cavalcante wrote:

    Hello David,
    great tutorials
    I wonder if there is some way to apply individual drivers for each particle in a field of grass.
    for example a drive “Render Resolution U” a function of distance between the camera and each particle (which is a Besier curve).
    thank you

  2. Mitch wrote:

    Thoroughly enjoyed your tutorial and managed to drive my material colours by sampling an image while listening, that outliner datablock trick is a great thing to know I had tried driving materials previously with no luck.
    Thanks so much.

Leave Your Comment

*
 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org