Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
ObjEditor.java
....@@ -1174,10 +1174,11 @@
11741174 randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
11751175 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11761176
1177
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1178
+ link2masterCB.setToolTipText("Attach to support");
1179
+
11771180 if (Globals.ADVANCED)
11781181 {
1179
- link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1180
- link2masterCB.setToolTipText("Attach to support");
11811182 speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
11821183 speedupCB.setToolTipText("Option motion capture");
11831184 }
....@@ -3480,8 +3481,8 @@
34803481 try
34813482 {
34823483 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);
34853486
34863487 Object3D parent = o.parent;
34873488 o.parent = null;
....@@ -3492,10 +3493,14 @@
34923493
34933494 out.flush();
34943495
3495
- zstream.close();
3496
+ baos //zstream
3497
+ .close();
34963498 out.close();
34973499
3498
- return baos.toByteArray();
3500
+ byte[] bytes = baos.toByteArray();
3501
+
3502
+ System.out.println("save #bytes = " + bytes.length);
3503
+ return bytes;
34993504 } catch (Exception e)
35003505 {
35013506 System.err.println(e);
....@@ -3505,13 +3510,16 @@
35053510
35063511 static public Object Uncompress(byte[] bytes)
35073512 {
3508
- System.out.println("#bytes = " + bytes.length);
3513
+ System.out.println("restore #bytes = " + bytes.length);
35093514 try
35103515 {
35113516 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);
35143519 Object obj = in.readObject();
3520
+
3521
+ bais //istream
3522
+ .close();
35153523 in.close();
35163524
35173525 return obj;
....@@ -3570,7 +3578,6 @@
35703578
35713579 public void Save()
35723580 {
3573
- // Default reduces the probability of heuristics errors.
35743581 Save(true);
35753582 }
35763583
....@@ -3616,8 +3623,13 @@
36163623 //EditorFrame.m_MainFrame.requestFocusInWindow();
36173624 if (!thesame)
36183625 {
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++;
36213633 }
36223634
36233635 copy.RestoreBigData(hashtable);
....@@ -3626,8 +3638,8 @@
36263638
36273639 for (int i = tab.undoindex; i < tab.graphs.length; i++)
36283640 {
3629
- tab.user[i] = false;
3630
- tab.graphs[i] = null;
3641
+ //tab.user[i] = false;
3642
+ // tab.graphs[i] = null;
36313643 }
36323644
36333645 SetUndoStates();
....@@ -3720,7 +3732,7 @@
37203732 return false;
37213733 }
37223734
3723
- if (tab.graphs[tab.undoindex] == null || !tab.user[tab.undoindex])
3735
+ if (tab.graphs[tab.undoindex] == null) // || !tab.user[tab.undoindex])
37243736 {
37253737 if (Save(false))
37263738 tab.undoindex -= 1;
....@@ -3754,8 +3766,8 @@
37543766
37553767 CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
37563768
3757
- if (!tab.user[tab.undoindex])
3758
- tab.graphs[tab.undoindex] = null;
3769
+ //if (!tab.user[tab.undoindex])
3770
+ // tab.graphs[tab.undoindex] = null;
37593771 }
37603772
37613773 void ImportGFD()
....@@ -4718,8 +4730,8 @@
47184730
47194731 if (readobj != null)
47204732 {
4721
- if (Globals.SAVEONMAKE)
4722
- Save();
4733
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4734
+ // Save();
47234735 try
47244736 {
47254737 //readobj.deepCopySelf(copy);