model_viewer: force absolute path for models passed on the command line
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 25 Jun 2016 20:48:04 +0000 (16:48 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sun, 26 Jun 2016 12:03:54 +0000 (08:03 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/model_viewer/src/model_viewer.nit

index 0680059..64c5cba 100644 (file)
@@ -55,9 +55,10 @@ redef class App
                var logo = new Texture("splash.png")
                show_splash_screen logo
 
-                       if model_path.has_prefix("assets/") then model_path = model_path.substring_from(7)
                # Load all models passed as command line argument
                for arg in args.to_a.reversed do
+                       # Force an absolute path, this only works on desktop, but so does command args
+                       arg = getcwd / arg
 
                        var model = new Model(arg)
                        models.unshift model