about summary refs log tree commit diff
path: root/src/python/view.py
diff options
context:
space:
mode:
authorhanemile <emile.hansmaennel@gmail.com>2018-01-16 15:59:01 +0100
committerhanemile <emile.hansmaennel@gmail.com>2018-01-16 15:59:01 +0100
commit50012de6c2fd3eae0aa04b7a2b4e497dc0bae27a (patch)
tree51c6ba3aa9cb2771c2d7aa0c9bbe54fa5b4d2ef7 /src/python/view.py
parente5d00b1b2e2e7c0684dae7324feb86c36188047b (diff)
updated the source files
Diffstat (limited to 'src/python/view.py')
-rw-r--r--src/python/view.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/python/view.py b/src/python/view.py
new file mode 100644
index 0000000..8b802b6
--- /dev/null
+++ b/src/python/view.py
@@ -0,0 +1,30 @@
+import bpy
+from numpy import genfromtxt
+import os
+import sys
+
+directory = "other_stars/"
+
+files = [sys.argv[4] + ".csv"]
+
+for data in files:
+    path = str(directory) + str(data)
+    print(path)
+
+    verts = genfromtxt(path, delimiter=' ', skip_header=0, usecols = (0, 1, 2))
+
+    #print(verts)
+
+    # create mesh and object
+    mesh = bpy.data.meshes.new(data)
+    object = bpy.data.objects.new(data,mesh)
+
+    # set mesh location
+    object.location = bpy.context.scene.cursor_location
+    bpy.context.scene.objects.link(object)
+
+    # create mesh from python data
+    mesh.from_pydata(verts,[],[])
+    mesh.update(calc_edges=True)
+
+    bpy.ops.object.select_all(action='SELECT')