Skip to content

Instantly share code, notes, and snippets.

@eliheuer
Last active May 29, 2017 16:27
Show Gist options
  • Save eliheuer/58f2b2e8239855f701ba37bb497d3da0 to your computer and use it in GitHub Desktop.
Save eliheuer/58f2b2e8239855f701ba37bb497d3da0 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 = 0
scene.objects.link(obj)
mball.resolution = 0.2 # View resolution
mball.render_resolution = 0.02
for i in range(60):
coordinate = (math.cos(step*124),
math.sin(step*step),
step)
step += 1
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