import time\r
import os\r
import pymeshio.mqo\r
-from opengl import material\r
-from opengl import vertexarraymap\r
+import opengl.material\r
+import opengl.texture\r
+import opengl.vertexarraymap\r
\r
\r
def build(path):\r
print(time.time()-t, "sec")\r
# build\r
basedir=os.path.dirname(path)\r
- vertexArrayMap=vertexarraymap.VertexArrayMapWithUV(\r
- [material.MQOMaterial.create(m, basedir) \r
- for m in io.materials])\r
+ vertexArrayMap=opengl.vertexarraymap.VertexArrayMapWithUV()\r
+ for m in io.materials:\r
+ material=opengl.material.MQOMaterial()\r
+ material.rgba=(m.color.r, m.color.g, m.color.b, m.color.a)\r
+ if m.tex:\r
+ texturepath=os.path.join(basedir, m.tex)\r
+ material.texture=opengl.texture.Texture(texturepath)\r
+ vertexArrayMap.addMaterial(material)\r
+\r
for o in io.objects:\r
# skip mikoto objects\r
if o.name.startswith("anchor"):\r