Skip to main content

Python wrapper for Blender noise functions

Project description

Image

Description

PyPI - Version PyPI - Python Version PyPI - Status PyPI - Downloads PyPI - License Gitea Issues Gitea Last Commit

blendnoise is a Python wrapper for C-translated Blender noise functions described at BLI_noise module. It is distributed under the same conditions as Blender source code.

WARNING: The maintainer of this package is not connected in any way with Blender authors and/or developers.

Installation

From PyPI

python3 -m pip install blendnoise

From sources

python3 -m pip install build
git clone https://codeberg.org/screwery/blendnoise
cd blendnoise
python3 -m build
python3 -m pip install dist/*

You may need to install C compiler or that stuff.

Usage

I’m not much of a Python C-extension coder, so all functions are C-styled and embarrasingly straightforward.

More info about those functions and arguments you can find at official Blender docs or from Blender sources itself.

Also, you may find useful a fair Matplotlib visualization script.

import blendnoise

# use those ints for noisebasis
NOISEBASIS = {
    'OriginalPerlin': 1,
    'NewPerlin': 2,
    'VoronoiF1': 3,
    'VoronoiF2': 4,
    'VoronoiF3': 5,
    'VoronoiF4': 6,
    'VoronoiF1F2': 7,
    'VoronoiCracked': 8,
    'Cell': 14,
    'Blender': 0
    }

# Generic noise: just noisebasis, nothing more
blendnoise.noise (noisesize: float, x: float, y: float, z: float, hard: bool,
                  noisebasis: int)

# Generic turbulence
blendnoise.turbulence (noisesize: float, x: float, y: float, z: float,
                       oct: int, hard: bool, noisebasis: int)

# Fractal Brownian Movement (FBM)
blendnoise.fbm (x: float, y: float, z: float, H: float, lacunarity: float,
                octaves: float, noisebasis: int)

# Multi Fractal
blendnoise.multi_fractal (x: float, y: float, z: float, H: float,
                          lacunarity: float, octaves: float, noisebasis: int)

# Heterogeneous Terrain
blendnoise.hetero_terrain (x: float, y: float, z: float, H: float,
                           lacunarity: float, octaves: float, offset: float,
                           noisebasis: int)

# Hybrid Multi Fractal
blendnoise.hybrid_multi_fractal (x: float, y: float, z: float, H: float,
                                 lacunarity: float, octaves: float,
                                 offset: float, gain: float, noisebasis: int)

# Ridged Multi Fractal
blendnoise.ridged_multi_fractal (x: float, y: float, z: float, H: float,
                                 lacunarity: float, octaves: float, offset:
                                 float, gain: float, noisebasis: int)

# Variable Lacunarity: combined noise bases
blendnoise.variable_lacunarity (x: float, y: float, z: float, distortion: float,
                                noisebasis1: int, noisebasis2: int)

# Magic Texture (Blender shader texture)
blendnoise.magic_texture (x: float, y: float, z: float, scale: float,
                          distortion: float, depth: float)

Bugs

Feel free to report bugs and request features here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blendnoise-1.0.2.tar.gz (26.0 kB view details)

Uploaded Source

File details

Details for the file blendnoise-1.0.2.tar.gz.

File metadata

  • Download URL: blendnoise-1.0.2.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for blendnoise-1.0.2.tar.gz
Algorithm Hash digest
SHA256 041aad97786a547dc0f96b50b528d7be4b3379e394450a55e29155e2937e90e0
MD5 4d0538116841d4c5bc943a834e188203
BLAKE2b-256 64095080c39ffe6e03e090589f42e3d1acd04f10b4e723746186b2dcd9070e86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page