CameraPane.java | ●●●●● patch | view | raw | blame | history | |
Globals.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
Mocap.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history | |
cRadio.java | ●●●●● patch | view | raw | blame | history |
CameraPane.java
.. .. @@ -11028,9 +11028,9 @@ 11028 11028 11029 11029 gl.glMatrixMode(GL.GL_MODELVIEW); 11030 11030 11031 -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);11032 -//gl.glEnable(gl.GL_POLYGON_SMOOTH);11033 -//gl.glEnable(gl.GL_MULTISAMPLE);11031 +gl.glEnable(gl.GL_POLYGON_SMOOTH);11032 +gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);11033 +gl.glEnable(gl.GL_MULTISAMPLE);11034 11034 } else 11035 11035 { 11036 11036 //gl.glDisable(GL.GL_TEXTURE_2D); .. .. @@ -11041,7 +11041,7 @@ 11041 11041 //System.out.println("BLENDING ON"); 11042 11042 gl.glEnable(GL.GL_BLEND); 11043 11043 gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); 11044 -11044 +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE);11045 11045 gl.glMatrixMode(gl.GL_PROJECTION); 11046 11046 gl.glLoadIdentity(); 11047 11047 .. .. @@ -14297,12 +14297,12 @@ 14297 14297 void GoDown(int mod) 14298 14298 { 14299 14299 MODIFIERS |= COMMAND; 14300 - /*14300 + /**/14301 14301 if((mod&SHIFT) == SHIFT) 14302 14302 manipCamera.RotatePosition(0, -speed); 14303 14303 else 14304 - manipCamera.BackForth(0, -speed*delta, getWidth());14305 - */14304 + manipCamera.BackForth(0, -speed*delta, 0); // getWidth());14305 + /**/14306 14306 if ((mod & SHIFT) == SHIFT) 14307 14307 { 14308 14308 mouseMode = mouseMode; // VR?? .. .. @@ -14318,12 +14318,12 @@ 14318 14318 void GoUp(int mod) 14319 14319 { 14320 14320 MODIFIERS |= COMMAND; 14321 - /*14321 + /**/14322 14322 if((mod&SHIFT) == SHIFT) 14323 14323 manipCamera.RotatePosition(0, speed); 14324 14324 else 14325 - manipCamera.BackForth(0, speed*delta, getWidth());14326 - */14325 + manipCamera.BackForth(0, speed*delta, 0); // getWidth());14326 + /**/14327 14327 if ((mod & SHIFT) == SHIFT) 14328 14328 { 14329 14329 mouseMode = mouseMode; .. .. @@ -14339,12 +14339,12 @@ 14339 14339 void GoLeft(int mod) 14340 14340 { 14341 14341 MODIFIERS |= COMMAND; 14342 - /*14342 + /**/14343 14343 if((mod&SHIFT) == SHIFT) 14344 - manipCamera.RotatePosition(speed, 0);14345 - else14346 14344 manipCamera.Translate(speed*delta, 0, getWidth()); 14347 - */14345 + else14346 + manipCamera.RotatePosition(speed, 0);14347 + /**/14348 14348 if ((mod & SHIFT) == SHIFT) 14349 14349 { 14350 14350 mouseMode = mouseMode; .. .. @@ -14360,12 +14360,12 @@ 14360 14360 void GoRight(int mod) 14361 14361 { 14362 14362 MODIFIERS |= COMMAND; 14363 - /*14363 + /**/14364 14364 if((mod&SHIFT) == SHIFT) 14365 - manipCamera.RotatePosition(-speed, 0);14366 - else14367 14365 manipCamera.Translate(-speed*delta, 0, getWidth()); 14368 - */14366 + else14367 + manipCamera.RotatePosition(-speed, 0);14368 + /**/14369 14369 if ((mod & SHIFT) == SHIFT) 14370 14370 { 14371 14371 mouseMode = mouseMode; .. .. @@ -14946,7 +14946,9 @@ 14946 14946 case 'E' : COMPACT ^= true; 14947 14947 repaint(); 14948 14948 break; 14949 - case 'W' : DEBUGHSB ^= true;14949 + case 'W' : // Wide Window (fullscreen)14950 + //DEBUGHSB ^= true;14951 + ObjEditor.theFrame.ToggleFullScreen();14950 14952 repaint(); 14951 14953 break; 14952 14954 case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; .. .. @@ -14972,13 +14974,7 @@ 14972 14974 repaint(); 14973 14975 break; 14974 14976 case 'l': 14975 - lightMode ^= true;14976 - Globals.lighttouched = true;14977 - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;14978 - targetLookAt.set(manipCamera.lookAt);14979 - repaint();14980 - break;14981 - case 'L':14977 + //case 'L':14982 14978 if (lightMode) 14983 14979 { 14984 14980 lightMode = false; .. .. @@ -15125,7 +15121,10 @@ 15125 15121 // kompactbit = 6; 15126 15122 // break; 15127 15123 case ' ': 15128 - ObjEditor.theFrame.ToggleFullScreen();15124 + lightMode ^= true;15125 + Globals.lighttouched = true;15126 + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;15127 + targetLookAt.set(manipCamera.lookAt);15129 15128 repaint(); 15130 15129 break; 15131 15130 //case '`' : Globals.java
.. .. @@ -10,7 +10,7 @@ 10 10 public static boolean COMPUTESHADOWWHENLIVE = true; 11 11 public static boolean RENDERSHADOW = true; 12 12 13 - public static boolean SAVEONMAKE = false; // problems when auto-save (works with manual save)13 + public static boolean SAVEONMAKE = true; // problems when auto-save (works with manual save)14 14 15 15 public static boolean MOUSEDRAGGED = false; 16 16 public static boolean TIMERRUNNING = false; GroupEditor.java
.. .. @@ -84,6 +84,10 @@ 84 84 85 85 void CloneSelection(boolean supports) 86 86 { 87 + if (Globals.SAVEONMAKE)88 + Save();89 + boolean keep = Globals.SAVEONMAKE;90 + Globals.SAVEONMAKE = false;87 91 // Object3D keep = GrafreeD.clipboard; 88 92 //Object3D obj; 89 93 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) .. .. @@ -94,6 +98,7 @@ 94 98 95 99 makeSomething(clone, i==group.selection.size()-1); 96 100 } 101 + Globals.SAVEONMAKE = keep;97 102 } 98 103 99 104 void CloneClipboard(boolean supports) .. .. @@ -380,14 +385,14 @@ 380 385 shadowYItem.addActionListener(this); 381 386 shadowZItem = menu.add(new MenuItem("Shadow Blue")); 382 387 shadowZItem.addActionListener(this); 388 + attributeItem = menu.add(new MenuItem("Attribute"));389 + attributeItem.addActionListener(this);383 390 384 391 if (Globals.ADVANCED) 385 392 { 386 393 menu.add("-"); 387 394 linkerItem = menu.add(new MenuItem("Linker")); 388 395 linkerItem.addActionListener(this); 389 - attributeItem = menu.add(new MenuItem("Attribute"));390 - attributeItem.addActionListener(this);391 396 templateItem = menu.add(new MenuItem("Template")); 392 397 templateItem.addActionListener(this); 393 398 pointflowItem = menu.add(new MenuItem("Point Flow")); .. .. @@ -971,7 +976,7 @@ 971 976 { 972 977 cRadio radioButton = new cRadio(obj.name); 973 978 974 - // Patch to avoid bug with transparency.979 + // June 2019. Patch to avoid bug with transparency.975 980 radioButton.hadMaterial = obj.material != null; 976 981 if (!radioButton.hadMaterial) 977 982 { .. .. @@ -1223,7 +1228,7 @@ 1223 1228 // return; 1224 1229 // } 1225 1230 1226 - String string = (String) object;1231 + String string = object.toString();1227 1232 1228 1233 // File path for Mac and Windows 1229 1234 if (string.charAt(0) == '/' || string.charAt(1) == ':') .. .. @@ -1488,6 +1493,8 @@ 1488 1493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); 1489 1494 reduce34MorphItem.addActionListener(this); 1490 1495 menu.add("-"); 1496 + menu.add(memoryItem = new MenuItem("Memory Usage"));1497 + memoryItem.addActionListener(this);1491 1498 menu.add(computeAOItem = new MenuItem("Compute AO")); 1492 1499 computeAOItem.addActionListener(this); 1493 1500 .. .. @@ -1496,8 +1503,6 @@ 1496 1503 mirrorItem = menu.add(new MenuItem("Mirror Poses")); 1497 1504 mirrorItem.addActionListener(this); 1498 1505 menu.add("-"); 1499 - menu.add(memoryItem = new MenuItem("Memory Usage"));1500 - memoryItem.addActionListener(this);1501 1506 menu.add(analyzeItem = new MenuItem("Analyze")); 1502 1507 analyzeItem.addActionListener(this); 1503 1508 menu.add(dumpItem = new MenuItem("Print")); .. .. @@ -4833,8 +4838,8 @@ 4833 4838 4834 4839 if (cut) 4835 4840 { 4836 - if (Globals.SAVEONMAKE)4837 - Save();4841 +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.4842 +// Save();4838 4843 //int indices[] = jList.getSelectedIndices(); 4839 4844 //for (int i = indices.length - 1; i >= 0; i--) 4840 4845 //jList.remove(indices[i]); .. .. @@ -4937,6 +4942,10 @@ 4937 4942 4938 4943 void paste(boolean expand) 4939 4944 { 4945 + if (Globals.SAVEONMAKE)4946 + Save();4947 + boolean keep = Globals.SAVEONMAKE;4948 + Globals.SAVEONMAKE = false;4940 4949 // if (GrafreeD.clipboard == null) 4941 4950 // return; 4942 4951 boolean first = true; .. .. @@ -4996,6 +5005,7 @@ 4996 5005 Grafreed.clipboard.get(0).parent = keepparent; 4997 5006 } 4998 5007 5008 + Globals.SAVEONMAKE = keep;4999 5009 ResetModel(); 5000 5010 refreshContents(); 5001 5011 } .. .. @@ -5131,6 +5141,10 @@ 5131 5141 5132 5142 void group(Object3D csg, boolean grab) 5133 5143 { 5144 + if (Globals.SAVEONMAKE)5145 + Save();5146 + boolean keep = Globals.SAVEONMAKE;5147 + Globals.SAVEONMAKE = false;5134 5148 if (//false) // why?? 5135 5149 !group.selection.isEmpty()) 5136 5150 { .. .. @@ -5244,10 +5258,15 @@ 5244 5258 //node.add(csg); 5245 5259 //makeSomething(node); 5246 5260 makeSomething(csg); 5261 + Globals.SAVEONMAKE = keep;5247 5262 } 5248 5263 5249 5264 void Ungroup(Object3D g) 5250 5265 { 5266 + if (Globals.SAVEONMAKE)5267 + Save();5268 + boolean keep = Globals.SAVEONMAKE;5269 + Globals.SAVEONMAKE = false;5251 5270 if (g instanceof HiddenObject) 5252 5271 { 5253 5272 HiddenObject h = (HiddenObject) g; .. .. @@ -5264,6 +5283,7 @@ 5264 5283 objEditor.makeSomething(g.get(i), false); 5265 5284 } 5266 5285 } 5286 + Globals.SAVEONMAKE = keep;5267 5287 } 5268 5288 5269 5289 void ungroup() Mocap.java
.. .. @@ -261,6 +261,8 @@ 261 261 262 262 // LA.matConcat(toParent, hip.get(0).toParent, toParent); 263 263 264 + CameraPane.CreateSelectedPoint();265 +264 266 CameraPane.debugpointG.toParent[3][0] = poship.x; 265 267 CameraPane.debugpointG.toParent[3][1] = poship.y; 266 268 CameraPane.debugpointG.toParent[3][2] = poship.z; .. .. @@ -649,8 +651,8 @@ 649 651 { 650 652 super.ExtractBigData(o); 651 653 652 - o.bvh = this.bvh;653 - o.skeleton = this.skeleton;654 + o.savebvh = this.bvh;655 + o.saveskeleton = this.skeleton;654 656 this.bvh = null; 655 657 this.skeleton = null; 656 658 } .. .. @@ -659,8 +661,8 @@ 659 661 { 660 662 super.RestoreBigData(o); 661 663 662 - this.bvh = o.bvh;663 - this.skeleton = o.skeleton;664 + this.bvh = o.savebvh;665 + this.skeleton = o.saveskeleton;664 666 } 665 667 666 668 boolean smoothed; ObjEditor.java
.. .. @@ -1174,10 +1174,11 @@ 1174 1174 randomCB = AddCheckBox(setupPanel2, "Random", copy.random); 1175 1175 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); 1176 1176 1177 + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);1178 + link2masterCB.setToolTipText("Attach to support");1179 +1177 1180 if (Globals.ADVANCED) 1178 1181 { 1179 - link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);1180 - link2masterCB.setToolTipText("Attach to support");1181 1182 speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); 1182 1183 speedupCB.setToolTipText("Option motion capture"); 1183 1184 } .. .. @@ -3480,8 +3481,8 @@ 3480 3481 try 3481 3482 { 3482 3483 ByteArrayOutputStream baos = new ByteArrayOutputStream(); 3483 - java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);3484 - ObjectOutputStream out = new ObjectOutputStream(zstream);3484 +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);3485 + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);3485 3486 3486 3487 Object3D parent = o.parent; 3487 3488 o.parent = null; .. .. @@ -3492,10 +3493,14 @@ 3492 3493 3493 3494 out.flush(); 3494 3495 3495 - zstream.close();3496 + baos //zstream3497 + .close();3496 3498 out.close(); 3497 3499 3498 - return baos.toByteArray();3500 + byte[] bytes = baos.toByteArray();3501 +3502 + System.out.println("save #bytes = " + bytes.length);3503 + return bytes;3499 3504 } catch (Exception e) 3500 3505 { 3501 3506 System.err.println(e); .. .. @@ -3505,13 +3510,16 @@ 3505 3510 3506 3511 static public Object Uncompress(byte[] bytes) 3507 3512 { 3508 - System.out.println("#bytes = " + bytes.length);3513 + System.out.println("restore #bytes = " + bytes.length);3509 3514 try 3510 3515 { 3511 3516 ByteArrayInputStream bais = new ByteArrayInputStream(bytes); 3512 - java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);3513 - ObjectInputStream in = new ObjectInputStream(istream);3517 + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);3518 + ObjectInputStream in = new ObjectInputStream(bais); // istream);3514 3519 Object obj = in.readObject(); 3520 +3521 + bais //istream3522 + .close();3515 3523 in.close(); 3516 3524 3517 3525 return obj; .. .. @@ -3570,7 +3578,6 @@ 3570 3578 3571 3579 public void Save() 3572 3580 { 3573 - // Default reduces the probability of heuristics errors.3574 3581 Save(true); 3575 3582 } 3576 3583 .. .. @@ -3616,8 +3623,13 @@ 3616 3623 //EditorFrame.m_MainFrame.requestFocusInWindow(); 3617 3624 if (!thesame) 3618 3625 { 3619 - tab.user[tab.undoindex] = user;3620 - tab.graphs[tab.undoindex++] = compress;3626 + //tab.user[tab.undoindex] = user;3627 + boolean increment = tab.graphs[tab.undoindex] == null;3628 +3629 + tab.graphs[tab.undoindex] = compress;3630 +3631 + if (increment)3632 + tab.undoindex++;3621 3633 } 3622 3634 3623 3635 copy.RestoreBigData(hashtable); .. .. @@ -3626,8 +3638,8 @@ 3626 3638 3627 3639 for (int i = tab.undoindex; i < tab.graphs.length; i++) 3628 3640 { 3629 - tab.user[i] = false;3630 - tab.graphs[i] = null;3641 + //tab.user[i] = false;3642 + // tab.graphs[i] = null;3631 3643 } 3632 3644 3633 3645 SetUndoStates(); .. .. @@ -3720,7 +3732,7 @@ 3720 3732 return false; 3721 3733 } 3722 3734 3723 - if (tab.graphs[tab.undoindex] == null || !tab.user[tab.undoindex])3735 + if (tab.graphs[tab.undoindex] == null) // || !tab.user[tab.undoindex])3724 3736 { 3725 3737 if (Save(false)) 3726 3738 tab.undoindex -= 1; .. .. @@ -3754,8 +3766,8 @@ 3754 3766 3755 3767 CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); 3756 3768 3757 - if (!tab.user[tab.undoindex])3758 - tab.graphs[tab.undoindex] = null;3769 + //if (!tab.user[tab.undoindex])3770 + // tab.graphs[tab.undoindex] = null;3759 3771 } 3760 3772 3761 3773 void ImportGFD() .. .. @@ -4718,8 +4730,8 @@ 4718 4730 4719 4731 if (readobj != null) 4720 4732 { 4721 - if (Globals.SAVEONMAKE)4722 - Save();4733 + //if (Globals.SAVEONMAKE) // A new object cannot share meshes4734 + // Save();4723 4735 try 4724 4736 { 4725 4737 //readobj.deepCopySelf(copy); Object3D.java
.. .. @@ -24,9 +24,9 @@ 24 24 25 25 private UUID uuid = UUID.randomUUID(); 26 26 27 - // TEMPORARY for mocap undo28 - mocap.reader.BVHReader.BVHResult bvh;29 - Object3D skeleton;27 + // TEMPORARY for mocap undo. No need to be transient.28 + mocap.reader.BVHReader.BVHResult savebvh;29 + Object3D saveskeleton;30 30 // 31 31 32 32 ScriptNode scriptnode; .. .. @@ -170,24 +170,35 @@ 170 170 171 171 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) 172 172 { 173 + Object3D o;174 +173 175 if (hashtable.containsKey(GetUUID())) 174 176 { 175 - Object3D o = hashtable.get(GetUUID());177 + o = hashtable.get(GetUUID());176 178 177 179 Grafreed.Assert(this.bRep == o.bRep); 178 - if (this.bRep != null)179 - assert(this.bRep.support == o.transientrep);180 + //if (this.bRep != null)181 + // assert(this.bRep.support == o.transientrep);182 + if (this.support != null)183 + assert(this.support.bRep == o.transientrep);184 + }185 + else186 + {187 + o = new Object3D("copy of " + this.name);180 188 181 - return;189 + hashtable.put(GetUUID(), o);182 190 } 183 191 184 - Object3D o = new Object3D("copy of " + this.name);185 -186 - hashtable.put(GetUUID(), o);187 -188 - for (int i=0; i<Size(); i++)192 + if (!blockloop)189 193 { 190 - get(i).ExtractBigData(hashtable);194 + blockloop = true;195 +196 + for (int i=0; i<Size(); i++)197 + {198 + get(i).ExtractBigData(hashtable);199 + }200 +201 + blockloop = false;191 202 } 192 203 193 204 ExtractBigData(o); .. .. @@ -195,11 +206,23 @@ 195 206 196 207 void ExtractBigData(Object3D o) 197 208 { 209 + if (o.bRep != null)210 + Grafreed.Assert(o.bRep == this.bRep);211 +198 212 o.bRep = this.bRep; 199 - if (this.bRep != null)213 +// July 2019 if (this.bRep != null)214 +// {215 +// o.transientrep = this.bRep.support;216 +// o.bRep.support = null;217 +// }218 +219 + if (this.support != null)200 220 { 201 - o.transientrep = this.bRep.support;202 - o.bRep.support = null;221 + if (o.transientrep != null)222 + Grafreed.Assert(o.transientrep == this.support.bRep);223 +224 + o.transientrep = this.support.bRep;225 + this.support.bRep = null;203 226 } 204 227 205 228 // o.support = this.support; .. .. @@ -219,14 +242,14 @@ 219 242 if (!hashtable.containsKey(GetUUID())) 220 243 return; 221 244 245 + Object3D o = hashtable.get(GetUUID());246 +247 + RestoreBigData(o);248 +222 249 if (blockloop) 223 250 return; 224 251 225 252 blockloop = true; 226 -227 - Object3D o = hashtable.get(GetUUID());228 -229 - RestoreBigData(o);230 253 231 254 //hashtable.remove(GetUUID()); 232 255 .. .. @@ -241,8 +264,12 @@ 241 264 void RestoreBigData(Object3D o) 242 265 { 243 266 this.bRep = o.bRep; 244 - if (this.bRep != null)245 - this.bRep.support = o.transientrep;267 + if (this.support != null && o.transientrep != null)268 + {269 + this.support.bRep = o.transientrep;270 + }271 +// July 2019 if (this.bRep != null)272 +// this.bRep.support = o.transientrep;246 273 // this.support = o.support; 247 274 // this.fileparent = o.fileparent; 248 275 } .. .. @@ -1374,6 +1401,7 @@ 1374 1401 toParent = LA.newMatrix(); 1375 1402 fromParent = LA.newMatrix(); 1376 1403 } 1404 +1377 1405 LA.matCopy(other.toParent, toParent); 1378 1406 LA.matCopy(other.fromParent, fromParent); 1379 1407 cRadio.java
.. .. @@ -36,7 +36,7 @@ 36 36 } 37 37 38 38 byte[] graphs[] = new byte[100][]; 39 - boolean[] user = new boolean[100];39 + //boolean[] user = new boolean[100];40 40 41 41 int undoindex = 0; 42 42