Normand Briere
2019-05-05 481df91095a82824d2a98d4db860b3caadbda70a
Object3D.java
....@@ -2300,6 +2300,7 @@
23002300 {
23012301 if (newWindow)
23022302 {
2303
+ new Exception().printStackTrace();
23032304 System.exit(0);
23042305 if (parent != null)
23052306 {
....@@ -2476,13 +2477,13 @@
24762477 return retval;
24772478 }
24782479
2479
- void doEditDrag(ClickInfo info)
2480
+ void doEditDrag(ClickInfo info, boolean opposite)
24802481 {
24812482 switch (doSomething)
24822483 {
24832484 case 1: // '\001'
24842485 //super.
2485
- doEditDrag0(info);
2486
+ doEditDrag0(info, opposite);
24862487 break;
24872488
24882489 case 2: // '\002'
....@@ -2495,11 +2496,11 @@
24952496 {
24962497 //sel.hitSomething = childToDrag.hitSomething;
24972498 //childToDrag.doEditDrag(info);
2498
- sel.doEditDrag(info);
2499
+ sel.doEditDrag(info, opposite);
24992500 } else
25002501 {
25012502 //super.
2502
- doEditDrag0(info);
2503
+ doEditDrag0(info, opposite);
25032504 }
25042505 }
25052506 break;
....@@ -5158,10 +5159,34 @@
51585159
51595160 // System.out.println("Fullname = " + fullname);
51605161
5161
- if (fullname.name.indexOf(":") == -1)
5162
- 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(":"));
51635167
5164
- 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
+ // Windows
5180
+ return fullname.name.substring(0, fullname.name.length()-1);
5181
+ }
5182
+
5183
+ return split[0];
5184
+ }
5185
+
5186
+ // Windows
5187
+ assert(split.length == 4);
5188
+
5189
+ return split[0] + ":" + split[1];
51655190 }
51665191
51675192 static String GetBump(cTexture fullname)
....@@ -5170,10 +5195,38 @@
51705195 return "";
51715196
51725197 // System.out.println("Fullname = " + fullname);
5173
- if (fullname.name.indexOf(":") == -1)
5174
- return "";
5175
-
5176
- 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
+ // Windows
5220
+ return "";
5221
+ }
5222
+
5223
+ return split[1];
5224
+ }
5225
+
5226
+ // Windows
5227
+ assert(split.length == 4);
5228
+
5229
+ return split[2] + ":" + split[3];
51775230 }
51785231
51795232 String GetPigmentTexture()
....@@ -5247,7 +5300,7 @@
52475300 System.out.print("; textures = " + textures);
52485301 System.out.println("; usedtextures = " + usedtextures);
52495302
5250
- if (GetTextures() == null)
5303
+ if (GetTextures() == null) // What is that??
52515304 GetTextures().name = ":";
52525305
52535306 String texname = tex;
....@@ -6931,7 +6984,7 @@
69316984 }
69326985
69336986 //System.out.println("info.modifiers = " + info.modifiers);
6934
- modified = (info.modifiers & CameraPane.META) != 0;
6987
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
69356988 //System.out.println("modified = " + modified);
69366989 //new Exception().printStackTrace();
69376990 //viewCode = info.pane.renderCamera.viewCode;
....@@ -6959,7 +7012,7 @@
69597012 return true;
69607013 }
69617014
6962
- void doEditDrag0(ClickInfo info)
7015
+ void doEditDrag0(ClickInfo info, boolean opposite)
69637016 {
69647017 if (hitSomething == 0)
69657018 {
....@@ -6986,7 +7039,7 @@
69867039
69877040 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
69887041
6989
- if (modified)
7042
+ if (modified || opposite)
69907043 {
69917044 //assert(false);
69927045 /*
....@@ -7080,6 +7133,7 @@
70807133
70817134 if (modified)
70827135 {
7136
+ // Rotate 90 degrees
70837137 angle /= (Math.PI / 4);
70847138 angle = Math.floor(angle + 0.5);
70857139 angle *= (Math.PI / 4);
....@@ -7377,6 +7431,7 @@
73777431 objectUI.closeUI();
73787432 if (editWindow != null)
73797433 {
7434
+ editWindow.ctrlPanel.FlushUI();
73807435 editWindow.refreshContents();
73817436 } // ? new
73827437 objectUI = null;