ryanwold.net

A civic-minded citizen seeking the singularity

Back to Entries

Scripting Blender

release
Date: 2019-01-22
Tags: 3d blender python

I've been playing with Blender lately. Playing in a 3d environment is mentally liberating, while dexterously challenging. Working a detached mouse + a 3d mouse can be cumbersome, but powerful once you get the hang of it.

Something that drew me to Blender was its scripting capabilities. Python is supported by the API and offers most of the functionality of the UI.

For example, generating objects in a Scene can be done via script, and Scenes can be rendered as images or animations.


Sample Blender Scripts

Render a Scene to .png

echo "alias blender=/Applications/Blender/blender.app/Contents/MacOS/blender" >> ~/.bash_profile

blender -b -P python-blender-test.py -f 60

blender -b opentecture.blend -x 1 -o //render -a

blender -b opentecture.blend -f 1

Send an http request via Python

import requests
import json

data = {"test" : 123}
data_json = json.dumps(data)
headers = {'Content-type': 'application/json'}
url = "http://localhost/api"
response = requests.post(url, data=data_json, headers=headers)

By Ryan Wold · © 2019–2026 Ryan Wold

Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.

Enjoyed this? — any BSV wallet, HandCash, or plain old dollars.

Leave a tip

Tips go directly to a Bitcoin SV address I control — peer to peer, no platform in between. A few thousand satoshis is a fraction of a cent; it's the gesture that counts.

From any BSV wallet

Scan the QR code with your wallet's camera, or copy the address.

177DwUfSTW8RkFBJzYYcgr1YB8ngbhTYAc

With HandCash or any paymail wallet

Paymail is an email-style address for Bitcoin wallets. Send any amount to afomi@handcash.io

First time using Bitcoin? Yours Wallet is an open-source browser extension wallet, and HandCash is an easy mobile wallet — either takes a minute to set up.

Prefer regular money? Support via OpenCollective.