Normand Briere
2019-07-25 f2b6a33fdf84a06b958f9cb9d667a2eff3063d8b
GroupEditor.java
....@@ -60,6 +60,12 @@
6060 this.copy = this.group = group;
6161 //selectees = this.group.selectees;
6262
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6369 if(ui)
6470 SetupUI(objEditor);
6571 }
....@@ -80,10 +86,22 @@
8086 SetupViews(objEditor);
8187
8288 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
8397 }
8498
8599 void CloneSelection(boolean supports)
86100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
87105 // Object3D keep = GrafreeD.clipboard;
88106 //Object3D obj;
89107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +112,7 @@
94112
95113 makeSomething(clone, i==group.selection.size()-1);
96114 }
115
+ Globals.REPLACEONMAKE = keep;
97116 }
98117
99118 void CloneClipboard(boolean supports)
....@@ -150,6 +169,8 @@
150169
151170 void SetupMenu2(GroupEditor oe)
152171 {
172
+ oe.jTree = new cTree();
173
+
153174 Menu menu;
154175 oe.menuBar.add(menu = new Menu("Edit"));
155176 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +181,7 @@
160181 // redoItem = menu.add(new MenuItem("Redo"));
161182 // redoItem.addActionListener(this);
162183 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
184
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164185 duplicateItem.addActionListener(this);
165186 cloneItem = menu.add(new MenuItem("Clone"));
166187 cloneItem.addActionListener(this);
....@@ -176,7 +197,6 @@
176197 copyItem.addActionListener(this);
177198 pasteItem = menu.add(new MenuItem("Paste"));
178199 pasteItem.addActionListener(this);
179
- menu.add("-");
180200
181201 menu.add("-");
182202 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -188,8 +208,8 @@
188208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189209 // pasteExpandItem.addActionListener(this);
190210 menu.add("-");
191
- clearItem = menu.add(new MenuItem("Clear"));
192
- clearItem.addActionListener(this);
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
193213
194214 if (Globals.ADVANCED)
195215 {
....@@ -203,23 +223,23 @@
203223 //zBufferItem.addActionListener(this);
204224 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205225 //normalLensItem.addActionListener(this);
206
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
- revertCameraItem.addActionListener(this);
226
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
227
+ restoreCameraItem.addActionListener(this);
208228
209
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
- toggleFullScreenItem.addItemListener(this);
211
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
- cameraMenu.add("-");
229
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
230
+// toggleFullScreenItem.addItemListener(this);
231
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
232
+// cameraMenu.add("-");
233
+//
234
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
235
+// toggleTextureItem.addItemListener(this);
236
+// toggleTextureItem.setState(CameraPane.textureon);
237
+//
238
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
239
+// toggleSwitchItem.addItemListener(this);
240
+// toggleSwitchItem.setState(CameraPane.SWITCH);
213241
214
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
- toggleTextureItem.addItemListener(this);
216
- toggleTextureItem.setState(CameraPane.textureon);
217
-
218
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
- toggleSwitchItem.addItemListener(this);
220
- toggleSwitchItem.setState(CameraPane.SWITCH);
221
-
222
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
242
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
223243 toggleHandleItem.addItemListener(this);
224244 toggleHandleItem.setState(CameraPane.HANDLES);
225245
....@@ -246,7 +266,7 @@
246266
247267 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248268 toggleDebugItem.addItemListener(this);
249
- toggleDebugItem.setState(CameraPane.DEBUG);
269
+ toggleDebugItem.setState(Globals.DEBUG);
250270
251271 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252272 toggleFrustumItem.addItemListener(this);
....@@ -274,7 +294,7 @@
274294 {
275295 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
276296 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
277
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
297
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
278298 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
279299 oe.cameraMenu.add("-");
280300 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -282,7 +302,7 @@
282302 editLeafItem.addActionListener(this);
283303 lookAtItem.addActionListener(this);
284304 //lookFromItem.addActinoListener(this);
285
- //switchItem.addActionListener(this);
305
+ //switchViewItem.addActionListener(this);
286306 }
287307
288308 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -327,21 +347,29 @@
327347 }
328348
329349 oe.menuBar.add(menu = new Menu("Group"));
330
- grabItem = menu.add(new MenuItem("Grab"));
331
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
332352 backItem = menu.add(new MenuItem("Back"));
333353 backItem.addActionListener(this);
334354 frontItem = menu.add(new MenuItem("Front"));
335355 frontItem.addActionListener(this);
336
- compositeItem = menu.add(new MenuItem("Composite"));
337
- compositeItem.addActionListener(this);
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
338361 hideItem = menu.add(new MenuItem("Hidden Group"));
339362 hideItem.addActionListener(this);
363
+ }
340364 ungroupItem = menu.add(new MenuItem("Ungroup"));
341365 ungroupItem.addActionListener(this);
342
- menu.add("-");
343
- randomItem = menu.add(new MenuItem("Switch node"));
344
- randomItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
345373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
346374 switchGeoItem.addActionListener(this);
347375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -349,8 +377,6 @@
349377 morphItem = menu.add(new MenuItem("Morph Group"));
350378 morphItem.addActionListener(this);
351379
352
- if (Globals.ADVANCED)
353
- {
354380 menu.add("-");
355381 physicsItem = menu.add(new MenuItem("Physics"));
356382 physicsItem.addActionListener(this);
....@@ -358,30 +384,29 @@
358384 frameselectorItem.addActionListener(this);
359385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
360386 scriptNodeItem.addActionListener(this);
361
- cameraItem = menu.add(new MenuItem("Camera"));
362
- cameraItem.addActionListener(this);
363387 }
364388
365389 oe.menuBar.add(menu = new Menu("Object"));
366
- textureItem = menu.add(new MenuItem("Texture"));
367
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
368392 billboardItem = menu.add(new MenuItem("Billboard"));
369393 billboardItem.addActionListener(this);
370394 csgItem = menu.add(new MenuItem("CSG"));
371395 csgItem.addActionListener(this);
372
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
373397 shadowXItem.addActionListener(this);
374
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
375399 shadowYItem.addActionListener(this);
376
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
377401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
378405 if (Globals.ADVANCED)
379406 {
380407 menu.add("-");
381408 linkerItem = menu.add(new MenuItem("Linker"));
382409 linkerItem.addActionListener(this);
383
- attributeItem = menu.add(new MenuItem("Attribute"));
384
- attributeItem.addActionListener(this);
385410 templateItem = menu.add(new MenuItem("Template"));
386411 templateItem.addActionListener(this);
387412 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -410,7 +435,7 @@
410435 genNormalsMESHItem.addActionListener(this);
411436 if (Globals.ADVANCED)
412437 {
413
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
414439 genNormalsMINEItem.addActionListener(this);
415440 }
416441 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -503,10 +528,15 @@
503528 attachBumpItem.addActionListener(this);
504529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
505530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
506532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
507533 detachPigmentItem.addActionListener(this);
508534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
509535 detachBumpItem.addActionListener(this);
536
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
537
+ embedTexturesItem.addActionListener(this);
538
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
539
+ deEmbedTexturesItem.addActionListener(this);
510540 menu.add("-");
511541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
512542 sortbysizeItem.addActionListener(this);
....@@ -533,8 +563,21 @@
533563 buildToolsMenu(menu);
534564 }
535565
566
+
536567 void SetupUI2(ObjEditor oe)
537568 {
569
+ // June 2019
570
+ if (oe == null)
571
+ {
572
+ //super.SetupUI2(this);
573
+ //return;
574
+ }
575
+
576
+ if (copy != group)
577
+ {
578
+ //super.SetupUI2(this);
579
+ }
580
+
538581 //new Exception().printStackTrace();
539582
540583 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -563,39 +606,79 @@
563606 oe.radioPanel.add(dummyButton);
564607 oe.buttonGroup.add(dummyButton);
565608 */
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
612
+
566613 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
567614
568
- oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
- undoButton.setToolTipText("Undo changes");
570
- undoButton.addActionListener(this);
615
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ //minButton.setToolTipText("Minimize window");
617
+ //minButton.addActionListener(this);
571618
572
- oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
- redoButton.setToolTipText("Redo changes");
574
- redoButton.addActionListener(this);
619
+ if (Globals.ADVANCED)
620
+ {
621
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ maxButton.setToolTipText("Maximize window");
623
+ maxButton.addActionListener(this);
624
+ }
575625
576
- oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
- saveButton.setToolTipText("Save changes");
626
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
627
+ fullButton.setToolTipText("Full-screen window");
628
+ fullButton.addActionListener(this);
629
+
630
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
631
+ screenfitButton.setToolTipText("Screen fit");
632
+ screenfitButton.addActionListener(this);
633
+
634
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ restoreCameraButton.setToolTipText("Restore viewpoint");
636
+ restoreCameraButton.addActionListener(this);
637
+
638
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ saveButton.setToolTipText("New version");
578640 saveButton.addActionListener(this);
641
+
642
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
+ undoButton.setToolTipText("Previous version");
644
+ undoButton.addActionListener(this);
645
+ undoButton.setEnabled(false);
579646
580
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
647
+ cGridBag updown = new cGridBag().setVertical(true);
648
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ restoreButton.setToolTipText("Restore current");
650
+ restoreButton.addActionListener(this);
651
+ restoreButton.setEnabled(false);
652
+
653
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ replaceButton.setToolTipText("Replace current");
655
+ replaceButton.addActionListener(this);
656
+ replaceButton.setEnabled(false);
657
+
658
+ copyOptionsPanel.add(updown);
659
+
660
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ redoButton.setToolTipText("Next version");
662
+ redoButton.addActionListener(this);
663
+ redoButton.setEnabled(false);
664
+
665
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
581666 liveCB.setToolTipText("Enable animation");
582667 liveCB.addItemListener(this);
583668
584
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585670 oneStepButton.setToolTipText("Animate one step forward");
586671 oneStepButton.addActionListener(this);
587672
588
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
673
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
589674 fastCB.setToolTipText("Fast mode");
590675 fastCB.addItemListener(this);
591676
592
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
593
- trackCB.setToolTipText("Enable tracking");
594
- trackCB.addItemListener(this);
595
-
596
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
- screenfitButton.setToolTipText("Screen fit");
598
- screenfitButton.addActionListener(this);
677
+ //oe.toolboxPanel.Return();
678
+
679
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
680
+// trackCB.setToolTipText("Enable tracking");
681
+// trackCB.addItemListener(this);
599682
600683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
601684 // screenfitpointButton.addActionListener(this);
....@@ -607,65 +690,146 @@
607690 snapobjectButton.setToolTipText("Snap Object");
608691 }
609692
610
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
- flashSelectionButton.setToolTipText("Show selection");
612
- flashSelectionButton.addActionListener(this);
693
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
613694
614
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
615
-
616
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
- twoButton.setToolTipText("Show center view only");
618
- twoButton.addActionListener(this);
619
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620696 fourButton.addActionListener(this);
621697 fourButton.setToolTipText("Show left panel only");
622
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623
- sixButton.setToolTipText("2-column layout left");
698
+
699
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ twoButton.setToolTipText("Show right view only");
701
+ twoButton.addActionListener(this);
702
+ this.fullscreenLayout = twoButton;
703
+
704
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ sixButton.setToolTipText("Show left and right");
624706 sixButton.addActionListener(this);
625
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
- threeButton.setToolTipText("2-column layout right");
627
- threeButton.addActionListener(this);
628
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
- sevenButton.setToolTipText("3-column layout");
630
- sevenButton.addActionListener(this);
707
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+// threeButton.setToolTipText("2-column layout right");
709
+// threeButton.addActionListener(this);
710
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+// sevenButton.setToolTipText("3-column layout");
712
+// sevenButton.addActionListener(this);
631713 //
632714
633
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- rootButton.setToolTipText("Edit selection in new tab");
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
635717 rootButton.addActionListener(this);
636718
637
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638720 closeButton.setToolTipText("Close tab");
639721 closeButton.addActionListener(this);
640722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
641723 //clearButton.addActionListener(this);
642
-
643
- cGridBag commandsPanel = new cGridBag();
724
+
725
+ // INSERT
726
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ gridButton.setToolTipText("Create grid");
728
+ gridButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ boxButton.setToolTipText("Create box");
732
+ boxButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ sphereButton.setToolTipText("Create sphere");
736
+ sphereButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ coneButton.setToolTipText("Create cone");
740
+ coneButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ torusButton.setToolTipText("Create torus");
744
+ torusButton.addActionListener(this);
745
+
746
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
747
+ superButton.setToolTipText("Create superellipsoid");
748
+ superButton.addActionListener(this);
749
+
750
+ if (Globals.ADVANCED)
751
+ {
752
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ kleinButton.setToolTipText("Create Klein bottle");
754
+ kleinButton.addActionListener(this);
755
+ }
644756
645
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
- editButton.setToolTipText("Edit selection");
757
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ particlesButton.setToolTipText("Create particle system");
759
+ particlesButton.addActionListener(this);
760
+
761
+ oe.toolboxPanel.Return();
762
+
763
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ groupButton.setToolTipText("Create group");
765
+ groupButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ compositeButton.setToolTipText("Create composite");
769
+ compositeButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ switchButton.setToolTipText("Create item switcher");
773
+ switchButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ loopButton.setToolTipText("Create loop");
777
+ loopButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ textureButton.setToolTipText("Create texture");
781
+ textureButton.addActionListener(this);
782
+
783
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
784
+ overlayButton.setToolTipText("Create overlay");
785
+ overlayButton.addActionListener(this);
786
+
787
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
788
+ lightButton.setToolTipText("Create light");
789
+ lightButton.addActionListener(this);
790
+
791
+ for (int i=6; --i>=0;)
792
+ {
793
+ oe.toolboxPanel.Return();
794
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ oe.toolboxPanel.add(new cGridBag());
797
+ oe.toolboxPanel.add(new cGridBag());
798
+ oe.toolboxPanel.add(new cGridBag());
799
+ oe.toolboxPanel.add(new cGridBag());
800
+ oe.toolboxPanel.add(new cGridBag());
801
+ }
802
+
803
+ // EDIT panel
804
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ editButton.setToolTipText("Pin selection controls");
647806 editButton.addActionListener(this);
648807
649
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
- uneditButton.setToolTipText("Unedit selection");
808
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ uneditButton.setToolTipText("Remove selection controls");
651810 uneditButton.addActionListener(this);
652811
653
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654
- allParamsButton.setToolTipText("Edit all params");
812
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
813
+ allParamsButton.setToolTipText("Show all controle");
655814 allParamsButton.addActionListener(this);
656815
657
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
816
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658817 clearPanelButton.setToolTipText("Clear edit panel");
659818 clearPanelButton.addActionListener(this);
660819
661
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
820
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662821 unselectButton.setToolTipText("Unselect");
663822 unselectButton.addActionListener(this);
664823
665
- commandsPanel.preferredHeight = 1;
824
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
825
+ flashSelectionButton.setToolTipText("Highlight selection");
826
+ flashSelectionButton.addActionListener(this);
666827
667
- oe.treePanel.add(commandsPanel);
668
- oe.treePanel.Return();
828
+ editCommandsPanel.preferredHeight = 1;
829
+
830
+ SetPinStates(false);
831
+// oe.treePanel.add(commandsPanel);
832
+// oe.treePanel.Return();
669833
670834 // oe.aConstraints.gridx += 1;
671835 // oe.aConstraints.weighty = 0;
....@@ -682,29 +846,17 @@
682846
683847 JScrollPane jSP;
684848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
685
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
686850 ResetModel();
687851
688852 oe.treePanel.add(jSPPanel);
689853 oe.treePanel.Return();
690854
691
- cGridBag copyOptionsPanel = new cGridBag();
692
-
693
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
694
- colorCB.setToolTipText("Copy color when dropped");
695
- colorCB.addItemListener(this);
696
-
697
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
698
- materialCB.setToolTipText("Copy material when dropped");
699
- materialCB.addItemListener(this);
700
-
701
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
702
- textureCB.setToolTipText("Copy texture when dropped");
703
- textureCB.addItemListener(this);
704
-
705
- copyOptionsPanel.preferredHeight = 1;
706855 oe.treePanel.add(copyOptionsPanel);
707856 oe.treePanel.Return();
857
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
858
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
859
+ sliderPane.preferredHeight = 1;
708860
709861 // mainPanel.setDividerLocation(0.5); //1.0);
710862 // mainPanel.setResizeWeight(0.5);
....@@ -727,29 +879,49 @@
727879 dgr.addDragGestureListener(this);
728880 }catch(Exception e) {}
729881 */
730
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
731883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
732884 }
733885
734886 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
735887 {
888
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
889
+ colorCB.setToolTipText("Copy color when dropped");
890
+ colorCB.addItemListener(this);
891
+
892
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
893
+ materialCB.setToolTipText("Copy material when dropped");
894
+ materialCB.addItemListener(this);
895
+
896
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
897
+ textureCB.setToolTipText("Copy texture when dropped");
898
+ textureCB.addItemListener(this);
899
+
900
+ panel.Return();
901
+
736902 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
737903 boxCB.setToolTipText("Display bounding boxes");
738904 boxCB.addItemListener(this);
739905
740906 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
741
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
907
+ zoomBoxCB.setToolTipText("Display only for wheel");
742908 zoomBoxCB.addItemListener(this);
743909
744910 if (true) // Globals.ADVANCED)
745911 {
746
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
747
- supportCB.setToolTipText("Enable rigging");
748
- supportCB.addItemListener(this);
912
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
913
+// supportCB.setToolTipText("Enable rigging");
914
+// supportCB.addItemListener(this);
915
+
916
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
917
+ freezeCB.setToolTipText("Fast moving camera");
918
+ freezeCB.addItemListener(this);
749919
750920 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
751921 // localCB.addItemListener(this);
752922
923
+ panel.Return();
924
+
753925 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
754926 crowdCB.setToolTipText("Used for crowds");
755927 crowdCB.addItemListener(this);
....@@ -766,6 +938,8 @@
766938 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
767939 // speakerMocapCB.addItemListener(this);
768940
941
+ panel.Return();
942
+
769943 if (false)
770944 {
771945 // handled in scripts
....@@ -780,34 +954,74 @@
780954 //constraints.gridy += 1;
781955 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
782956 smoothfocusCB.addItemListener(this);
957
+ panel.Return();
783958 }
784959
785960 //constraints.gridx += 1;
786961 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
787962 // debugCB.addItemListener(this);
788963
964
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
965
+ trackCB.setToolTipText("Enable tracking target");
966
+ trackCB.addItemListener(this);
967
+
789968 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
790970 oeilCB.addItemListener(this);
791971
972
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
973
+ shadowCB.setToolTipText("When live compute shadows");
974
+ shadowCB.addItemListener(this);
975
+
976
+ panel.Return();
977
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
978
+ toggleTextureCB.setToolTipText("Load textures");
979
+ toggleTextureCB.addItemListener(this);
980
+
981
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
982
+ toggleSwitchCB.setToolTipText("Choose a single item");
983
+ toggleSwitchCB.addItemListener(this);
984
+
985
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
986
+ autokeepCB.setToolTipText("On structure change");
987
+ autokeepCB.addItemListener(this);
988
+
989
+ panel.Return();
990
+ if (Globals.ADVANCED)
991
+ {
792992 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
793993 lookAtCB.setToolTipText("Look-at target");
794994 lookAtCB.addItemListener(this);
995
+ }
795996
796997 }
797998
798999 cGridBag fill = new cGridBag();
799
-
8001000 fill.preferredHeight = 200;
1001
+ cGridBag fill2 = new cGridBag();
1002
+ fill2.preferredHeight = 200;
1003
+ cGridBag fill3 = new cGridBag();
1004
+ fill3.preferredHeight = 200;
8011005
8021006 panel.add(fill);
1007
+ panel.add(fill2);
1008
+ panel.add(fill3);
8031009
8041010 }
8051011
8061012 void EditObject(Object3D obj)
8071013 {
8081014 cRadio radioButton = new cRadio(obj.name);
1015
+
1016
+ // June 2019. Patch to avoid bug with transparency.
1017
+ radioButton.hadMaterial = obj.material != null;
1018
+ if (!radioButton.hadMaterial)
1019
+ {
1020
+ obj.material = new cMaterial();
1021
+ }
1022
+
8091023 radioButton.SetObject(obj);
810
- radioButton.layout = sevenButton;
1024
+ radioButton.layout = sixButton; // sevenButton;
8111025 radioButton.SetCamera(cameraView.renderCamera, false);
8121026 radioButton.addActionListener(this);
8131027 radioPanel.add(radioButton);
....@@ -817,6 +1031,8 @@
8171031
8181032 void SetupViews(ObjEditor oe)
8191033 {
1034
+ theFrame = this;
1035
+
8201036 oe.SetupViews();
8211037
8221038 System.out.println("SetupViews");
....@@ -825,23 +1041,28 @@
8251041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8261042 }
8271043
828
- JCheckBox liveCB;
829
- JCheckBox supportCB;
830
- JCheckBox localCB;
831
- JCheckBox crowdCB;
832
- JCheckBox smoothCB;
833
- JCheckBox fastCB;
834
- JCheckBox slowCB;
835
- JCheckBox boxCB;
836
- JCheckBox zoomBoxCB;
837
- JCheckBox trackCB;
838
- JCheckBox smoothfocusCB;
1044
+ cToggleButton liveCB;
1045
+ cCheckBox supportCB;
1046
+ cCheckBox localCB;
1047
+ cCheckBox crowdCB;
1048
+ cCheckBox smoothCB;
1049
+ cToggleButton fastCB;
1050
+ cCheckBox slowCB;
1051
+ cCheckBox boxCB;
1052
+ cCheckBox zoomBoxCB;
1053
+ cCheckBox freezeCB;
1054
+ //cToggleButton trackCB;
1055
+ cCheckBox trackCB;
1056
+ cCheckBox smoothfocusCB;
8391057 // JCheckBox speakerMocapCB;
840
- JCheckBox speakerCameraCB;
841
- JCheckBox speakerFocusCB;
842
- JCheckBox debugCB;
843
- JCheckBox oeilCB;
844
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
8451066
8461067 // static int COLOR = 1;
8471068 // static int MATERIAL = 2;
....@@ -849,9 +1070,9 @@
8491070
8501071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8511072
852
- JCheckBox colorCB;
853
- JCheckBox materialCB;
854
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
8551076
8561077 public void itemStateChanged(ItemEvent e)
8571078 {
....@@ -944,6 +1165,18 @@
9441165 {
9451166 cameraView.ToggleOeil();
9461167 }
1168
+ else if(e.getSource() == shadowCB)
1169
+ {
1170
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1171
+ }
1172
+ else if(e.getSource() == freezeCB)
1173
+ {
1174
+ Globals.FREEZEONMOVE ^= true;
1175
+ }
1176
+ else if(e.getSource() == autokeepCB)
1177
+ {
1178
+ Globals.REPLACEONMAKE ^= true;
1179
+ }
9471180 else if(e.getSource() == lookAtCB)
9481181 {
9491182 cameraView.ToggleLookAt();
....@@ -960,7 +1193,8 @@
9601193
9611194 /**/
9621195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
963
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
9641198 if ((path == null) || (path.getPathCount() <= 1)) {
9651199 // We can't move the root node or an empty selection
9661200 return;
....@@ -1023,8 +1257,6 @@
10231257 }
10241258 }
10251259
1026
- String string = (String) object;
1027
-
10281260 System.out.println("Transfer = " + object + "; drop : " + target);
10291261 // if( object instanceof java.io.File[])
10301262 // {
....@@ -1032,6 +1264,8 @@
10321264 // objEditor.DropFile((java.io.File[]) object, true);
10331265 // return;
10341266 // }
1267
+
1268
+ String string = object.toString();
10351269
10361270 // File path for Mac and Windows
10371271 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1077,23 +1311,33 @@
10771311
10781312 assert target == objEditor.jTree;
10791313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
10801315 try {
1081
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10821317 } catch (Exception e) {
10831318 System.out.println("destinationPath : " + destinationPath);
10841319 return;
10851320 }
10861321
1087
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
10881323 {
1324
+ Object3D child = (Object3D)group.selection.elementAt(i);
1325
+
1326
+ // Cannot move into itself
1327
+ if (child == destinationLeaf)
1328
+ return;
1329
+ }
1330
+
1331
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1332
+// {
10891333 loadClipboard(true);
10901334 objEditor.jTree.setSelectionPath(destinationPath);
10911335 pasteInto(false, false);
1092
- } else {
1093
- loadClipboard(false);
1094
- objEditor.jTree.setSelectionPath(destinationPath);
1095
- pasteInto(false, false); // true); // ???
1096
- }
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
10971341 }
10981342 public void dropActionChanged(DropTargetDragEvent dtde)
10991343 // Called if the user has modified the current drop gesture
....@@ -1198,22 +1442,30 @@
11981442 {
11991443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12001444 //heightFieldItem.addActionListener(this);
1201
- gridItem = menu.add(new MenuItem("Grid"));
1202
- gridItem.addActionListener(this);
1203
- rectoidItem = menu.add(new MenuItem("Box"));
1204
- rectoidItem.addActionListener(this);
1205
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1206
- ellipsoidItem.addActionListener(this);
1207
- coneItem = menu.add(new MenuItem("Cone"));
1208
- coneItem.addActionListener(this);
1209
- torusItem = menu.add(new MenuItem("Torus"));
1210
- torusItem.addActionListener(this);
1211
- superItem = menu.add(new MenuItem("Superellipsoid"));
1212
- superItem.addActionListener(this);
1445
+// gridItem = menu.add(new MenuItem("Grid"));
1446
+// gridItem.addActionListener(this);
1447
+// rectoidItem = menu.add(new MenuItem("Box"));
1448
+// rectoidItem.addActionListener(this);
1449
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1450
+// ellipsoidItem.addActionListener(this);
1451
+// coneItem = menu.add(new MenuItem("Cone"));
1452
+// coneItem.addActionListener(this);
1453
+// torusItem = menu.add(new MenuItem("Torus"));
1454
+// torusItem.addActionListener(this);
1455
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1456
+// superItem.addActionListener(this);
1457
+
1458
+ cameraItem = menu.add(new MenuItem("Camera"));
1459
+ cameraItem.addActionListener(this);
1460
+
1461
+ if (!Globals.ADVANCED)
1462
+ {
12131463 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12141464 kleinItem.addActionListener(this);
1215
- particleItem = menu.add(new MenuItem("Particle system"));
1216
- particleItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
12171469 if (Globals.ADVANCED)
12181470 {
12191471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1239,15 +1491,15 @@
12391491 }
12401492 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12411493 bezierItem.addActionListener(this);
1242
- overlayItem = menu.add(new MenuItem("Overlay"));
1243
- overlayItem.addActionListener(this);
1244
- lightItem = menu.add(new MenuItem("Light"));
1245
- lightItem.addActionListener(this);
1494
+// overlayItem = menu.add(new MenuItem("Overlay"));
1495
+// overlayItem.addActionListener(this);
1496
+// lightItem = menu.add(new MenuItem("Light"));
1497
+// lightItem.addActionListener(this);
12461498 menu.add("-");
12471499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12481500 //superLoopItem.addActionListener(this);
1249
- loopItem = menu.add(new MenuItem("Loop"));
1250
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
12511503 doubleItem = menu.add(new MenuItem("Fork"));
12521504 doubleItem.addActionListener(this);
12531505 if (Globals.ADVANCED)
....@@ -1263,6 +1515,9 @@
12631515 animationItem.addItemListener(this);
12641516 animationItem.setState(Globals.ANIMATION);
12651517
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
1520
+
12661521 menu.add("-");
12671522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12681523 parseverticesItem.addActionListener(this);
....@@ -1275,6 +1530,8 @@
12751530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12761531 reduce34MorphItem.addActionListener(this);
12771532 menu.add("-");
1533
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1534
+ memoryItem.addActionListener(this);
12781535 menu.add(computeAOItem = new MenuItem("Compute AO"));
12791536 computeAOItem.addActionListener(this);
12801537
....@@ -1283,8 +1540,6 @@
12831540 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12841541 mirrorItem.addActionListener(this);
12851542 menu.add("-");
1286
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1287
- memoryItem.addActionListener(this);
12881543 menu.add(analyzeItem = new MenuItem("Analyze"));
12891544 analyzeItem.addActionListener(this);
12901545 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1428,9 +1683,34 @@
14281683 shadow.material = new cMaterial(obj.material);
14291684 shadow.material.diffuse = 0.0001f;
14301685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
14311687
14321688 makeSomething(shadow);
14331689 }
1690
+
1691
+ private void ClearUnpinned()
1692
+ {
1693
+ //for (Object3D obj : listUI)
1694
+ for (int i=listUI.size(); --i>=0;)
1695
+ {
1696
+ Object3D obj = listUI.elementAt(i);
1697
+ if (!obj.pinned)
1698
+ {
1699
+ obj.CloseUI();
1700
+ listUI.remove(i);
1701
+ }
1702
+ }
1703
+ }
1704
+
1705
+ private void EditElement(Object3D elem, boolean newWindow)
1706
+ {
1707
+ // if (!(elem instanceof Composite))
1708
+ // newWindow = false;
1709
+ listUI.add(elem);
1710
+ elem.openEditWindow(this, newWindow); //, false);
1711
+ System.out.println("edit : " + elem);
1712
+ elem.editWindow.refreshContents(true); // ? new
1713
+ }
14341714
14351715 /**
14361716 * applyExample
....@@ -1675,7 +1955,7 @@
16751955 {
16761956 ScreenFit();
16771957 } else
1678
- if (source == switchItem)
1958
+ if (source == switchViewItem)
16791959 {
16801960 cVector v1 = new cVector();
16811961 cVector v2 = new cVector();
....@@ -1684,11 +1964,11 @@
16841964 objEditor.cameraView.renderCamera.setAim(v2, v1);
16851965 objEditor.cameraView.repaint();
16861966 } else
1687
- if (source == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
16881968 {
16891969 makeSomething(new Box());
16901970 } else
1691
- if (source == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
16921972 {
16931973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16941974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1767,27 +2047,27 @@
17672047
17682048 makeSomething(obj);
17692049 } else
1770
- if (source == gridItem)
2050
+ if (source == gridItem || source == gridButton)
17712051 {
17722052 makeSomething(new Grid());
17732053 } else
1774
- if (source == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
17752055 {
17762056 makeSomething(new Sphere());
17772057 } else
1778
- if (source == coneItem)
2058
+ if (source == coneItem || source == coneButton)
17792059 {
17802060 makeSomething(new Cone());
17812061 } else
1782
- if (source == torusItem)
2062
+ if (source == torusItem || source == torusButton)
17832063 {
17842064 makeSomething(new Torus());
17852065 } else
1786
- if (source == superItem)
2066
+ if (source == superItem || source == superButton)
17872067 {
17882068 makeSomething(new Superellipsoid());
17892069 } else
1790
- if (source == kleinItem)
2070
+ if (source == kleinItem || source == kleinButton)
17912071 {
17922072 makeSomething(new Klein());
17932073 } else
....@@ -1807,7 +2087,7 @@
18072087 {
18082088 makeSomething(new BezierSurface());
18092089 } else
1810
- if (source == overlayItem)
2090
+ if (source == overlayItem || source == overlayButton)
18112091 {
18122092 /*
18132093 Object3D obj = new BezierSurface(5,8);
....@@ -1855,7 +2135,7 @@
18552135 s.setup();
18562136 makeSomething(s);
18572137 } else
1858
- if (source == lightItem)
2138
+ if (source == lightItem || source == lightButton)
18592139 {
18602140 makeSomething(new Light());
18612141 } else
....@@ -1905,30 +2185,30 @@
19052185
19062186 group(g);
19072187 } else
1908
- if (source == loopItem)
2188
+ if (source == loopItem || source == loopButton)
19092189 {
19102190 Composite csg = new GroupLeaf();
19112191 csg.count = 5;
19122192 group(csg);
1913
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
19142194 csg.addChild(child);
19152195 child.addChild(csg);
19162196 } else
19172197 if (source == doubleItem)
19182198 {
1919
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
19202200 csg.count = 5;
19212201 group(csg);
1922
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
19232203 csg.addChild(child);
19242204 child.addChild(csg);
1925
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
19262206 csg.addChild(child);
19272207 child.addChild(csg);
19282208 } else
19292209 if (source == tripleItem)
19302210 {
1931
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
19322212 csg.count = 4;
19332213 group(csg);
19342214 Composite child = new cGroup();
....@@ -1978,17 +2258,45 @@
19782258 {
19792259 DumpObject();
19802260 } else
2261
+ if (source == minButton)
2262
+ {
2263
+ Minimize();
2264
+ } else
2265
+ if (source == maxButton)
2266
+ {
2267
+ Maximize();
2268
+ } else
2269
+ if (source == fullButton)
2270
+ {
2271
+ ToggleFullScreen();
2272
+ } else
19812273 if (source == undoButton)
19822274 {
2275
+ // Go to previous version
2276
+ //if (!Undo())
2277
+ //java.awt.Toolkit.getDefaultToolkit().beep();
19832278 Undo();
2279
+ } else
2280
+ if (source == restoreButton)
2281
+ {
2282
+ // Restore current version
2283
+ Restore();
2284
+ } else
2285
+ if (source == replaceButton)
2286
+ {
2287
+ // Overwrite current version
2288
+ Replace();
19842289 } else
19852290 if (source == redoButton)
19862291 {
2292
+ // Go to next version
19872293 Redo();
19882294 } else
19892295 if (source == saveButton)
19902296 {
1991
- Save();
2297
+ // Save a new version
2298
+ if (!Save(true))
2299
+ java.awt.Toolkit.getDefaultToolkit().beep();
19922300 } else
19932301 if (source == oneStepButton)
19942302 {
....@@ -1997,17 +2305,14 @@
19972305 } else
19982306 if (source == screenfitButton)
19992307 {
2000
- //Reload(lastConverter, lastFilename, true);
20012308 ScreenFit();
20022309 } else
20032310 if (source == screenfitpointButton)
20042311 {
2005
- //Reload(lastConverter, lastFilename, true);
20062312 ScreenFitPoint();
20072313 } else
20082314 if (source == snapobjectButton)
20092315 {
2010
- //Reload(lastConverter, lastFilename, true);
20112316 SnapObject();
20122317 } else
20132318 // if (event.getSource() == recompileButton)
....@@ -2371,7 +2676,7 @@
23712676 {
23722677 StepAll();
23732678 } else
2374
- if (source == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
23752680 {
23762681 //int indices[] = jList.getSelectedIndices();
23772682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2383,9 +2688,9 @@
23832688 {
23842689 ClearSelection(true);
23852690 } else
2386
- if (source == grabItem)
2691
+ if (source == grabItem || source == groupButton)
23872692 {
2388
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
23892694 } else
23902695 if (source == hideItem)
23912696 {
....@@ -2403,11 +2708,11 @@
24032708 {
24042709 makeSomething(new Camera());
24052710 } else
2406
- if (source == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
24072712 {
24082713 group(new Composite());
24092714 } else
2410
- if (source == randomItem)
2715
+ if (source == switchItem || source == switchButton)
24112716 {
24122717 RandomNode random = new RandomNode();
24132718 group(random);
....@@ -2509,7 +2814,7 @@
25092814 {
25102815 group(new cLinker());
25112816 } else
2512
- if (source == textureItem)
2817
+ if (source == textureItem || source == textureButton)
25132818 {
25142819 group(new TextureNode());
25152820 } else
....@@ -2529,17 +2834,30 @@
25292834 {
25302835 CastShadow(2);
25312836 } else
2532
- if (source == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
25332838 {
2534
- //ungroup();
2839
+ boolean hasRoot = false;
2840
+
25352841 for (int i=0; i<group.selection.size(); i++)
25362842 {
2537
- Ungroup(group.selection.get(i));
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
25382848 }
25392849
2540
- ClearSelection(false);
2541
-
2542
- refreshContents();
2850
+ if (!hasRoot)
2851
+ {
2852
+ for (int i=0; i<group.selection.size(); i++)
2853
+ {
2854
+ Ungroup(group.selection.get(i));
2855
+ }
2856
+
2857
+ ClearSelection(false);
2858
+
2859
+ refreshContents();
2860
+ }
25432861 } else
25442862 if (source == genUVItem)
25452863 {
....@@ -2840,7 +3158,7 @@
28403158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28413159 {
28423160 obj = (Object3D)e.nextElement();
2843
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
28443162 }
28453163
28463164 refreshContents();
....@@ -2856,6 +3174,31 @@
28563174
28573175 refreshContents();
28583176 } else
3177
+ if (source == embedTexturesItem)
3178
+ {
3179
+ Object3D obj;
3180
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3181
+ {
3182
+ obj = (Object3D)e.nextElement();
3183
+ obj.EmbedTextures(true);
3184
+ }
3185
+
3186
+ refreshContents();
3187
+ } else
3188
+ if (source == deEmbedTexturesItem)
3189
+ {
3190
+ Object3D obj;
3191
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3192
+ {
3193
+ obj = (Object3D)e.nextElement();
3194
+ obj.EmbedTextures(false);
3195
+ }
3196
+
3197
+ CameraPane.texturepigment.clear();
3198
+ CameraPane.texturebump.clear();
3199
+
3200
+ refreshContents();
3201
+ } else
28593202 if (source == flashSelectionButton)
28603203 {
28613204 CameraPane.flash = true;
....@@ -2867,6 +3210,10 @@
28673210 if (source == twoButton)
28683211 {
28693212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
28703217 // bug
28713218 //gridPanel.setDividerLocation(1.0);
28723219 //bigPanel.setDividerLocation(0.0);
....@@ -2899,10 +3246,31 @@
28993246 bigThree.ClearUI();
29003247 bigThree.add(centralPanel);
29013248 bigThree.FlushUI();
3249
+
3250
+ cameraView.requestFocusInWindow();
3251
+
3252
+// refreshContents(true);
3253
+//
3254
+// try
3255
+// {
3256
+// java.awt.Robot bot = new java.awt.Robot();
3257
+// int mask = InputEvent.BUTTON1_MASK;
3258
+// bot.mouseMove(100, 100);
3259
+// bot.mousePress(mask);
3260
+// bot.mouseRelease(mask);
3261
+// }
3262
+// catch (Exception e)
3263
+// {
3264
+//
3265
+// }
3266
+
29023267 } else
29033268 if (source == threeButton)
29043269 {
29053270 radio.layout = threeButton;
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
29063274
29073275 // bigThree.remove(scenePanel);
29083276 // bigThree.remove(centralPanel);
....@@ -2935,10 +3303,15 @@
29353303 bigThree.add(centralPanel);
29363304 bigThree.add(XYZPanel);
29373305 bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
29383308 } else
29393309 if (source == fourButton)
29403310 {
29413311 radio.layout = fourButton;
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
29423315
29433316 // bigThree.remove(scenePanel);
29443317 // bigThree.remove(centralPanel);
....@@ -2970,10 +3343,15 @@
29703343 bigThree.ClearUI();
29713344 bigThree.add(scenePanel);
29723345 bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
29733348 } else
29743349 if (source == sixButton)
29753350 {
29763351 radio.layout = sixButton;
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
29773355
29783356 // bigThree.remove(scenePanel);
29793357 // bigThree.remove(centralPanel);
....@@ -3006,10 +3384,15 @@
30063384 bigThree.add(scenePanel);
30073385 bigThree.add(centralPanel);
30083386 bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
30093389 } else
30103390 if (source == sevenButton)
30113391 {
30123392 radio.layout = sevenButton;
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
30133396
30143397 // bigThree.remove(scenePanel);
30153398 // bigThree.remove(centralPanel);
....@@ -3043,6 +3426,8 @@
30433426 bigThree.add(centralPanel);
30443427 bigThree.add(XYZPanel);
30453428 bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
30463431 } else
30473432 if (source == rootButton)
30483433 {
....@@ -3054,6 +3439,7 @@
30543439 EditObject(obj);
30553440 }
30563441
3442
+ cameraView.requestFocusInWindow();
30573443 refreshContents(true);
30583444 } else
30593445 if (source == closeButton)
....@@ -3063,22 +3449,37 @@
30633449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30643450 {
30653451 ab = (cRadio)e.nextElement();
3066
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30673453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
30683460 buttonGroup.remove(ab);
30693461 radioPanel.remove(ab);
30703462
3071
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
30723465 // ab.GetObject().objectUI = null; // ?????????
30733466
30743467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30753468 break;
30763469 }
30773470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
30783473 refreshContents(true);
30793474 } else
30803475 if (source == editItem || source == editButton)
30813476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
30823483 EditSelection(false);
30833484 } else
30843485 if (source == uneditButton)
....@@ -3088,6 +3489,7 @@
30883489 Object3D child = (Object3D)e.nextElement();
30893490 if(child.editWindow != null)
30903491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
30913493 child.CloseUI();
30923494 listUI.remove(child);
30933495
....@@ -3104,6 +3506,7 @@
31043506 //copy.ClearUI();
31053507 for (Object3D obj : listUI)
31063508 {
3509
+ obj.pinned = false;
31073510 obj.CloseUI();
31083511 }
31093512 listUI.clear();
....@@ -3113,7 +3516,7 @@
31133516 {
31143517 assert(copy == group);
31153518
3116
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
31173520
31183521 for (Object3D obj : listUI)
31193522 {
....@@ -3162,6 +3565,9 @@
31623565 }
31633566
31643567 copy = group;
3568
+
3569
+ SetUndoStates();
3570
+
31653571 //Globals.theRenderer.object = group;
31663572 if(!useclient)
31673573 {
....@@ -3179,7 +3585,8 @@
31793585 }
31803586
31813587 // fix "+" issue
3182
- group.editWindow = this;
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
31833590
31843591 /*
31853592 currentLayout = radio.layout;
....@@ -3187,18 +3594,27 @@
31873594 currentLayout = sevenButton;
31883595 */
31893596 radio.layout.doClick();
3597
+
3598
+ ClearUnpinned();
3599
+ //Grafreed.Assert(group != null);
3600
+ //Grafreed.Assert(group.selection != null);
3601
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3602
+ if (group.selection == null || group.selection.size() == 1)
3603
+ EditSelection(false);
31903604 keepparent = group.parent;
31913605 // PARENT = NULL or not???
31923606 //group.parent = null; // ROOT
31933607 //group.attributes = -1;
31943608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
31953611 refreshContents(true);
31963612 } else if (event.getSource() == editCameraItem)
31973613 {
31983614 cameraView.ProtectCamera();
31993615 cameraView.repaint();
32003616 return;
3201
- } else if (event.getSource() == revertCameraItem)
3617
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
32023618 {
32033619 cameraView.RevertCamera();
32043620 cameraView.repaint();
....@@ -3215,7 +3631,6 @@
32153631 }
32163632
32173633 boolean useclient = false;
3218
- cRadio radio;
32193634
32203635 void ToggleRoot()
32213636 {
....@@ -3778,7 +4193,7 @@
37784193
37794194 try
37804195 {
3781
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4196
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
37824197 }
37834198 catch (Exception e)
37844199 {
....@@ -4253,28 +4668,25 @@
42534668 // }
42544669 // }
42554670
4256
- static boolean allparams = true;
4257
-
4258
- static Vector<Object3D> listUI = new Vector<Object3D>();
4259
-
42604671 void EditSelection(boolean newWindow)
42614672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
42624679 // aConstraints.gridy = 0;
42634680 for (int i=0; i<group.selection.size(); i++)
42644681 {
42654682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
42664683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4267
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
42684685
42694686 Object3D elem = (Object3D)group.selection.elementAt(i);
42704687 if(elem != group || !newWindow)
42714688 {
4272
- // if (!(elem instanceof Composite))
4273
- // newWindow = false;
4274
- listUI.add(elem);
4275
- elem.openEditWindow(this, newWindow); //, false);
4276
- System.out.println("edit : " + elem);
4277
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
42784690 }
42794691 }
42804692 }
....@@ -4349,7 +4761,8 @@
43494761 //new Exception().printStackTrace();
43504762
43514763 freezemodel = true;
4352
-
4764
+ ClearUnpinned();
4765
+
43534766 /**/
43544767 //switch (event.id)
43554768 {
....@@ -4382,7 +4795,7 @@
43824795 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43834796 // a camera
43844797 {
4385
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4798
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
43864799 {
43874800 CameraPane.camerachangeframe = 0; // don't refuse it
43884801 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4391,6 +4804,13 @@
43914804 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43924805 }
43934806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
43944814 refreshContents();
43954815 //return true;
43964816 }
....@@ -4400,9 +4820,18 @@
44004820 freezemodel = false;
44014821 }
44024822
4823
+ void SetPinStates(boolean enabled)
4824
+ {
4825
+ editButton.setEnabled(enabled);
4826
+ uneditButton.setEnabled(enabled);
4827
+ unselectButton.setEnabled(enabled);
4828
+ flashSelectionButton.setEnabled(enabled);
4829
+ }
4830
+
44034831 void refreshContents(boolean cp)
44044832 {
4405
- if (!Globals.MOUSEDRAGGED)
4833
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4834
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
44064835 {
44074836 objEditor.ClearInfo(); // .GetMaterial());
44084837
....@@ -4501,7 +4930,8 @@
45014930
45024931 if (cut)
45034932 {
4504
- Save();
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
45054935 //int indices[] = jList.getSelectedIndices();
45064936 //for (int i = indices.length - 1; i >= 0; i--)
45074937 //jList.remove(indices[i]);
....@@ -4604,6 +5034,10 @@
46045034
46055035 void paste(boolean expand)
46065036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
46075041 // if (GrafreeD.clipboard == null)
46085042 // return;
46095043 boolean first = true;
....@@ -4663,6 +5097,7 @@
46635097 Grafreed.clipboard.get(0).parent = keepparent;
46645098 }
46655099
5100
+ Globals.REPLACEONMAKE = keep;
46665101 ResetModel();
46675102 refreshContents();
46685103 }
....@@ -4798,6 +5233,10 @@
47985233
47995234 void group(Object3D csg, boolean grab)
48005235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
48015240 if (//false) // why??
48025241 !group.selection.isEmpty())
48035242 {
....@@ -4911,10 +5350,15 @@
49115350 //node.add(csg);
49125351 //makeSomething(node);
49135352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
49145354 }
49155355
49165356 void Ungroup(Object3D g)
49175357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
49185362 if (g instanceof HiddenObject)
49195363 {
49205364 HiddenObject h = (HiddenObject) g;
....@@ -4931,6 +5375,7 @@
49315375 objEditor.makeSomething(g.get(i), false);
49325376 }
49335377 }
5378
+ Globals.REPLACEONMAKE = keep;
49345379 }
49355380
49365381 void ungroup()
....@@ -5219,10 +5664,28 @@
52195664 cButton clearpanelButton;
52205665 cButton unselectButton;
52215666
5667
+ cButton restoreCameraButton;
5668
+
52225669 cButton saveButton;
5223
- cButton undoButton;
5224
- cButton redoButton;
52255670 cButton oneStepButton;
5671
+
5672
+ cButton groupButton;
5673
+ cButton ungroupButton;
5674
+ cButton compositeButton;
5675
+ cButton switchButton;
5676
+ cButton loopButton;
5677
+ cButton textureButton;
5678
+
5679
+ cButton gridButton;
5680
+ cButton boxButton;
5681
+ cButton sphereButton;
5682
+ cButton coneButton;
5683
+ cButton torusButton;
5684
+ cButton superButton;
5685
+ cButton kleinButton;
5686
+ cButton particlesButton;
5687
+ cButton overlayButton;
5688
+ cButton lightButton;
52265689
52275690 cButton screenfitButton;
52285691 cButton screenfitpointButton;
....@@ -5235,14 +5698,6 @@
52355698
52365699 cButton setsupportButton;
52375700
5238
- cButton twoButton;
5239
- cButton sixButton;
5240
- cButton threeButton;
5241
- cButton sevenButton;
5242
- cButton fourButton; // full panel
5243
- cButton oneButton; // full XYZ
5244
- //cButton currentLayout;
5245
-
52465701 //
52475702 //Composite
52485703 Object3D // to do !!
....@@ -5252,11 +5707,11 @@
52525707 //JTree jTree;
52535708 private MenuItem lookAtItem;
52545709 private MenuItem lookFromItem;
5255
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
52565711 private MenuItem cutItem;
52575712 private MenuItem undoItem;
52585713 private MenuItem redoItem;
5259
- private MenuItem duplicateItem;
5714
+ private JMenuItem duplicateItem;
52605715 private MenuItem cloneItem;
52615716 private MenuItem cloneSupportItem;
52625717 private MenuItem overwriteGeoItem;
....@@ -5284,7 +5739,7 @@
52845739 private MenuItem pasteLinkItem;
52855740 private MenuItem pasteCloneItem;
52865741 private MenuItem pasteExpandItem;
5287
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
52885743 private MenuItem clearAllItem;
52895744 private MenuItem genUVItem;
52905745 private MenuItem genNormalsMESHItem;
....@@ -5344,7 +5799,7 @@
53445799 private MenuItem frontItem;
53455800 private MenuItem cameraItem;
53465801 private MenuItem compositeItem;
5347
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
53485803 private MenuItem physicsItem;
53495804 private MenuItem frameselectorItem;
53505805 private MenuItem scriptNodeItem;
....@@ -5368,6 +5823,8 @@
53685823 private MenuItem attachBumpItem;
53695824 private MenuItem detachBumpItem;
53705825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
53715828
53725829 private MenuItem particleItem;
53735830 private MenuItem ragdollItem;
....@@ -5418,5 +5875,5 @@
54185875
54195876 Menu cameraMenu;
54205877 MenuItem editCameraItem;
5421
- MenuItem revertCameraItem;
5878
+ MenuItem restoreCameraItem;
54225879 }