Last active
May 29, 2017 16:26
-
-
Save eliheuer/2b229290b2708e7897e79d1956e232b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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