| CameraPane.java | ●●●●● patch | view | raw | blame | history | |
| GrafreeD.java | ●●●●● patch | view | raw | blame | history | |
| GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
| Mocap.java | ●●●●● patch | view | raw | blame | history | |
| Object3D.java | ●●●●● patch | view | raw | blame | history | |
| cFileSystemPane.java | ●●●●● patch | view | raw | blame | history | 
CameraPane.java
.. .. @@ -8075,12 +8075,16 @@ 8075 8075 { 8076 8076 String texname = tex; 8077 8077 8078  - String[] split = tex.split("Textures");8079  - if (split.length > 1)8080  - texname = "/Users/nbriere/Textures" + split[split.length-1];8081  - else8082  - if (!texname.startsWith("/"))8083  - texname = "/Users/nbriere/Textures/" + texname;8078  +// String[] split = tex.split("Textures");8079  +// if (split.length > 1)8080  +// texname = "/Users/nbriere/Textures" + split[split.length-1];8081  +// else8082  +// if (!texname.startsWith("/"))8083  +// texname = "/Users/nbriere/Textures/" + texname;8084  + if (!new File(tex).exists())8085  + {8086  + texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname;8087  + }8084 8088 8085 8089 if (CACHETEXTURE) 8086 8090 texture = textures.get(texname); // TEXTURE CACHE GrafreeD.java
.. .. @@ -612,7 +612,7 @@ 612 612 613 613 System.out.println("jarfile0 = " + jarfile); 614 614 615  - String jarpath = u.toString().split("file:")[1].split("GrafreeD.jar")[0];615  + String jarpath = u.toString().split("file:")[1].split("Grafreed.jar")[0];616 616 617 617 System.out.println("jarpath0 = " + jarpath); 618 618 .. .. @@ -845,7 +845,7 @@ 845 845 standAlone = true; 846 846 grafreeD = new GrafreeD(); 847 847 grafreeD.universe = new Composite(); 848  - grafreeD.universe.name = "Scene";848  + grafreeD.universe.name = "Grafreed";849 849 grafreeD.universe.material = new cMaterial(); 850 850 // theApplet3D.universe.textures = CameraPane.DEFAULT_TEXTURE; 851 851  GroupEditor.java
.. .. @@ -940,7 +940,9 @@ 940 940 // objEditor.DropFile((java.io.File[]) object, true); 941 941 // return; 942 942 // } 943  - if (string.charAt(0) == '/')943  +944  + // File path for Mac and Windows945  + if (string.charAt(0) == '/' || string.charAt(1) == ':')944 946 { 945 947 // file(s) 946 948 String[] names = string.split("\n"); Mocap.java
.. .. @@ -3299,23 +3299,40 @@ 3299 3299 // SetPositionDelta(false, true, false); // ?? false); 3300 3300 { 3301 3301 if (support == null) 3302  - ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);3302  + {3303  + if (new File(fullname).exists())3304  + ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);3305  + else3306  + {3307  + SetGlobalTransform();3308  + Rewind();3309  + Fade();3310  + }3311  + }3303 3312 else 3304 3313 { 3305  - try3306  - {3314  +// try3315  +// {3307 3316 bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh; 3308 3317 3309 3318 // SetPositionDelta(false, true, true, true); 3310 3319 LoadData(); 3311 3320 Rewind(); 3312 3321 Fade(); 3313  - }3314  - catch (Exception e)3315  - {3316  - e.printStackTrace();3317  - ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);3318  - }3322  +// }3323  +// catch (Exception e)3324  +// {3325  +// System.err.println("An error occured while loading data. Use fallback by loading the file.");3326  +// //e.printStackTrace();3327  +// try3328  +// {3329  +// ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);3330  +// }3331  +// catch (Exception e2)3332  +// {3333  +// System.err.println("Motion file not found: " + fullname);3334  +// }3335  +// }3319 3336 } 3320 3337 } 3321 3338  Object3D.java
.. .. @@ -5159,10 +5159,34 @@ 5159 5159 5160 5160 // System.out.println("Fullname = " + fullname); 5161 5161 5162  - if (fullname.name.indexOf(":") == -1)5163  - return fullname.name;5162  + // Does not work on Windows due to C:5163  +// if (fullname.name.indexOf(":") == -1)5164  +// return fullname.name;5165  +//5166  +// return fullname.name.substring(0,fullname.name.indexOf(":"));5164 5167 5165  - return fullname.name.substring(0,fullname.name.indexOf(":"));5168  + String[] split = fullname.name.split(":");5169  +5170  + if (split.length == 0)5171  + {5172  + return "";5173  + }5174  +5175  + if (split.length <= 2)5176  + {5177  + if (fullname.name.endsWith(":"))5178  + {5179  + // Windows5180  + return fullname.name.substring(0, fullname.name.length()-1);5181  + }5182  +5183  + return split[0];5184  + }5185  +5186  + // Windows5187  + assert(split.length == 4);5188  +5189  + return split[0] + ":" + split[1];5166 5190 } 5167 5191 5168 5192 static String GetBump(cTexture fullname) .. .. @@ -5171,10 +5195,38 @@ 5171 5195 return ""; 5172 5196 5173 5197 // System.out.println("Fullname = " + fullname); 5174  - if (fullname.name.indexOf(":") == -1)5175  - return "";5176  -5177  - return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());5198  + // Does not work on Windows due to C:5199  +// if (fullname.name.indexOf(":") == -1)5200  +// return "";5201  +//5202  +// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());5203  + String[] split = fullname.name.split(":");5204  +5205  + if (split.length == 0)5206  + {5207  + return "";5208  + }5209  +5210  + if (split.length == 1)5211  + {5212  + return "";5213  + }5214  +5215  + if (split.length == 2)5216  + {5217  + if (fullname.name.endsWith(":"))5218  + {5219  + // Windows5220  + return "";5221  + }5222  +5223  + return split[1];5224  + }5225  +5226  + // Windows5227  + assert(split.length == 4);5228  +5229  + return split[2] + ":" + split[3];5178 5230 } 5179 5231 5180 5232 String GetPigmentTexture() .. .. @@ -5248,7 +5300,7 @@ 5248 5300 System.out.print("; textures = " + textures); 5249 5301 System.out.println("; usedtextures = " + usedtextures); 5250 5302 5251  - if (GetTextures() == null)5303  + if (GetTextures() == null) // What is that??5252 5304 GetTextures().name = ":"; 5253 5305 5254 5306 String texname = tex; cFileSystemPane.java
.. .. @@ -136,7 +136,7 @@ 136 136 137 137 jTree.setModel(new cFileSystemModel( 138 138 //java.io.File.listRoots()[1]) 139  - javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory(),139  + javax.swing.filechooser.FileSystemView.getFileSystemView().getHomeDirectory(),140 140 filter 141 141 )); 142 142 }