found a working blender plot script

--HG--
rename : bin/plot.py => tools/blender/plot.py
This commit is contained in:
Stephen McQuay 2011-03-28 11:48:17 -06:00
parent ccc08454e2
commit 97ed85eda7
2 changed files with 9 additions and 20 deletions

View File

@ -1,15 +0,0 @@
from interp import config
import sys
sys.path.append(config['pypath'])
import bpy
import pickle
points = pickle.load(open('/tmp/points.p', 'r'))
faces = pickle.load(open('/tmp/cells.p', 'r'))
# faces = [faces[i] for i in faces]
me = bpy.data.meshes.new('points')
me.verts.extend(points)
me.faces.extend(faces)
scn = bpy.data.scenes.active
ob = scn.objects.new(me, 'points_obj')

View File

@ -1,11 +1,15 @@
import pickle from interp import config
import sys
sys.path.append(config['pypath'])
from Blender import *
import bpy import bpy
p = pickle.load(open('/tmp/grid_driver.p', 'r')) import pickle
points = pickle.load(open('/tmp/points.p', 'r'))
faces = pickle.load(open('/tmp/cells.p', 'r'))
# faces = [faces[i] for i in faces]
me = bpy.data.meshes.new('points') me = bpy.data.meshes.new('points')
me.verts.extend([[v[0], v[1], 0] for v in p.points]) me.verts.extend(points)
me.faces.extend([i.verts for i in p.faces.itervalues()]) me.faces.extend(faces)
scn = bpy.data.scenes.active scn = bpy.data.scenes.active
ob = scn.objects.new(me, 'points_obj') ob = scn.objects.new(me, 'points_obj')