Normand Briere
2019-05-05 623dc0fa8cbd9473830a1786f6d49fa808a09439
GroupEditor.java
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -150,6 +150,8 @@
150150
151151 void SetupMenu2(ObjEditor oe)
152152 {
153
+ if (Globals.ADVANCED)
154
+ {
153155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,17 +163,21 @@
161163 lookAtItem.addActionListener(this);
162164 //lookFromItem.addActinoListener(this);
163165 //switchItem.addActionListener(this);
166
+ }
167
+
164168 Menu menu;
165169 oe.menuBar.add(menu = new Menu("Edit"));
166170 //editItem = menu.add(new MenuItem("Edit"));
167171 //editItem.addActionListener(this);
168172 duplicateItem = menu.add(new MenuItem("Duplicate"));
169173 duplicateItem.addActionListener(this);
170
- menu.add("-");
171174 cloneItem = menu.add(new MenuItem("Clone"));
172175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
173178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174179 cloneSupportItem.addActionListener(this);
180
+ }
175181 menu.add("-");
176182 cutItem = menu.add(new MenuItem("Cut"));
177183 cutItem.addActionListener(this);
....@@ -179,18 +185,31 @@
179185 copyItem.addActionListener(this);
180186 pasteItem = menu.add(new MenuItem("Paste"));
181187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
182193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183194 pasteLinkItem.addActionListener(this);
184195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185196 pasteCloneItem.addActionListener(this);
186197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
188200 clearItem = menu.add(new MenuItem("Clear"));
189201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
190206 clearAllItem = menu.add(new MenuItem("Clear All"));
191207 clearAllItem.addActionListener(this);
208
+ }
192209
193210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
194213 resetMeshItem = menu.add(new MenuItem("Reset All"));
195214 resetMeshItem.addActionListener(this);
196215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -200,6 +219,7 @@
200219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201220 resetreferencesItem.addActionListener(this);
202221 menu.add("-");
222
+ }
203223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204224 overwriteGeoItem.addActionListener(this);
205225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +231,26 @@
211231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212232 overwriteUVItem.addActionListener(this);
213233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
214236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215237 generateMeshItem.addActionListener(this);
216238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217239 poseMeshItem.addActionListener(this);
218240 menu.add("-");
241
+ }
219242 resetsupportItem = menu.add(new MenuItem("Reset support"));
220243 resetsupportItem.addActionListener(this);
221244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222245 linkverticesItem.addActionListener(this);
223246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
225251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226252 setMasterItem.addActionListener(this);
253
+ }
227254
228255 oe.menuBar.add(menu = new Menu("Group"));
229256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,7 +261,7 @@
234261 frontItem.addActionListener(this);
235262 compositeItem = menu.add(new MenuItem("Composite"));
236263 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238265 hideItem.addActionListener(this);
239266 ungroupItem = menu.add(new MenuItem("Ungroup"));
240267 ungroupItem.addActionListener(this);
....@@ -245,16 +272,21 @@
245272 switchGeoItem.addActionListener(this);
246273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
247274 switchTransfoItem.addActionListener(this);
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
276
+ morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
248281 physicsItem = menu.add(new MenuItem("Physics"));
249282 physicsItem.addActionListener(this);
250283 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251284 frameselectorItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
253
- morphItem.addActionListener(this);
254285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255286 scriptNodeItem.addActionListener(this);
256287 cameraItem = menu.add(new MenuItem("Camera"));
257288 cameraItem.addActionListener(this);
289
+ }
258290
259291 oe.menuBar.add(menu = new Menu("Object"));
260292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -269,14 +301,18 @@
269301 shadowYItem.addActionListener(this);
270302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
271303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
272307 linkerItem = menu.add(new MenuItem("Linker"));
273308 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276309 attributeItem = menu.add(new MenuItem("Attribute"));
277310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
278313 pointflowItem = menu.add(new MenuItem("Point Flow"));
279314 pointflowItem.addActionListener(this);
315
+ }
280316 menu.add("-");
281317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282318 resetTransformItem.addActionListener(this);
....@@ -294,8 +330,11 @@
294330 genNormalsCADItem.addActionListener(this);
295331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
297335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298336 genNormalsMINEItem.addActionListener(this);
337
+ }
299338 stripifyItem = menu.add(new MenuItem("Stripify"));
300339 stripifyItem.addActionListener(this);
301340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,10 +356,14 @@
317356 reduce34MeshItem.addActionListener(this);
318357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319358 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
324367
325368 oe.menuBar.add(menu = new Menu("Attributes"));
326369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -330,10 +373,13 @@
330373 liveleavesItem.addActionListener(this);
331374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
333378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334379 supportleavesItem.addActionListener(this);
335380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336381 unsupportleavesItem.addActionListener(this);
382
+ }
337383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338384 hideleavesItem.addActionListener(this);
339385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,6 +422,8 @@
376422 sortbysizeItem.addActionListener(this);
377423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
379427 menu.add("-");
380428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381429 extractGeometriesItem.addActionListener(this);
....@@ -385,20 +433,23 @@
385433 shareGeometriesItem.addActionListener(this);
386434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387435 mergeGeometriesItem.addActionListener(this);
436
+ }
388437
389438 oe.menuBar.add(menu = new Menu("Insert"));
390439 buildCreateMenu(menu);
391440
392
-
393441 oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
399443 importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
401446 import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
402453
403454 oe.menuBar.add(menu = new Menu("Tools"));
404455 buildToolsMenu(menu);
....@@ -440,6 +491,10 @@
440491 liveCB.setToolTipText("Enabled animation");
441492 liveCB.addItemListener(this);
442493
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495
+ oneStepButton.setToolTipText("Animate one step forward");
496
+ oneStepButton.addActionListener(this);
497
+
443498 oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444499 fastCB.setToolTipText("Fast mode");
445500 fastCB.addItemListener(this);
....@@ -448,7 +503,7 @@
448503 trackCB.setToolTipText("Enable tracking");
449504 trackCB.addItemListener(this);
450505
451
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
452507 screenfitButton.setToolTipText("Screen fit");
453508 screenfitButton.addActionListener(this);
454509
....@@ -457,39 +512,39 @@
457512
458513 if (Globals.ADVANCED)
459514 {
460
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
461516 snapobjectButton.addActionListener(this);
462517 snapobjectButton.setToolTipText("Snap Object");
463518 }
464519
465
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
466521 flashSelectionButton.setToolTipText("Show selection");
467522 flashSelectionButton.addActionListener(this);
468523
469524 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
470525
471
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
472527 twoButton.setToolTipText("Show center view only");
473528 twoButton.addActionListener(this);
474
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
475530 fourButton.addActionListener(this);
476531 fourButton.setToolTipText("Show left panel only");
477
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
478533 sixButton.setToolTipText("2-column layout left");
479534 sixButton.addActionListener(this);
480
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
481536 threeButton.setToolTipText("2-column layout right");
482537 threeButton.addActionListener(this);
483
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
484539 sevenButton.setToolTipText("3-column layout");
485540 sevenButton.addActionListener(this);
486541 //
487542
488
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
489544 rootButton.setToolTipText("Edit selection in new tab");
490545 rootButton.addActionListener(this);
491546
492
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
493548 closeButton.setToolTipText("Close tab");
494549 closeButton.addActionListener(this);
495550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -497,23 +552,23 @@
497552
498553 cGridBag commandsPanel = new cGridBag();
499554
500
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
555
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
501556 editButton.setToolTipText("Edit selection");
502557 editButton.addActionListener(this);
503558
504
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
505560 uneditButton.setToolTipText("Unedit selection");
506561 uneditButton.addActionListener(this);
507562
508
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
563
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
+ allParamsButton.setToolTipText("Edit all params");
565
+ allParamsButton.addActionListener(this);
566
+
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
509568 clearPanelButton.setToolTipText("Clear edit panel");
510569 clearPanelButton.addActionListener(this);
511570
512
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
- allParamsButton.setToolTipText("All params??");
514
- allParamsButton.addActionListener(this);
515
-
516
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
571
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517572 unselectButton.setToolTipText("Unselect");
518573 unselectButton.addActionListener(this);
519574
....@@ -588,8 +643,18 @@
588643
589644 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
590645 {
646
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
647
+ boxCB.setToolTipText("Display bounding boxes");
648
+ boxCB.addItemListener(this);
649
+
650
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
652
+ zoomBoxCB.addItemListener(this);
653
+
654
+ if (Globals.ADVANCED)
655
+ {
591656 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
592
- supportCB.setToolTipText("Enabled rigging");
657
+ supportCB.setToolTipText("Enable rigging");
593658 supportCB.addItemListener(this);
594659
595660 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
....@@ -607,14 +672,6 @@
607672 slowCB.setToolTipText("Smooth interpolation");
608673 slowCB.addItemListener(this);
609674
610
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
611
- boxCB.setToolTipText("Display bounding boxes");
612
- boxCB.addItemListener(this);
613
-
614
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
615
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
616
- zoomBoxCB.addItemListener(this);
617
-
618675 // constraints.gridy += 1;
619676 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
620677 // speakerMocapCB.addItemListener(this);
....@@ -645,6 +702,8 @@
645702 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
646703 lookAtCB.setToolTipText("Look-at target");
647704 lookAtCB.addItemListener(this);
705
+
706
+ }
648707
649708 cGridBag fill = new cGridBag();
650709
....@@ -881,7 +940,9 @@
881940 // objEditor.DropFile((java.io.File[]) object, true);
882941 // return;
883942 // }
884
- if (string.charAt(0) == '/')
943
+
944
+ // File path for Mac and Windows
945
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
885946 {
886947 // file(s)
887948 String[] names = string.split("\n");
....@@ -908,7 +969,7 @@
908969
909970 flashIt = false;
910971 CameraPane pane = (CameraPane) target;
911
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
972
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
912973 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
913974
914975 if (group.selection.size() == 1)
....@@ -935,11 +996,11 @@
935996 {
936997 loadClipboard(true);
937998 objEditor.jTree.setSelectionPath(destinationPath);
938
- pasteInto(false);
999
+ pasteInto(false, false);
9391000 } else {
9401001 loadClipboard(false);
9411002 objEditor.jTree.setSelectionPath(destinationPath);
942
- pasteInto(false); // true); // ???
1003
+ pasteInto(false, false); // true); // ???
9431004 }
9441005 }
9451006 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1061,27 +1122,33 @@
10611122 kleinItem.addActionListener(this);
10621123 particleItem = menu.add(new MenuItem("Particle system"));
10631124 particleItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10641127 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10651128 ragdollItem.addActionListener(this);
10661129 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10671130 ragdoll2Item.addActionListener(this);
1131
+ }
10681132 menu.add("-");
1069
- meshItem = menu.add(new MenuItem("Mesh"));
1133
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10701134 meshItem.addActionListener(this);
10711135 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10721136 // meshGroupItem.addActionListener(this);
1137
+ if (Globals.ADVANCED)
1138
+ {
10731139 springItem = menu.add(new MenuItem("Spring"));
10741140 springItem.addActionListener(this);
10751141 flagItem = menu.add(new MenuItem("Flag"));
10761142 flagItem.addActionListener(this);
1077
- bezierItem = menu.add(new MenuItem("Patch"));
1078
- bezierItem.addActionListener(this);
1079
- checkerItem = menu.add(new MenuItem("Checker"));
1080
- checkerItem.addActionListener(this);
10811143 blobItem = menu.add(new MenuItem("Blob"));
10821144 blobItem.addActionListener(this);
10831145 latheItem = menu.add(new MenuItem("Lathe"));
10841146 latheItem.addActionListener(this);
1147
+ }
1148
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1149
+ bezierItem.addActionListener(this);
1150
+ overlayItem = menu.add(new MenuItem("Overlay"));
1151
+ overlayItem.addActionListener(this);
10851152 lightItem = menu.add(new MenuItem("Light"));
10861153 lightItem.addActionListener(this);
10871154 menu.add("-");
....@@ -1091,8 +1158,11 @@
10911158 loopItem.addActionListener(this);
10921159 doubleItem = menu.add(new MenuItem("Fork"));
10931160 doubleItem.addActionListener(this);
1161
+ if (Globals.ADVANCED)
1162
+ {
10941163 tripleItem = menu.add(new MenuItem("Trident"));
10951164 tripleItem.addActionListener(this);
1165
+ }
10961166 }
10971167
10981168 void buildToolsMenu(Menu menu)
....@@ -1106,19 +1176,21 @@
11061176 parseverticesItem.addActionListener(this);
11071177 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11081178 textureFieldItem.addActionListener(this);
1109
- alignItem = menu.add(new MenuItem("Align"));
1179
+ alignItem = menu.add(new MenuItem("Align Objects"));
11101180 alignItem.addActionListener(this);
1111
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1112
- mirrorItem.addActionListener(this);
11131181 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11141182 reduceMorphItem.addActionListener(this);
11151183 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11161184 reduce34MorphItem.addActionListener(this);
1117
-
1185
+ menu.add("-");
11181186 menu.add(computeAOItem = new MenuItem("Compute AO"));
11191187 computeAOItem.addActionListener(this);
1120
- menu.add("-");
11211188
1189
+ if (Globals.ADVANCED)
1190
+ {
1191
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1192
+ mirrorItem.addActionListener(this);
1193
+ menu.add("-");
11221194 menu.add(memoryItem = new MenuItem("Memory Usage"));
11231195 memoryItem.addActionListener(this);
11241196 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1141,6 +1213,7 @@
11411213 menu.add("-");
11421214 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11431215 editScriptItem.addActionListener(this);
1216
+ }
11441217 }
11451218
11461219 void ScreenFit()
....@@ -1469,9 +1542,9 @@
14691542
14701543 void Overwrite(int mask)
14711544 {
1472
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1545
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14731546 {
1474
- Object3D content = GrafreeD.clipboard.get(0);
1547
+ Object3D content = Grafreed.clipboard.get(0);
14751548
14761549 if (content instanceof cGroup && ((cGroup)content).transientlink )
14771550 content = ((cGroup)content).get(0);
....@@ -1642,7 +1715,7 @@
16421715 {
16431716 makeSomething(new BezierSurface());
16441717 } else
1645
- if (source == checkerItem)
1718
+ if (source == overlayItem)
16461719 {
16471720 /*
16481721 Object3D obj = new BezierSurface(5,8);
....@@ -1791,7 +1864,15 @@
17911864 } else
17921865 if (source == importOBJItem)
17931866 {
1794
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1867
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
+ browser.setVisible(true);
1870
+ String filename = browser.getFile();
1871
+ if (filename != null && filename.length() > 0)
1872
+ {
1873
+ String fullname = browser.getDirectory() + filename;
1874
+ makeSomething(ReadOBJ(fullname), true);
1875
+ }
17951876 } else
17961877 if (source == computeAOItem)
17971878 {
....@@ -1811,7 +1892,7 @@
18111892 if (source == invariantsItem)
18121893 {
18131894 System.out.println("Invariants:");
1814
- GrafreeD.grafreeD.universe.invariants();
1895
+ Grafreed.grafreeD.universe.invariants();
18151896 } else
18161897 if (source == memoryItem)
18171898 {
....@@ -1829,6 +1910,11 @@
18291910 if (source == dumpItem)
18301911 {
18311912 DumpObject();
1913
+ } else
1914
+ if (source == oneStepButton)
1915
+ {
1916
+ Globals.ONESTEP = true;
1917
+ cameraView.repaint();
18321918 } else
18331919 if (source == screenfitButton)
18341920 {
....@@ -1881,10 +1967,10 @@
18811967 } else
18821968 if (source == duplicateItem)
18831969 {
1884
- Object3D keep = GrafreeD.clipboard;
1970
+ Object3D keep = Grafreed.clipboard;
18851971 loadClipboard(false);
18861972 paste(false);
1887
- GrafreeD.clipboard = keep;
1973
+ Grafreed.clipboard = keep;
18881974 } else
18891975 if (source == cloneItem)
18901976 {
....@@ -1902,13 +1988,17 @@
19021988 {
19031989 paste(false);
19041990 } else
1991
+ if (source == pasteIntoItem)
1992
+ {
1993
+ pasteInto(true, false);
1994
+ } else
19051995 if (source == pasteLinkItem)
19061996 {
1907
- pasteInto(false);
1997
+ pasteInto(false, false);
19081998 } else
19091999 if (source == pasteCloneItem)
19102000 {
1911
- pasteInto(true);
2001
+ pasteInto(true, true);
19122002 } else
19132003 if (source == pasteExpandItem)
19142004 {
....@@ -2100,9 +2190,9 @@
21002190 // group.selection.get(0).setMasterThis(content); // should be identity
21012191 // refreshContents();
21022192 // }
2103
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2193
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21042194 {
2105
- Object3D content = GrafreeD.clipboard.get(0);
2195
+ Object3D content = Grafreed.clipboard.get(0);
21062196
21072197 if (content instanceof cGroup && ((cGroup)content).transientlink )
21082198 content = ((cGroup)content).get(0);
....@@ -2110,11 +2200,11 @@
21102200 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21112201 for (int i=0; i<group.selection.size(); i++)
21122202 {
2113
- boolean random = CameraPane.RANDOM;
2114
- CameraPane.RANDOM = false; // parse all random nodes
2203
+ boolean random = CameraPane.SWITCH;
2204
+ CameraPane.SWITCH = false; // parse all random nodes
21152205 group.selection.get(i).linkVerticesThis(content);
21162206 // group.selection.get(i).setMasterThis(content); // should be identity
2117
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21182208 }
21192209 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21202210 refreshContents();
....@@ -2124,20 +2214,20 @@
21242214 {
21252215 for (int i=0; i<group.selection.size(); i++)
21262216 {
2127
- boolean random = CameraPane.RANDOM;
2128
- CameraPane.RANDOM = false; // parse all random nodes
2217
+ boolean random = CameraPane.SWITCH;
2218
+ CameraPane.SWITCH = false; // parse all random nodes
21292219 group.selection.get(i).linkVerticesThis(null);
2130
- CameraPane.RANDOM = random;
2220
+ CameraPane.SWITCH = random;
21312221 }
21322222
21332223 refreshContents();
21342224 } else
21352225 if (source == relinkverticesItem)
21362226 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2227
+ boolean random = CameraPane.SWITCH;
2228
+ CameraPane.SWITCH = false; // parse all random nodes
21392229 group.selection.RelinkToSupport();
2140
- CameraPane.RANDOM = random;
2230
+ CameraPane.SWITCH = random;
21412231
21422232 refreshContents();
21432233 } else
....@@ -2152,9 +2242,9 @@
21522242 } else
21532243 if (source == setMasterItem)
21542244 {
2155
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2245
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21562246 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2247
+ Object3D content = Grafreed.clipboard.get(0);
21582248
21592249 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602250 content = ((cGroup)content).get(0);
....@@ -2167,9 +2257,9 @@
21672257 {
21682258 if (group.selection.size() == 1)
21692259 {
2170
- if (GrafreeD.clipboard.size() == 1)
2260
+ if (Grafreed.clipboard.size() == 1)
21712261 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2262
+ Object3D content = Grafreed.clipboard.get(0);
21732263
21742264 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752265 content = ((cGroup)content).get(0);
....@@ -2892,7 +2982,7 @@
28922982
28932983 child.editWindow = null; // ???????????
28942984 }
2895
- objEditor.ctrlPanel.validate();
2985
+ objEditor.ctrlPanel.FlushUI();
28962986 //objEditor.jTree.clearSelection();
28972987 //objEditor.ResetSliders();
28982988 refreshContents(true);
....@@ -3248,9 +3338,9 @@
32483338 obj = (Object3D)e.nextElement();
32493339
32503340 System.out.println("Object is: " + obj);
3251
- GrafreeD.AnalyzeObject(obj);
3341
+ Grafreed.AnalyzeObject(obj);
32523342 System.out.println("Boundary rep: " + obj.bRep);
3253
- GrafreeD.AnalyzeObject(obj.bRep);
3343
+ Grafreed.AnalyzeObject(obj.bRep);
32543344
32553345 // System.err.println((size/1024) + " KB is the size of " + obj);
32563346 }
....@@ -3464,8 +3554,8 @@
34643554
34653555 void ParseVertices()
34663556 {
3467
- boolean epsequal = GrafreeD.epsequal;
3468
- GrafreeD.epsequal = true;
3557
+ boolean epsequal = Grafreed.epsequal;
3558
+ Grafreed.epsequal = true;
34693559
34703560 for (int i=0; i<group.selection.size(); i++)
34713561 {
....@@ -3490,7 +3580,7 @@
34903580 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34913581 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34923582
3493
- g.add(GrafreeD.clipboard);
3583
+ g.add(Grafreed.clipboard);
34943584
34953585 buffer.add(g);
34963586 }
....@@ -3505,7 +3595,7 @@
35053595 makeSomething(buffer, i==group.selection.size()-1);
35063596 }
35073597
3508
- GrafreeD.epsequal = epsequal;
3598
+ Grafreed.epsequal = epsequal;
35093599
35103600 refreshContents();
35113601 }
....@@ -3611,11 +3701,11 @@
36113701
36123702 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36133703
3614
- boolean random = CameraPane.RANDOM;
3615
- CameraPane.RANDOM = false; // parse all random nodes
3704
+ boolean random = CameraPane.SWITCH;
3705
+ CameraPane.SWITCH = false; // parse all random nodes
36163706 lowres.linkVerticesThis(null);
36173707 lowres.linkVerticesThis(sn);
3618
- CameraPane.RANDOM = random;
3708
+ CameraPane.SWITCH = random;
36193709
36203710 System.err.flush();
36213711
....@@ -3655,7 +3745,7 @@
36553745 return;
36563746
36573747 Object3D poses = group.selection.get(0);
3658
- Object3D ref = GrafreeD.clipboard.get(0);
3748
+ Object3D ref = Grafreed.clipboard.get(0);
36593749
36603750 Object3D newgroup = new Object3D("Po:" + poses.name);
36613751
....@@ -3849,9 +3939,9 @@
38493939
38503940 void ClipMesh()
38513941 {
3852
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3942
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38533943 {
3854
- Object3D content = GrafreeD.clipboard.get(0);
3944
+ Object3D content = Grafreed.clipboard.get(0);
38553945
38563946 if (content instanceof cGroup && ((cGroup)content).transientlink )
38573947 content = ((cGroup)content).get(0);
....@@ -3860,7 +3950,7 @@
38603950 // {
38613951 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38623952 // }
3863
- group.selection.ClipMesh(GrafreeD.clipboard);
3953
+ group.selection.ClipMesh(Grafreed.clipboard);
38643954 }
38653955 // group.selection.ClipMesh(GrafreeD.clipboard);
38663956 System.out.println("DONE.");
....@@ -4200,12 +4290,12 @@
42004290 {
42014291 if (group.selection.isEmpty())
42024292 return;
4203
- GrafreeD.clipboardIsTempGroup = false;
4293
+ Grafreed.clipboardIsTempGroup = false;
42044294 Composite tGroup = null;
42054295 if (group.selection.size() > 0) // 1)
42064296 {
42074297 tGroup = new cGroup();
4208
- GrafreeD.clipboardIsTempGroup = true;
4298
+ Grafreed.clipboardIsTempGroup = true;
42094299 }
42104300
42114301 if (cut)
....@@ -4245,16 +4335,16 @@
42454335 //System.out.println("cut " + child);
42464336 //System.out.println("parent = " + child.parent);
42474337 // tmp.addChild(child);
4248
- if (GrafreeD.clipboardIsTempGroup)
4338
+ if (Grafreed.clipboardIsTempGroup)
42494339 tGroup.add/*Child*/(tmp);
42504340 else
4251
- GrafreeD.clipboard = tmp;
4341
+ Grafreed.clipboard = tmp;
42524342 }
42534343 else
4254
- if (GrafreeD.clipboardIsTempGroup)
4344
+ if (Grafreed.clipboardIsTempGroup)
42554345 tGroup.add/*Child*/(child);
42564346 else
4257
- GrafreeD.clipboard = child;
4347
+ Grafreed.clipboard = child;
42584348 }
42594349
42604350 //ResetModel();
....@@ -4286,21 +4376,21 @@
42864376 //System.out.println("cut " + elem);
42874377 //System.out.println("parent = " + elem.parent);
42884378 // tmp.addChild(elem);
4289
- if (GrafreeD.clipboardIsTempGroup)
4379
+ if (Grafreed.clipboardIsTempGroup)
42904380 tGroup.add/*Child*/(tmp);
42914381 else
4292
- GrafreeD.clipboard = tmp;
4382
+ Grafreed.clipboard = tmp;
42934383 }
42944384 else
4295
- if (GrafreeD.clipboardIsTempGroup)
4385
+ if (Grafreed.clipboardIsTempGroup)
42964386 tGroup.add/*Child*/(child);
42974387 else
4298
- GrafreeD.clipboard = child;
4388
+ Grafreed.clipboard = child;
42994389 }
43004390
43014391 }
4302
- if (GrafreeD.clipboardIsTempGroup)
4303
- GrafreeD.clipboard = tGroup;
4392
+ if (Grafreed.clipboardIsTempGroup)
4393
+ Grafreed.clipboard = tGroup;
43044394 if (cut)
43054395 {
43064396 ResetModel();
....@@ -4314,7 +4404,7 @@
43144404 // return;
43154405 boolean first = true;
43164406
4317
- if (GrafreeD.clipboardIsTempGroup)
4407
+ if (Grafreed.clipboardIsTempGroup)
43184408 {
43194409 Composite temp;
43204410
....@@ -4325,7 +4415,7 @@
43254415 temp = (Composite)Applet3D.clipboard.deepCopy();
43264416 */
43274417 Object3D elem;
4328
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4418
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43294419 {
43304420 Object3D child = (Object3D)e.nextElement();
43314421
....@@ -4359,21 +4449,21 @@
43594449 //Object3D cb = Applet3D.clipboard;
43604450 //temp.addChild(cb);
43614451 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4362
- assert(GrafreeD.clipboard.parent == null);
4363
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4364
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4365
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4366
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4452
+ assert(Grafreed.clipboard.parent == null);
4453
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4454
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4455
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4456
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43674457 else
4368
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4369
- GrafreeD.clipboard.get(0).parent = keepparent;
4458
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4459
+ Grafreed.clipboard.get(0).parent = keepparent;
43704460 }
43714461
43724462 ResetModel();
43734463 refreshContents();
43744464 }
43754465
4376
- void pasteInto(boolean copyit)
4466
+ void pasteInto(boolean copyit, boolean clone)
43774467 {
43784468 // if (GrafreeD.clipboard == null)
43794469 // return;
....@@ -4402,15 +4492,22 @@
44024492 if (copyit)
44034493 {
44044494 // paste(false);
4405
- CloneClipboard(false); // sept 2014
4495
+ if (clone)
4496
+ {
4497
+ CloneClipboard(false); // sept 2014
4498
+ }
4499
+ else
4500
+ {
4501
+ paste(false);
4502
+ }
44064503 }
44074504 else
44084505 {
44094506 boolean first = true;
44104507
4411
- if (GrafreeD.clipboardIsTempGroup)
4508
+ if (Grafreed.clipboardIsTempGroup)
44124509 {
4413
- Composite temp = (Composite)GrafreeD.clipboard;
4510
+ Composite temp = (Composite)Grafreed.clipboard;
44144511 Object3D copy;
44154512 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44164513 {
....@@ -4420,7 +4517,7 @@
44204517 }
44214518 } else
44224519 {
4423
- linkSomething(GrafreeD.clipboard); //.get(0));
4520
+ linkSomething(Grafreed.clipboard); //.get(0));
44244521 }
44254522 }
44264523 }
....@@ -4865,7 +4962,7 @@
48654962
48664963 void ImportVRMLX3D()
48674964 {
4868
- if (GrafreeD.standAlone)
4965
+ if (Grafreed.standAlone)
48694966 {
48704967 /**/
48714968 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4882,7 +4979,7 @@
48824979
48834980 String GetFile(String dialogName)
48844981 {
4885
- if (GrafreeD.standAlone)
4982
+ if (Grafreed.standAlone)
48864983 {
48874984 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48884985 browser.show();
....@@ -4946,10 +5043,12 @@
49465043 cButton flashSelectionButton;
49475044 cButton editButton;
49485045 cButton uneditButton;
5046
+ JCheckBox allParamsButton;
49495047 cButton clearpanelButton;
4950
- cButton allParamsButton;
49515048 cButton unselectButton;
49525049
5050
+ cButton oneStepButton;
5051
+
49535052 cButton screenfitButton;
49545053 cButton screenfitpointButton;
49555054 cButton snapobjectButton;
....@@ -5004,6 +5103,7 @@
50045103 private MenuItem mergeGeometriesItem;
50055104 private MenuItem copyItem;
50065105 private MenuItem pasteItem;
5106
+ private MenuItem pasteIntoItem;
50075107 private MenuItem pasteLinkItem;
50085108 private MenuItem pasteCloneItem;
50095109 private MenuItem pasteExpandItem;
....@@ -5101,7 +5201,7 @@
51015201 private MenuItem blobItem;
51025202 private MenuItem latheItem;
51035203 private MenuItem bezierItem;
5104
- private MenuItem checkerItem;
5204
+ private MenuItem overlayItem;
51055205 private MenuItem meshItem;
51065206 // private MenuItem meshGroupItem;
51075207 private MenuItem springItem;