Skip to content

Instantly share code, notes, and snippets.

@eliheuer
Last active May 29, 2017 16:26
Show Gist options
  • Save eliheuer/2b229290b2708e7897e79d1956e232b4 to your computer and use it in GitHub Desktop.
Save eliheuer/2b229290b2708e7897e79d1956e232b4 to your computer and use it in GitHub Desktop.
import bpy
import random
import math
scene = bpy.context.scene
# add metaball object
mball = bpy.data.metaballs.new("MetaBall")
obj = bpy.data.objects.new("MetaBallObject", mball)
step = 1.2
pull = 1.2
move = 0
scene.objects.link(obj)
mball.resolution = 0.2 # View resolution
mball.render_resolution = 0.02
for i in range(120):
coordinate = ((math.cos(step) + (math.sin(pull) * 8)),
(math.sin(step) + math.cos(pull)),
step)
step += 0.5
pull += 0.3
move += math.cos(step/2)
element = mball.elements.new()
element.co = coordinate
element.radius = 2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment