Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
ObjEditor.java
....@@ -501,13 +501,13 @@
501501 //SendInfo("Name:", "bold");
502502 if (sel.GetTextures() != null || debug)
503503 {
504
- si.SendInfo(sel.toString(), "bold");
504
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
505505 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
506506 if (sel.Size() > 0)
507507 {
508508 si.SendInfo("#children = " + sel.Size(), "regular");
509509 }
510
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
510
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
511511 if (debug)
512512 {
513513 try
....@@ -549,7 +549,7 @@
549549 }
550550 if (sel.support != null)
551551 {
552
- si.SendInfo(" support: " + sel.support, "regular");
552
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
553553 }
554554 if (sel.scriptnode != null)
555555 {
....@@ -752,7 +752,7 @@
752752 protected static ImageIcon createImageIcon(String path,
753753 String description)
754754 {
755
- java.net.URL imgURL = GrafreeD.class.getResource(path);
755
+ java.net.URL imgURL = Grafreed.class.getResource(path);
756756 if (imgURL != null)
757757 {
758758 return new ImageIcon(imgURL, description);
....@@ -784,6 +784,7 @@
784784 // NumberSlider vDivsField;
785785 // JCheckBox endcaps;
786786 JCheckBox liveCB;
787
+ JCheckBox selectCB;
787788 JCheckBox hideCB;
788789 JCheckBox link2masterCB;
789790 JCheckBox markCB;
....@@ -986,9 +987,11 @@
986987
987988 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
988989 liveCB.setToolTipText("Animate object");
990
+ selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
991
+ selectCB.setToolTipText("Make object selectable");
992
+// Return();
989993 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
990994 hideCB.setToolTipText("Hide object");
991
-// Return();
992995 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
993996 markCB.setToolTipText("Set the animation target transform");
994997
....@@ -1028,7 +1031,7 @@
10281031 oe.ctrlPanel.add(commandsPanel);
10291032 oe.ctrlPanel.Return();
10301033
1031
- pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1034
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
10321035 normalpushField = (cNumberSlider)pushPanel.getComponent(1);
10331036 //Return();
10341037
....@@ -1476,19 +1479,19 @@
14761479
14771480 cGridBag editBar = new cGridBag().setVertical(false);
14781481
1479
- editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1482
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
14801483 createMaterialButton.setToolTipText("Create material");
14811484
14821485 /*
14831486 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14841487 */
14851488
1486
- editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1489
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
14871490 clearMaterialButton.setToolTipText("Clear material");
14881491
14891492 if (Globals.ADVANCED)
14901493 {
1491
- editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1494
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
14921495 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
14931496 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14941497 }
....@@ -2396,7 +2399,7 @@
23962399
23972400 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23982401 {
2399
- if (GrafreeD.standAlone)
2402
+ if (Grafreed.standAlone)
24002403 {
24012404 /**/
24022405 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
....@@ -3007,6 +3010,10 @@
30073010 {
30083011 copy.live ^= true;
30093012 return;
3013
+ } else if (event.getSource() == selectCB)
3014
+ {
3015
+ copy.dontselect ^= true;
3016
+ return;
30103017 } else if (event.getSource() == hideCB)
30113018 {
30123019 copy.hide ^= true;
....@@ -3255,8 +3262,8 @@
32553262
32563263 Globals.ANIMATION ^= true;
32573264
3258
- GrafreeD.wav.cursor = 0;
3259
- GrafreeD.wav.loop = 0;
3265
+ Grafreed.wav.cursor = 0;
3266
+ Grafreed.wav.loop = 0;
32603267 }
32613268 } else
32623269 {
....@@ -3588,7 +3595,7 @@
35883595 }
35893596
35903597 if (normalpushField != null)
3591
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
3598
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35923599 }
35933600
35943601 void SnapObject()
....@@ -4055,6 +4062,7 @@
40554062 }
40564063 }
40574064 }
4065
+
40584066 LoadGFDThread loadGFDThread;
40594067
40604068 void ReadGFD(String fullname, iCallBack cb)
....@@ -4075,7 +4083,8 @@
40754083 try
40764084 {
40774085 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4078
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4086
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4087
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40794088
40804089 readobj = (Object3D) p.readObject();
40814090 istream.close();
....@@ -4083,7 +4092,20 @@
40834092 readobj.ResetDisplayList();
40844093 } catch (Exception e)
40854094 {
4086
- e.printStackTrace();
4095
+ //e.printStackTrace();
4096
+ try
4097
+ {
4098
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4099
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4100
+
4101
+ readobj = (Object3D) p.readObject();
4102
+ istream.close();
4103
+
4104
+ readobj.ResetDisplayList();
4105
+ } catch (Exception e2)
4106
+ {
4107
+ e2.printStackTrace();
4108
+ }
40874109 }
40884110 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40894111 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4200,7 +4222,7 @@
42004222
42014223 void load() // throws ClassNotFoundException
42024224 {
4203
- if (GrafreeD.standAlone)
4225
+ if (Grafreed.standAlone)
42044226 {
42054227 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
42064228 browser.show();
....@@ -4287,11 +4309,13 @@
42874309 try
42884310 {
42894311 FileOutputStream ostream = new FileOutputStream(lastname);
4290
- ObjectOutputStream p = new ObjectOutputStream(ostream);
4312
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4313
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42914314
42924315 p.writeObject(copy);
42934316 p.flush();
42944317
4318
+ zstream.close();
42954319 ostream.close();
42964320
42974321 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4301,11 +4325,12 @@
43014325 {
43024326 }
43034327 }
4328
+
43044329 String lastname;
43054330
43064331 void saveAs()
43074332 {
4308
- if (GrafreeD.standAlone)
4333
+ if (Grafreed.standAlone)
43094334 {
43104335 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
43114336 browser.setVisible(true);
....@@ -4410,13 +4435,13 @@
44104435 try
44114436 {
44124437 FileOutputStream ostream = new FileOutputStream(filename);
4413
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4414
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
4438
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4439
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
44154440
44164441 Object3D objectparent = obj.parent;
44174442 obj.parent = null;
44184443
4419
- Object3D object = (Object3D) GrafreeD.clone(obj);
4444
+ Object3D object = (Object3D) Grafreed.clone(obj);
44204445
44214446 obj.parent = objectparent;
44224447
....@@ -4428,8 +4453,8 @@
44284453 p.writeObject(object);
44294454 p.flush();
44304455
4456
+ zstream.close();
44314457 ostream.close();
4432
- // zstream.close();
44334458
44344459 // group.selection.get(0).parent = parent;
44354460 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4450,7 +4475,7 @@
44504475 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44514476 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44524477 copy.generatePOV(buffer);
4453
- if (GrafreeD.standAlone)
4478
+ if (Grafreed.standAlone)
44544479 {
44554480 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44564481 browser.show();