motiv-stone

Übersicht: Python & Blender


Objectives

a

What can be modeled? The most common motif are landscapes with the following objects that we want to create in some cases:

  • Clouds
  • Stones
  • Trees
  • Gras
  • Water
  • Mountains/Landscape

Instructions

Tasks:
  1. Copy the script from the cloud generator (last station).
  2. What must be changed? Which parameter and properties are changing?
  3. Distribute 10 stones on an area with dimensions of 20x20.

Clouds and stones

The pattern for the creation of stones corresponding to those of the clouds. Copy the script that adjustments thereafter, should be easy.

The Template

use-cases/art/low-poly/stone-skel.py (Source)

#!bpy
"""
Name: 'Stone-Generator'
Blender: 2.7x
Group: 'Low poly'
Tooltip: 'Part of a Low-Poly-Skripts collection'
"""
import bpy


class Stone():
    """Create a stone as low poly"""

    def __init__(self):
        pass

    def setColor(self):
        pass

    def new(self):
        """ constuction of a new stone """
        pass

    def remove(self):
        """ Delete a stone or all"""
        pass

if __name__ == "__main__":

    # switch to object mode, if nessasary
    if bpy.ops.object.mode_set.poll():
        bpy.ops.object.mode_set(mode='OBJECT')
    stone = Stone()

Properties of a Stone Object

This time should the Modifiere "Decimate" are used, because stones are often complemented by weathering.

The instructions are similar to those of the * * DISPLACE-Modifier for the clouds.

use-cases/art/low-poly/stone.py (Source)

        bpy.ops.object.modifier_add(type='DECIMATE')
        obj.modifiers["Decimate"].ratio = random.uniform(.1, .2)

One Example:

/use-cases/art/low-poly/stones-big.png

Comments