tinks, model_viewer & action_nitro: print model loading errors and fix one
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 31 May 2017 13:08:01 +0000 (09:08 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sun, 4 Jun 2017 13:55:52 +0000 (09:55 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/action_nitro/src/action_nitro.nit
contrib/model_viewer/src/model_viewer.nit
contrib/tinks/assets/models/debris1.mtl
contrib/tinks/src/client/client3d.nit

index a181789..b8dd4f4 100644 (file)
@@ -140,6 +140,7 @@ redef class App
 
                # Load 3d models
                iss_model.load
+               if iss_model.errors.not_empty then print_error iss_model.errors.join("\n")
 
                # Setup cameras
                world_camera.reset_height 60.0
index 347b565..b93bea4 100644 (file)
@@ -67,8 +67,10 @@ redef class App
                world_camera.near = 0.1
                world_camera.far = 100.0
 
-               for model in models do model.load
-               for texture in asset_textures_by_name.values do texture.load
+               for model in models do
+                       model.load
+                       if model.errors.not_empty then print_error model.errors.join("\n")
+               end
 
                # Display the first model
                model = models[model_index]
index 174d51f..d8e32fc 100644 (file)
@@ -9,7 +9,7 @@ Ks 0.287480 0.287480 0.287480
 Ni 1.000000
 d 1.000000
 illum 2
-map_Kd textures/tread.jpg
+map_Kd textures/TTread.jpg
 
 newmtl Treads
 Ns 178.431373
index 01b2a25..b37fc69 100644 (file)
@@ -122,8 +122,15 @@ redef class App
                show_splash_screen logo
 
                # Load everything
-               for model in models do model.load
-               for texture in all_root_textures do texture.load
+               for texture in all_root_textures do
+                       texture.load
+                       var error = texture.error
+                       if error != null then print_error error
+               end
+               for model in models do
+                       model.load
+                       if model.errors.not_empty then print_error model.errors.join("\n")
+               end
 
                # Modify all textures so they have a higher ambient color
                for model in models do