.. | .. |
---|
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 | 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 | 3493 | |
---|
3493 | 3494 | out.flush(); |
---|
3494 | 3495 | |
---|
3495 | | - zstream.close(); |
---|
| 3496 | + baos //zstream |
---|
| 3497 | + .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 | 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 //istream |
---|
| 3522 | + .close(); |
---|
3515 | 3523 | in.close(); |
---|
3516 | 3524 | |
---|
3517 | 3525 | return obj; |
---|
.. | .. |
---|
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 | 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 | 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 | 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 | 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 | 4730 | |
---|
4719 | 4731 | if (readobj != null) |
---|
4720 | 4732 | { |
---|
4721 | | - if (Globals.SAVEONMAKE) |
---|
4722 | | - Save(); |
---|
| 4733 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 4734 | + // Save(); |
---|
4723 | 4735 | try |
---|
4724 | 4736 | { |
---|
4725 | 4737 | //readobj.deepCopySelf(copy); |
---|