OSDN Git Service

fix refactoring
[meshio/pymeshio.git] / examples / mqobuilder.py
index b0dcd88..abfc9c5 100644 (file)
@@ -10,16 +10,15 @@ import opengl.vertexarraymap
 \r
 \r
 def build(path):\r
-    # load scenee\r
     t=time.time()\r
-    io=pymeshio.mqo.IO()\r
-    if not io.read(path):\r
+    model=pymeshio.mqo.reader.read_from_file(path)\r
+    if not model:\r
         return\r
     print(time.time()-t, "sec")\r
     # build\r
     basedir=os.path.dirname(path)\r
     vertexArrayMap=opengl.vertexarraymap.VertexArrayMapWithUV()\r
-    for m in io.materials:\r
+    for m in model.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
@@ -27,7 +26,7 @@ def build(path):
             material.texture=opengl.texture.Texture(texturepath)\r
         vertexArrayMap.addMaterial(material)\r
 \r
-    for o in io.objects:\r
+    for o in model.objects:\r
         # skip mikoto objects\r
         if o.name.startswith("anchor"):\r
             continue\r