Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -35,6 +36,54 @@
3536
3637 GroupEditor callee;
3738 JFrame frame;
39
+
40
+ static ObjEditor theFrame;
41
+
42
+ cButton GetButton(String name, boolean border)
43
+ {
44
+ try
45
+ {
46
+ ImageIcon icon = GetIcon(name);
47
+ return new cButton(icon, border);
48
+ }
49
+ catch (Exception e)
50
+ {
51
+ return new cButton(name, border);
52
+ }
53
+ }
54
+
55
+ cCheckBox GetCheckBox(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cCheckBox(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cCheckBox(name, border);
65
+ }
66
+ }
67
+
68
+ private ImageIcon GetIcon(String name) throws IOException
69
+ {
70
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
71
+
72
+ if (image.getWidth() != 24 && image.getHeight() != 24)
73
+ {
74
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
75
+ Graphics2D g = resized.createGraphics();
76
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
77
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
78
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
79
+ g.dispose();
80
+
81
+ image = resized;
82
+ }
83
+
84
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
85
+ return icon;
86
+ }
3887
3988 // SCRIPT
4089
....@@ -168,7 +217,8 @@
168217 // objEditor.ctrlPanel.remove(remarkButton);
169218
170219 objEditor.ctrlPanel.remove(setupPanel);
171
- objEditor.ctrlPanel.remove(commandsPanel);
220
+ objEditor.ctrlPanel.remove(setupPanel2);
221
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
172222 objEditor.ctrlPanel.remove(pushPanel);
173223 //objEditor.ctrlPanel.remove(fillPanel);
174224
....@@ -243,6 +293,7 @@
243293 //localCopy.parent = null;
244294
245295 frame = new JFrame();
296
+ frame.setUndecorated(true);
246297 objEditor = this;
247298 this.callee = callee;
248299
....@@ -278,7 +329,7 @@
278329 frame.setMenuBar(menuBar = new MenuBar());
279330 menuBar.add(fileMenu = new Menu("File"));
280331 fileMenu.add(newItem = new MenuItem("New"));
281
- fileMenu.add(loadItem = new MenuItem("Load..."));
332
+ fileMenu.add(loadItem = new MenuItem("Open..."));
282333
283334 //oe.menuBar.add(menu = new Menu("Include"));
284335 Menu menu = new Menu("Import");
....@@ -323,9 +374,18 @@
323374 toolbarPanel.setName("Toolbar");
324375 treePanel = new cGridBag();
325376 treePanel.setName("Tree");
377
+
378
+ editPanel = new cGridBag().setVertical(true);
379
+ editPanel.setName("Edit");
380
+
326381 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
327
- ctrlPanel.setName("Edit");
382
+
383
+ editCommandsPanel = new cGridBag();
384
+ editPanel.add(editCommandsPanel);
385
+ editPanel.add(ctrlPanel);
386
+
328387 materialPanel = new cGridBag().setVertical(true);
388
+
329389 materialPanel.setName("Material");
330390 /*JTextPane*/
331391 infoarea = createTextPane();
....@@ -419,10 +479,10 @@
419479 e.printStackTrace();
420480 }
421481
422
- String selection = infoarea.getText();
423
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
424
- java.awt.datatransfer.Clipboard clipboard =
425
- Toolkit.getDefaultToolkit().getSystemClipboard();
482
+// String selection = infoarea.getText();
483
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
484
+// java.awt.datatransfer.Clipboard clipboard =
485
+// Toolkit.getDefaultToolkit().getSystemClipboard();
426486 //clipboard.setContents(data, data);
427487 }
428488
....@@ -582,19 +642,89 @@
582642 }
583643 }
584644
645
+static GraphicsDevice device = GraphicsEnvironment
646
+ .getLocalGraphicsEnvironment().getScreenDevices()[0];
647
+
648
+ Rectangle keeprect;
649
+ cRadio radio;
650
+
651
+cButton keepButton;
652
+ cButton twoButton; // Full 3D
653
+ cButton sixButton;
654
+ cButton threeButton;
655
+ cButton sevenButton;
656
+ cButton fourButton; // full panel
657
+ cButton oneButton; // full XYZ
658
+ //cButton currentLayout;
659
+
660
+ boolean maximized;
661
+
662
+ void Minimize()
663
+ {
664
+ frame.setState(Frame.ICONIFIED);
665
+ }
666
+
667
+ void Maximize()
668
+ {
669
+ if (maximized)
670
+ {
671
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
672
+ }
673
+ else
674
+ {
675
+ keeprect = frame.getBounds();
676
+ Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
677
+ Dimension rect2 = frame.getToolkit().getScreenSize();
678
+ frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
679
+// frame.setState(Frame.MAXIMIZED_BOTH);
680
+ }
681
+
682
+ maximized ^= true;
683
+ }
684
+
585685 void ToggleFullScreen()
586686 {
587687 if (CameraPane.FULLSCREEN)
588688 {
589
- frame.getContentPane().remove(/*"Center",*/bigThree);
590
- framePanel.add(bigThree);
591
- frame.getContentPane().add(/*"Center",*/framePanel);
689
+ device.setFullScreenWindow(null);
690
+ //frame.setVisible(false);
691
+// frame.removeNotify();
692
+// frame.setUndecorated(false);
693
+// frame.addNotify();
694
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
695
+
696
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
697
+// X framePanel.add(bigThree);
698
+// X frame.getContentPane().add(/*"Center",*/framePanel);
699
+ framePanel.setDividerLocation(1);
700
+
701
+ //frame.setVisible(true);
702
+ radio.layout = keepButton;
703
+ //theFrame = null;
704
+ keepButton = null;
705
+ radio.layout.doClick();
706
+
592707 } else
593708 {
594
- frame.getContentPane().remove(/*"Center",*/framePanel);
595
- framePanel.remove(bigThree);
596
- frame.getContentPane().add(/*"Center",*/bigThree);
709
+ keepButton = radio.layout;
710
+ //keeprect = frame.getBounds();
711
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
712
+// frame.getToolkit().getScreenSize().height);
713
+ //frame.setVisible(false);
714
+ device.setFullScreenWindow(frame);
715
+// frame.removeNotify();
716
+// frame.setUndecorated(true);
717
+// frame.addNotify();
718
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
719
+// X framePanel.remove(bigThree);
720
+// X frame.getContentPane().add(/*"Center",*/bigThree);
721
+ framePanel.setDividerLocation(0);
722
+
723
+ radio.layout = twoButton;
724
+ radio.layout.doClick();
725
+ //frame.setVisible(true);
597726 }
727
+
598728 cameraView.ToggleFullScreen();
599729 }
600730
....@@ -745,9 +875,13 @@
745875 JButton fasterButton;
746876 JButton remarkButton;
747877
878
+ cGridBag editPanel;
879
+ cGridBag editCommandsPanel;
880
+
748881 cGridBag namePanel;
749882 cGridBag setupPanel;
750
- cGridBag commandsPanel;
883
+ cGridBag setupPanel2;
884
+ cGridBag objectCommandsPanel;
751885 cGridBag pushPanel;
752886 cGridBag fillPanel;
753887
....@@ -939,40 +1073,44 @@
9391073 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
9401074 markCB.setToolTipText("Set the animation target transform");
9411075
942
- rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
1076
+ setupPanel2 = new cGridBag().setVertical(false);
1077
+
1078
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
9431079 rewindCB.setToolTipText("Rewind animation");
9441080
945
- randomCB = AddCheckBox(setupPanel, "Random", copy.random);
946
- randomCB.setToolTipText("Option for switch node");
1081
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1082
+ randomCB.setToolTipText("Randomly Rewind or Go back and forth");
9471083
9481084 if (Globals.ADVANCED)
9491085 {
950
- link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
1086
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
9511087 link2masterCB.setToolTipText("Attach to support");
952
- speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
1088
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
9531089 speedupCB.setToolTipText("Option motion capture");
9541090 }
9551091
9561092 oe.ctrlPanel.add(setupPanel);
9571093 oe.ctrlPanel.Return();
1094
+ oe.ctrlPanel.add(setupPanel2);
1095
+ oe.ctrlPanel.Return();
9581096
959
- commandsPanel = new cGridBag().setVertical(false);
1097
+ objectCommandsPanel = new cGridBag().setVertical(false);
9601098
961
- resetButton = AddButton(commandsPanel, "Reset");
1099
+ resetButton = AddButton(objectCommandsPanel, "Reset");
9621100 resetButton.setToolTipText("Jump to frame zero");
963
- stepButton = AddButton(commandsPanel, "Step");
1101
+ stepButton = AddButton(objectCommandsPanel, "Step");
9641102 stepButton.setToolTipText("Step one frame");
9651103 // resetAllButton = AddButton(oe, "Reset All");
9661104 // stepAllButton = AddButton(oe, "Step All");
9671105 // Return();
968
- slowerButton = AddButton(commandsPanel, "Slow");
1106
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
9691107 slowerButton.setToolTipText("Decrease animation speed");
970
- fasterButton = AddButton(commandsPanel, "Fast");
1108
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
9711109 fasterButton.setToolTipText("Increase animation speed");
972
- remarkButton = AddButton(commandsPanel, "Remark");
1110
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
9731111 remarkButton.setToolTipText("Set the current transform as the target");
9741112
975
- oe.ctrlPanel.add(commandsPanel);
1113
+ oe.ctrlPanel.add(objectCommandsPanel);
9761114 oe.ctrlPanel.Return();
9771115
9781116 pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
....@@ -1178,8 +1316,11 @@
11781316 //worldPanel.setName("World");
11791317 centralPanel = new cGridBag();
11801318 centralPanel.preferredWidth = 20;
1181
- timelinePanel = new JPanel(new BorderLayout());
1182
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1319
+
1320
+ if (Globals.ADVANCED)
1321
+ {
1322
+ timelinePanel = new JPanel(new BorderLayout());
1323
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11831324
11841325 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11851326 cameraPanel.setContinuousLayout(true);
....@@ -1188,7 +1329,10 @@
11881329 // cameraPanel.setDividerSize(9);
11891330 cameraPanel.setResizeWeight(1.0);
11901331
1332
+ }
1333
+
11911334 centralPanel.add(cameraView);
1335
+ centralPanel.setFocusable(true);
11921336 //frame.setJMenuBar(timelineMenubar);
11931337 //centralPanel.add(timelinePanel);
11941338
....@@ -1255,7 +1399,7 @@
12551399 // north.setName("Edit");
12561400 // north.add(ctrlPanel, BorderLayout.NORTH);
12571401 // objectPanel.add(north);
1258
- objectPanel.add(ctrlPanel);
1402
+ objectPanel.add(editPanel);
12591403 objectPanel.add(infoPanel);
12601404
12611405 /*
....@@ -1386,6 +1530,8 @@
13861530 frame.setSize(1280, 860);
13871531 frame.setVisible(true);
13881532
1533
+ cameraView.requestFocusInWindow();
1534
+
13891535 gridPanel.setDividerLocation(1.0);
13901536
13911537 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
....@@ -1935,6 +2081,7 @@
19352081 e2.printStackTrace();
19362082 }
19372083 }
2084
+
19382085 LoadJMEThread loadThread;
19392086
19402087 class LoadJMEThread extends Thread
....@@ -1992,6 +2139,7 @@
19922139 //LoadFile0(filename, converter);
19932140 }
19942141 }
2142
+
19952143 LoadOBJThread loadObjThread;
19962144
19972145 class LoadOBJThread extends Thread
....@@ -2070,19 +2218,19 @@
20702218
20712219 void LoadObjFile(String fullname)
20722220 {
2073
- /*
2221
+ System.out.println("Loading " + fullname);
2222
+ /**/
20742223 //lastFilename = fullname;
20752224 if(loadObjThread == null)
20762225 {
2077
- loadObjThread = new LoadOBJThread();
2078
- loadObjThread.start();
2226
+ loadObjThread = new LoadOBJThread();
2227
+ loadObjThread.start();
20792228 }
20802229
20812230 loadObjThread.add(fullname);
2082
- */
2231
+ /**/
20832232
2084
- System.out.println("Loading " + fullname);
2085
- makeSomething(new FileObject(fullname, true), true);
2233
+ //makeSomething(new FileObject(fullname, true), true);
20862234 }
20872235
20882236 void LoadGFDFile(String fullname)
....@@ -2925,7 +3073,7 @@
29253073 return;
29263074 } else if (event.getSource() == toggleSwitchItem)
29273075 {
2928
- cameraView.ToggleRandom();
3076
+ cameraView.ToggleSwitch();
29293077 cameraView.repaint();
29303078 return;
29313079 } else if (event.getSource() == toggleHandleItem)
....@@ -3212,23 +3360,45 @@
32123360 objEditor.refreshContents();
32133361 }
32143362
3215
- Object3D graphs[] = new Object3D[10000];
3216
- int undoindex = 0;
3217
-
3218
- static public Object clone(Object o)
3363
+ static public byte[] Compress(Object3D o)
32193364 {
32203365 try
32213366 {
32223367 ByteArrayOutputStream baos = new ByteArrayOutputStream();
3223
- ObjectOutputStream out = new ObjectOutputStream(baos);
3368
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3369
+ ObjectOutputStream out = new ObjectOutputStream(zstream);
32243370
3371
+ Object3D parent = o.parent;
3372
+ o.parent = null;
3373
+
32253374 out.writeObject(o);
3375
+
3376
+ o.parent = parent;
3377
+
3378
+ out.flush();
32263379
3227
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
3228
- ObjectInputStream in = new ObjectInputStream(bais);
3380
+ zstream.close();
3381
+ out.close();
3382
+
3383
+ return baos.toByteArray();
3384
+ } catch (Exception e)
3385
+ {
3386
+ System.err.println(e);
3387
+ return null;
3388
+ }
3389
+ }
3390
+
3391
+ static public Object Uncompress(byte[] bytes)
3392
+ {
3393
+ System.out.println("#bytes = " + bytes.length);
3394
+ try
3395
+ {
3396
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3397
+ java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3398
+ ObjectInputStream in = new ObjectInputStream(istream);
32293399 Object obj = in.readObject();
32303400 in.close();
3231
- out.close();
3401
+
32323402 return obj;
32333403 } catch (Exception e)
32343404 {
....@@ -3237,16 +3407,75 @@
32373407 }
32383408 }
32393409
3410
+ static public Object clone(Object o)
3411
+ {
3412
+ try
3413
+ {
3414
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3415
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3416
+
3417
+ out.writeObject(o);
3418
+
3419
+ out.flush();
3420
+ out.close();
3421
+
3422
+ byte[] bytes = baos.toByteArray();
3423
+
3424
+ System.out.println("clone = " + bytes.length);
3425
+
3426
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3427
+ ObjectInputStream in = new ObjectInputStream(bais);
3428
+ Object obj = in.readObject();
3429
+ in.close();
3430
+
3431
+ return obj;
3432
+ } catch (Exception e)
3433
+ {
3434
+ System.err.println(e);
3435
+ return null;
3436
+ }
3437
+ }
3438
+
3439
+ cRadio GetCurrentTab()
3440
+ {
3441
+ cRadio ab;
3442
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3443
+ {
3444
+ ab = (cRadio)e.nextElement();
3445
+ if(ab.GetObject() == copy)
3446
+ {
3447
+ return ab;
3448
+ }
3449
+ }
3450
+
3451
+ return null;
3452
+ }
3453
+
3454
+ java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
3455
+
32403456 public void Save()
32413457 {
3242
- if (true) return;
3458
+ System.err.println("Save");
3459
+
3460
+ cRadio tab = GetCurrentTab();
3461
+
3462
+ boolean temp = CameraPane.SWITCH;
3463
+ CameraPane.SWITCH = false;
3464
+
3465
+ copy.ExtractBigData(hashtable);
32433466
32443467 //EditorFrame.m_MainFrame.requestFocusInWindow();
3245
- graphs[undoindex++] = (Object3D)clone(copy);
3468
+ tab.graphs[tab.undoindex++] = Compress(copy);
32463469
3247
- for (int i = undoindex; i < graphs.length; i++)
3470
+ copy.RestoreBigData(hashtable);
3471
+
3472
+ CameraPane.SWITCH = temp;
3473
+
3474
+ //assert(hashtable.isEmpty());
3475
+
3476
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
32483477 {
3249
- graphs[i] = null;
3478
+ tab.graphs[i] = null;
32503479 }
32513480
32523481 // test save
....@@ -3254,7 +3483,7 @@
32543483 {
32553484 try
32563485 {
3257
- FileOutputStream ostream = new FileOutputStream("save" + undoindex);
3486
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
32583487 ObjectOutputStream p = new ObjectOutputStream(ostream);
32593488
32603489 p.writeObject(copy);
....@@ -3269,48 +3498,83 @@
32693498 }
32703499 }
32713500
3501
+ void CopyChanged(Object3D obj)
3502
+ {
3503
+ boolean temp = CameraPane.SWITCH;
3504
+ CameraPane.SWITCH = false;
3505
+
3506
+ copy.ExtractBigData(hashtable);
3507
+
3508
+ copy.clear();
3509
+
3510
+ for (int i=0; i<obj.Size(); i++)
3511
+ {
3512
+ copy.add(obj.get(i));
3513
+ }
3514
+
3515
+ copy.RestoreBigData(hashtable);
3516
+
3517
+ CameraPane.SWITCH = temp;
3518
+
3519
+ //assert(hashtable.isEmpty());
3520
+
3521
+ copy.Touch();
3522
+
3523
+ ResetModel();
3524
+ copy.HardTouch(); // recompile?
3525
+
3526
+ cRadio ab;
3527
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3528
+ {
3529
+ ab = (cRadio)e.nextElement();
3530
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3531
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3532
+ if (test != null)
3533
+ {
3534
+ test.editWindow = ab.object.editWindow;
3535
+ ab.object = test;
3536
+ }
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
3541
+
32723542 public void Undo()
32733543 {
3274
- if (undoindex == 0)
3544
+ System.err.println("Undo");
3545
+
3546
+ cRadio tab = GetCurrentTab();
3547
+
3548
+ if (tab.undoindex == 0)
32753549 {
32763550 java.awt.Toolkit.getDefaultToolkit().beep();
32773551 return;
32783552 }
32793553
3280
- if (graphs[undoindex] == null)
3554
+ if (tab.graphs[tab.undoindex] == null)
32813555 {
32823556 Save();
3283
- undoindex -= 1;
3557
+ tab.undoindex -= 1;
32843558 }
32853559
3286
- undoindex -= 1;
3560
+ tab.undoindex -= 1;
32873561
3288
- copy = graphs[undoindex];
3289
-
3290
- cameraView.object = copy;
3291
- copy.Touch();
3292
-
3293
- ResetModel();
3294
- refreshContents();
3562
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
32953563 }
32963564
32973565 public void Redo()
32983566 {
3299
- if (graphs[undoindex + 1] == null)
3567
+ cRadio tab = GetCurrentTab();
3568
+
3569
+ if (tab.graphs[tab.undoindex + 1] == null)
33003570 {
33013571 java.awt.Toolkit.getDefaultToolkit().beep();
33023572 return;
33033573 }
33043574
3305
- undoindex += 1;
3575
+ tab.undoindex += 1;
33063576
3307
- copy = graphs[undoindex];
3308
-
3309
- cameraView.object = copy;
3310
- copy.Touch();
3311
-
3312
- ResetModel();
3313
- refreshContents();
3577
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
33143578 }
33153579
33163580 void ImportGFD()
....@@ -3957,7 +4221,8 @@
39574221
39584222 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
39594223 {
3960
- Save();
4224
+ if (Globals.SAVEONMAKE)
4225
+ Save();
39614226 //Tween.set(thing, 0).target(1).start(tweenManager);
39624227 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
39634228 // if (thing instanceof GenericJointDemo)
....@@ -4181,6 +4446,7 @@
41814446
41824447 try
41834448 {
4449
+ // Try compressed version first.
41844450 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
41854451 java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
41864452 java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
....@@ -4250,6 +4516,12 @@
42504516
42514517 void LoadIt(Object obj)
42524518 {
4519
+ if (obj == null)
4520
+ {
4521
+ // Invalid file
4522
+ return;
4523
+ }
4524
+
42534525 System.out.println("Loaded " + obj);
42544526 //new Exception().printStackTrace();
42554527 Object3D readobj = (Object3D) obj;
....@@ -4259,6 +4531,8 @@
42594531
42604532 if (readobj != null)
42614533 {
4534
+ if (Globals.SAVEONMAKE)
4535
+ Save();
42624536 try
42634537 {
42644538 //readobj.deepCopySelf(copy);