chr15m / blender-hylang-live-code

Live-coding Blender with Hy(lang)
72 stars 7 forks source link

How to get this working on OSX #6

Closed paines closed 9 years ago

paines commented 9 years ago

In order to get things working under Mac OSX , one has to setup some variables. It is assumed that Blender 2.74 was installed in ~/Applications, e.g. via brew. Open a terminal and set:

export PATH=~/Applications/blender.app/Contents/MacOS/
export BLENDER_SYSTEM_PYTHON=~/Applications/blender.app/Contents/Resources/2.74/python/
export BLENDER_SYSTEM_SCRIPTS=~/Applications/blender.app/Contents/Resources/2.74/scripts/
export BLENDER_USER_DATAFILES=~/Applications/blender.app/Contents/Resources/2.74/datafiles/

Maybe you will need pip, so do

sudo easy_install pip

check out blender-hylang-live-code, and first call

install-dependencies.sh

Once finished call

./blender-livecode.sh examples/cube.hy

Blender should start now with a cube. Alter the file example/cube.hy in your favorite editor to e.g:

(import bpy)
(import helpers)

(helpers.clear)
(import [random [randint]])

(for [x (range 25)]
  (apply bpy.ops.mesh.primitive_cube_add [] {"location" [(randint -10 10) (randint -10 10) (randint -10 10)]}))

and watch the changes as soon as you save your file.

chr15m commented 9 years ago

Great, thank you! I will add this to the README unless you want to do a pull-request?

paines commented 9 years ago

README should be fine. Thanks man!