Normand Briere
2019-06-09 cd87df088b1850ba0c90beb6c866c443e4eaf3b9
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,27 +185,37 @@
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"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
211
+ if (Globals.ADVANCED)
212
+ {
198213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199214 revertMeshItem.addActionListener(this);
200215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201216 resetreferencesItem.addActionListener(this);
202217 menu.add("-");
218
+ }
203219 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204220 overwriteGeoItem.addActionListener(this);
205221 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +227,26 @@
211227 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212228 overwriteUVItem.addActionListener(this);
213229 menu.add("-");
230
+ if (Globals.ADVANCED)
231
+ {
214232 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215233 generateMeshItem.addActionListener(this);
216234 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217235 poseMeshItem.addActionListener(this);
218236 menu.add("-");
237
+ }
219238 resetsupportItem = menu.add(new MenuItem("Reset support"));
220239 resetsupportItem.addActionListener(this);
221240 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222241 linkverticesItem.addActionListener(this);
223242 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224243 relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
225247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226248 setMasterItem.addActionListener(this);
249
+ }
227250
228251 oe.menuBar.add(menu = new Menu("Group"));
229252 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,27 +257,32 @@
234257 frontItem.addActionListener(this);
235258 compositeItem = menu.add(new MenuItem("Composite"));
236259 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238261 hideItem.addActionListener(this);
239262 ungroupItem = menu.add(new MenuItem("Ungroup"));
240263 ungroupItem.addActionListener(this);
241264 menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
243266 randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
248267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249268 switchGeoItem.addActionListener(this);
250269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251270 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
253272 morphItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ menu.add("-");
277
+ physicsItem = menu.add(new MenuItem("Physics"));
278
+ physicsItem.addActionListener(this);
279
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
280
+ frameselectorItem.addActionListener(this);
254281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255282 scriptNodeItem.addActionListener(this);
256283 cameraItem = menu.add(new MenuItem("Camera"));
257284 cameraItem.addActionListener(this);
285
+ }
258286
259287 oe.menuBar.add(menu = new Menu("Object"));
260288 textureItem = menu.add(new MenuItem("Texture"));
....@@ -269,21 +297,29 @@
269297 shadowYItem.addActionListener(this);
270298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
271299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
272303 linkerItem = menu.add(new MenuItem("Linker"));
273304 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276305 attributeItem = menu.add(new MenuItem("Attribute"));
277306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
278309 pointflowItem = menu.add(new MenuItem("Point Flow"));
279310 pointflowItem.addActionListener(this);
311
+ }
280312 menu.add("-");
281313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282314 resetTransformItem.addActionListener(this);
283315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284316 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
317
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
318
+ resetCentroidXZItem.addActionListener(this);
319
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
320
+ transformGeometryItem.addActionListener(this);
321
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
322
+ transformChildrenItem.addActionListener(this);
287323
288324 oe.menuBar.add(menu = new Menu("Geometry"));
289325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -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,23 +356,34 @@
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"));
327370 clearMaterialsItem.addActionListener(this);
371
+ resetAllItem = menu.add(new MenuItem("Reset All"));
372
+ resetAllItem.addActionListener(this);
373
+ stepAllItem = menu.add(new MenuItem("Step All"));
374
+ stepAllItem.addActionListener(this);
328375 menu.add("-");
329376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330377 liveleavesItem.addActionListener(this);
331378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
333382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334383 supportleavesItem.addActionListener(this);
335384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336385 unsupportleavesItem.addActionListener(this);
386
+ }
337387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338388 hideleavesItem.addActionListener(this);
339389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -377,28 +427,34 @@
377427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378428 sortbynameItem.addActionListener(this);
379429 menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ // Pretty much the same as duplicate and clone.
380437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381438 extractGeometriesItem.addActionListener(this);
382439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383440 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
441
+ }
388442
389443 oe.menuBar.add(menu = new Menu("Insert"));
390444 buildCreateMenu(menu);
391445
392
-
393446 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..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
399448 importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
401451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
402458
403459 oe.menuBar.add(menu = new Menu("Tools"));
404460 buildToolsMenu(menu);
....@@ -434,110 +490,98 @@
434490 oe.radioPanel.add(dummyButton);
435491 oe.buttonGroup.add(dummyButton);
436492 */
437
- aConstraints.gridy += 1;
438
-
439493 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
440494
441
- oe.aConstraints.gridwidth = 1;
442
- oe.aConstraints.gridx = 0;
443
-
444
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
445
- liveCB.setToolTipText("Enabled animation");
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
446497 liveCB.addItemListener(this);
447498
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500
+ oneStepButton.setToolTipText("Animate one step forward");
501
+ oneStepButton.addActionListener(this);
502
+
503
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
504
+ fastCB.setToolTipText("Fast mode");
505
+ fastCB.addItemListener(this);
506
+
507
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
450508 trackCB.setToolTipText("Enable tracking");
451509 trackCB.addItemListener(this);
452510
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
455512 screenfitButton.setToolTipText("Screen fit");
456513 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
514
+
458515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
459516 // screenfitpointButton.addActionListener(this);
460
-// oe.aConstraints.gridx += 1;
461
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
462
- snapobjectButton.addActionListener(this);
463
- snapobjectButton.setToolTipText("Snap Object");
464
- oe.aConstraints.gridx += 1;
465517
466
- //aConstraints.gridx = 0;
467
- //aConstraints.gridy += 1;
468
- oe.aConstraints.weighty = 0;
469
- oe.aConstraints.gridwidth = 1;
470
-
471
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
518
+ if (Globals.ADVANCED)
519
+ {
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521
+ snapobjectButton.addActionListener(this);
522
+ snapobjectButton.setToolTipText("Snap Object");
523
+ }
524
+
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
472526 flashSelectionButton.setToolTipText("Show selection");
473527 flashSelectionButton.addActionListener(this);
474528
475
- oe.toolbarPanel.add(new cButton(" ", false));
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
476530
477
- oe.aConstraints.gridx += 1;
478
- oe.aConstraints.weighty = 0;
479
- oe.aConstraints.gridwidth = 1;
480
-
481
- //
482
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483532 twoButton.setToolTipText("Show center view only");
484533 twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
486535 fourButton.addActionListener(this);
487536 fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
489538 sixButton.setToolTipText("2-column layout left");
490539 sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492541 threeButton.setToolTipText("2-column layout right");
493542 threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495544 sevenButton.setToolTipText("3-column layout");
496545 sevenButton.addActionListener(this);
497546 //
498547
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- rootButton.setToolTipText("Edit object in new tab");
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
+ rootButton.setToolTipText("Edit selection in new tab");
501550 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504553 closeButton.setToolTipText("Close tab");
505554 closeButton.addActionListener(this);
506555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
507556 //clearButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509557
510
- oe.aConstraints.gridx = 1; //
511
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
558
+ cGridBag commandsPanel = new cGridBag();
559
+
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ editButton.setToolTipText("Edit selection");
512562 editButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516563
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
518566 uneditButton.addActionListener(this);
519567
520
- oe.aConstraints.gridx += 1;
521
- oe.aConstraints.weighty = 0;
522
- oe.aConstraints.gridwidth = 1;
523
-
524
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
525
- clearPanelButton.addActionListener(this);
526
-
527
- oe.aConstraints.gridx += 1;
528
- oe.aConstraints.weighty = 0;
529
- oe.aConstraints.gridwidth = 1;
530
-
531
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
568
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
+ allParamsButton.setToolTipText("Edit all params");
532570 allParamsButton.addActionListener(this);
533571
534
- oe.aConstraints.gridx += 1;
535
- oe.aConstraints.weighty = 0;
536
- oe.aConstraints.gridwidth = 1;
537
-
538
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ clearPanelButton.setToolTipText("Clear edit panel");
574
+ clearPanelButton.addActionListener(this);
575
+
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ unselectButton.setToolTipText("Unselect");
539578 unselectButton.addActionListener(this);
540579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
541585 // oe.aConstraints.gridx += 1;
542586 // oe.aConstraints.weighty = 0;
543587 // oe.aConstraints.gridwidth = 1;
....@@ -549,40 +593,37 @@
549593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
550594 // gcButton.addActionListener(this);
551595
552
- oe.aConstraints.gridx = 0;
553
- oe.aConstraints.gridy += 1;
554
-
555
- //ctrlPanel.add(objList = new List(5, true));
556
- oe.aConstraints.gridwidth = 100;
557
- // oe.aConstraints.gridheight = 100;
558
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
559
- oe.aConstraints.gridheight = 1;
560
- oe.aConstraints.weighty = 0.5;
561
- oe.aConstraints.gridx = 0;
562
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
563599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
564
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
600
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
565601 ResetModel();
566
- oe.aConstraints.weighty = 0.5;
567
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
568
- oe.aConstraints.gridy += 1;
569
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
570605
571
- oe.aConstraints.weighty = 0;
572
- oe.aConstraints.gridwidth = 2;
573
-
574
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
+ cGridBag copyOptionsPanel = new cGridBag();
607
+
608
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
+ colorCB.setToolTipText("Copy color when dropped");
575610 colorCB.addItemListener(this);
576
- oe.aConstraints.gridx += 2;
577
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
611
+
612
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
+ materialCB.setToolTipText("Copy material when dropped");
578614 materialCB.addItemListener(this);
579
- oe.aConstraints.gridx += 2;
580
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
615
+
616
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
+ textureCB.setToolTipText("Copy texture when dropped");
581618 textureCB.addItemListener(this);
582619
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
585623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
586627 //jList.addListSelectionListener(this);
587628 oe.jTree.addTreeSelectionListener(this);
588629 //jTree.setRootVisible(false);
....@@ -607,43 +648,35 @@
607648
608649 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609650 {
610
- //constraints.gridx = 0;
611
- //constraints.gridy = 0;
612
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
- fastCB.setToolTipText("Fast mode");
614
- fastCB.addItemListener(this);
615
- //constraints.gridy += 1;
616
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
- supportCB.setToolTipText("Enabled rigging");
618
- supportCB.addItemListener(this);
619
-
620
- // constraints.gridy += 1;
621
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622
- // localCB.addItemListener(this);
623
-
624
- //constraints.gridy += 1;
625
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
626
- crowdCB.setToolTipText("Used for crowds");
627
- crowdCB.addItemListener(this);
628
-
629
- //constraints.gridy += 1;
630
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
631
- smoothCB.setToolTipText("Snapping delay");
632
- smoothCB.addItemListener(this);
633
-
634
- //constraints.gridy += 1;
635
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636
- slowCB.setToolTipText("Smooth interpolation");
637
- slowCB.addItemListener(this);
638
- //constraints.gridy += 1;
639651 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640652 boxCB.setToolTipText("Display bounding boxes");
641653 boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
654
+
643655 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645657 zoomBoxCB.addItemListener(this);
646658
659
+ if (true) // Globals.ADVANCED)
660
+ {
661
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
+ supportCB.setToolTipText("Enable rigging");
663
+ supportCB.addItemListener(this);
664
+
665
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
666
+ // localCB.addItemListener(this);
667
+
668
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
669
+ crowdCB.setToolTipText("Used for crowds");
670
+ crowdCB.addItemListener(this);
671
+
672
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
673
+ smoothCB.setToolTipText("Snapping delay");
674
+ smoothCB.addItemListener(this);
675
+
676
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
677
+ slowCB.setToolTipText("Smooth interpolation");
678
+ slowCB.addItemListener(this);
679
+
647680 // constraints.gridy += 1;
648681 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649682 // speakerMocapCB.addItemListener(this);
....@@ -668,14 +701,20 @@
668701 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669702 // debugCB.addItemListener(this);
670703
671
- //constraints.gridy += 1;
672704 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
673705 oeilCB.addItemListener(this);
674706
675
- //constraints.gridy += 1;
676707 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677708 lookAtCB.setToolTipText("Look-at target");
678709 lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
679718
680719 }
681720
....@@ -906,7 +945,9 @@
906945 // objEditor.DropFile((java.io.File[]) object, true);
907946 // return;
908947 // }
909
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
910951 {
911952 // file(s)
912953 String[] names = string.split("\n");
....@@ -933,7 +974,7 @@
933974
934975 flashIt = false;
935976 CameraPane pane = (CameraPane) target;
936
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
937978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
938979
939980 if (group.selection.size() == 1)
....@@ -960,11 +1001,11 @@
9601001 {
9611002 loadClipboard(true);
9621003 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
1004
+ pasteInto(false, false);
9641005 } else {
9651006 loadClipboard(false);
9661007 objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
1008
+ pasteInto(false, false); // true); // ???
9681009 }
9691010 }
9701011 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1086,27 +1127,33 @@
10861127 kleinItem.addActionListener(this);
10871128 particleItem = menu.add(new MenuItem("Particle system"));
10881129 particleItem.addActionListener(this);
1130
+ if (Globals.ADVANCED)
1131
+ {
10891132 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901133 ragdollItem.addActionListener(this);
10911134 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921135 ragdoll2Item.addActionListener(this);
1136
+ }
10931137 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1138
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951139 meshItem.addActionListener(this);
10961140 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971141 // meshGroupItem.addActionListener(this);
1142
+ if (Globals.ADVANCED)
1143
+ {
10981144 springItem = menu.add(new MenuItem("Spring"));
10991145 springItem.addActionListener(this);
11001146 flagItem = menu.add(new MenuItem("Flag"));
11011147 flagItem.addActionListener(this);
1102
- bezierItem = menu.add(new MenuItem("Patch"));
1103
- bezierItem.addActionListener(this);
1104
- checkerItem = menu.add(new MenuItem("Checker"));
1105
- checkerItem.addActionListener(this);
11061148 blobItem = menu.add(new MenuItem("Blob"));
11071149 blobItem.addActionListener(this);
11081150 latheItem = menu.add(new MenuItem("Lathe"));
11091151 latheItem.addActionListener(this);
1152
+ }
1153
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1154
+ bezierItem.addActionListener(this);
1155
+ overlayItem = menu.add(new MenuItem("Overlay"));
1156
+ overlayItem.addActionListener(this);
11101157 lightItem = menu.add(new MenuItem("Light"));
11111158 lightItem.addActionListener(this);
11121159 menu.add("-");
....@@ -1116,34 +1163,39 @@
11161163 loopItem.addActionListener(this);
11171164 doubleItem = menu.add(new MenuItem("Fork"));
11181165 doubleItem.addActionListener(this);
1166
+ if (Globals.ADVANCED)
1167
+ {
11191168 tripleItem = menu.add(new MenuItem("Trident"));
11201169 tripleItem.addActionListener(this);
1170
+ }
11211171 }
11221172
11231173 void buildToolsMenu(Menu menu)
11241174 {
11251175 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261176 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1177
+ animationItem.setState(Globals.ANIMATION);
11281178
11291179 menu.add("-");
11301180 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311181 parseverticesItem.addActionListener(this);
11321182 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331183 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1184
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351185 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381186 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391187 reduceMorphItem.addActionListener(this);
11401188 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411189 reduce34MorphItem.addActionListener(this);
1142
-
1190
+ menu.add("-");
11431191 menu.add(computeAOItem = new MenuItem("Compute AO"));
11441192 computeAOItem.addActionListener(this);
1145
- menu.add("-");
11461193
1194
+ if (Globals.ADVANCED)
1195
+ {
1196
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1197
+ mirrorItem.addActionListener(this);
1198
+ menu.add("-");
11471199 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481200 memoryItem.addActionListener(this);
11491201 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1166,6 +1218,7 @@
11661218 menu.add("-");
11671219 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681220 editScriptItem.addActionListener(this);
1221
+ }
11691222 }
11701223
11711224 void ScreenFit()
....@@ -1494,9 +1547,9 @@
14941547
14951548 void Overwrite(int mask)
14961549 {
1497
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14981551 {
1499
- Object3D content = GrafreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
15001553
15011554 if (content instanceof cGroup && ((cGroup)content).transientlink )
15021555 content = ((cGroup)content).get(0);
....@@ -1667,7 +1720,7 @@
16671720 {
16681721 makeSomething(new BezierSurface());
16691722 } else
1670
- if (source == checkerItem)
1723
+ if (source == overlayItem)
16711724 {
16721725 /*
16731726 Object3D obj = new BezierSurface(5,8);
....@@ -1816,7 +1869,15 @@
18161869 } else
18171870 if (source == importOBJItem)
18181871 {
1819
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1872
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
+ browser.setVisible(true);
1875
+ String filename = browser.getFile();
1876
+ if (filename != null && filename.length() > 0)
1877
+ {
1878
+ String fullname = browser.getDirectory() + filename;
1879
+ makeSomething(ReadOBJ(fullname), true);
1880
+ }
18201881 } else
18211882 if (source == computeAOItem)
18221883 {
....@@ -1836,7 +1897,7 @@
18361897 if (source == invariantsItem)
18371898 {
18381899 System.out.println("Invariants:");
1839
- GrafreeD.grafreeD.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
18401901 } else
18411902 if (source == memoryItem)
18421903 {
....@@ -1854,6 +1915,11 @@
18541915 if (source == dumpItem)
18551916 {
18561917 DumpObject();
1918
+ } else
1919
+ if (source == oneStepButton)
1920
+ {
1921
+ Globals.ONESTEP = true;
1922
+ cameraView.repaint();
18571923 } else
18581924 if (source == screenfitButton)
18591925 {
....@@ -1906,10 +1972,10 @@
19061972 } else
19071973 if (source == duplicateItem)
19081974 {
1909
- Object3D keep = GrafreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
19101976 loadClipboard(false);
19111977 paste(false);
1912
- GrafreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
19131979 } else
19141980 if (source == cloneItem)
19151981 {
....@@ -1927,13 +1993,17 @@
19271993 {
19281994 paste(false);
19291995 } else
1996
+ if (source == pasteIntoItem)
1997
+ {
1998
+ pasteInto(true, false);
1999
+ } else
19302000 if (source == pasteLinkItem)
19312001 {
1932
- pasteInto(false);
2002
+ pasteInto(false, false);
19332003 } else
19342004 if (source == pasteCloneItem)
19352005 {
1936
- pasteInto(true);
2006
+ pasteInto(true, true);
19372007 } else
19382008 if (source == pasteExpandItem)
19392009 {
....@@ -2125,9 +2195,9 @@
21252195 // group.selection.get(0).setMasterThis(content); // should be identity
21262196 // refreshContents();
21272197 // }
2128
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21292199 {
2130
- Object3D content = GrafreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
21312201
21322202 if (content instanceof cGroup && ((cGroup)content).transientlink )
21332203 content = ((cGroup)content).get(0);
....@@ -2135,11 +2205,11 @@
21352205 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21362206 for (int i=0; i<group.selection.size(); i++)
21372207 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2208
+ boolean random = CameraPane.SWITCH;
2209
+ CameraPane.SWITCH = false; // parse all random nodes
21402210 group.selection.get(i).linkVerticesThis(content);
21412211 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
2212
+ CameraPane.SWITCH = random;
21432213 }
21442214 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21452215 refreshContents();
....@@ -2149,20 +2219,20 @@
21492219 {
21502220 for (int i=0; i<group.selection.size(); i++)
21512221 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2222
+ boolean random = CameraPane.SWITCH;
2223
+ CameraPane.SWITCH = false; // parse all random nodes
21542224 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
2225
+ CameraPane.SWITCH = random;
21562226 }
21572227
21582228 refreshContents();
21592229 } else
21602230 if (source == relinkverticesItem)
21612231 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
2232
+ boolean random = CameraPane.SWITCH;
2233
+ CameraPane.SWITCH = false; // parse all random nodes
21642234 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
2235
+ CameraPane.SWITCH = random;
21662236
21672237 refreshContents();
21682238 } else
....@@ -2177,9 +2247,9 @@
21772247 } else
21782248 if (source == setMasterItem)
21792249 {
2180
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21812251 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
21832253
21842254 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852255 content = ((cGroup)content).get(0);
....@@ -2192,9 +2262,9 @@
21922262 {
21932263 if (group.selection.size() == 1)
21942264 {
2195
- if (GrafreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
21962266 {
2197
- Object3D content = GrafreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
21982268
21992269 if (content instanceof cGroup && ((cGroup)content).transientlink )
22002270 content = ((cGroup)content).get(0);
....@@ -2211,7 +2281,7 @@
22112281 {
22122282 RevertMeshes();
22132283 } else
2214
- if (source == resetMeshItem)
2284
+ if (source == resetAllItem)
22152285 {
22162286 ResetAll();
22172287 } else
....@@ -2260,7 +2330,7 @@
22602330 RandomNode random = new RandomNode();
22612331 group(random);
22622332 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
2333
+ random.name = random.get(0).name + "Switch";
22642334 } else
22652335 if (source == physicsItem)
22662336 {
....@@ -2549,9 +2619,13 @@
25492619 {
25502620 SmoothMesh();
25512621 } else
2552
- if (source == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
25532623 {
25542624 TransformGeometry();
2625
+ } else
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
25552629 } else
25562630 if (source == resetTransformItem)
25572631 {
....@@ -2559,7 +2633,11 @@
25592633 } else
25602634 if (source == resetCentroidItem)
25612635 {
2562
- ResetCentroid();
2636
+ ResetCentroid(true);
2637
+ } else
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
25632641 } else
25642642 if (source == resetParentItem)
25652643 {
....@@ -2917,7 +2995,7 @@
29172995
29182996 child.editWindow = null; // ???????????
29192997 }
2920
- objEditor.ctrlPanel.validate();
2998
+ objEditor.ctrlPanel.FlushUI();
29212999 //objEditor.jTree.clearSelection();
29223000 //objEditor.ResetSliders();
29233001 refreshContents(true);
....@@ -3075,6 +3153,28 @@
30753153 refreshContents();
30763154 }
30773155
3156
+ void TransformChildren()
3157
+ {
3158
+ Object3D obj;
3159
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3160
+ {
3161
+ obj = (Object3D)e.nextElement();
3162
+ obj.KeepTextureMatrices();
3163
+ obj.TransformChildren();
3164
+ obj.RestoreTextureMatrices();
3165
+
3166
+// if (obj.parent == null)
3167
+// {
3168
+// System.out.println("NULL PARENT!");
3169
+// new Exception().printStackTrace();
3170
+// }
3171
+// else
3172
+// TouchTransform(obj);
3173
+// //obj.parent.Touch();
3174
+ }
3175
+
3176
+ refreshContents();
3177
+ }
30783178
30793179 void ResetTransform()
30803180 {
....@@ -3187,7 +3287,7 @@
31873287 refreshContents();
31883288 }
31893289
3190
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
31913291 {
31923292 Object3D obj;
31933293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3202,12 +3302,16 @@
32023302 LA.matIdentity(Object3D.mat);
32033303 obj.getBounds(minima, maxima, false);
32043304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3205
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32063307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32073308 obj.TransformMesh(Object3D.mat);
3309
+
32083310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3209
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32103313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
32113315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32123316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32133317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3273,9 +3377,9 @@
32733377 obj = (Object3D)e.nextElement();
32743378
32753379 System.out.println("Object is: " + obj);
3276
- GrafreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
32773381 System.out.println("Boundary rep: " + obj.bRep);
3278
- GrafreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
32793383
32803384 // System.err.println((size/1024) + " KB is the size of " + obj);
32813385 }
....@@ -3489,8 +3593,8 @@
34893593
34903594 void ParseVertices()
34913595 {
3492
- boolean epsequal = GrafreeD.epsequal;
3493
- GrafreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
34943598
34953599 for (int i=0; i<group.selection.size(); i++)
34963600 {
....@@ -3515,7 +3619,7 @@
35153619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35163620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35173621
3518
- g.add(GrafreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
35193623
35203624 buffer.add(g);
35213625 }
....@@ -3530,7 +3634,7 @@
35303634 makeSomething(buffer, i==group.selection.size()-1);
35313635 }
35323636
3533
- GrafreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
35343638
35353639 refreshContents();
35363640 }
....@@ -3548,7 +3652,16 @@
35483652 String pigment = Object3D.GetPigment(tex);
35493653 //String bump = Object3D.GetBump(tex);
35503654
3551
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3655
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3656
+
3657
+ try
3658
+ {
3659
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3660
+ }
3661
+ catch (Exception e)
3662
+ {
3663
+ System.err.println("FAIL: " + node);
3664
+ }
35523665
35533666 double s = v.s;
35543667
....@@ -3636,11 +3749,11 @@
36363749
36373750 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36383751
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
3752
+ boolean random = CameraPane.SWITCH;
3753
+ CameraPane.SWITCH = false; // parse all random nodes
36413754 lowres.linkVerticesThis(null);
36423755 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
3756
+ CameraPane.SWITCH = random;
36443757
36453758 System.err.flush();
36463759
....@@ -3680,7 +3793,7 @@
36803793 return;
36813794
36823795 Object3D poses = group.selection.get(0);
3683
- Object3D ref = GrafreeD.clipboard.get(0);
3796
+ Object3D ref = Grafreed.clipboard.get(0);
36843797
36853798 Object3D newgroup = new Object3D("Po:" + poses.name);
36863799
....@@ -3874,9 +3987,9 @@
38743987
38753988 void ClipMesh()
38763989 {
3877
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3990
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38783991 {
3879
- Object3D content = GrafreeD.clipboard.get(0);
3992
+ Object3D content = Grafreed.clipboard.get(0);
38803993
38813994 if (content instanceof cGroup && ((cGroup)content).transientlink )
38823995 content = ((cGroup)content).get(0);
....@@ -3885,7 +3998,7 @@
38853998 // {
38863999 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38874000 // }
3888
- group.selection.ClipMesh(GrafreeD.clipboard);
4001
+ group.selection.ClipMesh(Grafreed.clipboard);
38894002 }
38904003 // group.selection.ClipMesh(GrafreeD.clipboard);
38914004 System.out.println("DONE.");
....@@ -4125,12 +4238,12 @@
41254238 System.err.println("info : " + child.GetPath());
41264239 }
41274240 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
4241
+// else
4242
+// {
4243
+// objEditor.SetMaterial(group); // .GetMaterial());
4244
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4245
+// System.err.println("info : " + group.GetPath());
4246
+// }
41344247
41354248 objEditor.SetText(); // jan 2014
41364249
....@@ -4225,12 +4338,12 @@
42254338 {
42264339 if (group.selection.isEmpty())
42274340 return;
4228
- GrafreeD.clipboardIsTempGroup = false;
4341
+ Grafreed.clipboardIsTempGroup = false;
42294342 Composite tGroup = null;
42304343 if (group.selection.size() > 0) // 1)
42314344 {
42324345 tGroup = new cGroup();
4233
- GrafreeD.clipboardIsTempGroup = true;
4346
+ Grafreed.clipboardIsTempGroup = true;
42344347 }
42354348
42364349 if (cut)
....@@ -4270,16 +4383,16 @@
42704383 //System.out.println("cut " + child);
42714384 //System.out.println("parent = " + child.parent);
42724385 // tmp.addChild(child);
4273
- if (GrafreeD.clipboardIsTempGroup)
4386
+ if (Grafreed.clipboardIsTempGroup)
42744387 tGroup.add/*Child*/(tmp);
42754388 else
4276
- GrafreeD.clipboard = tmp;
4389
+ Grafreed.clipboard = tmp;
42774390 }
42784391 else
4279
- if (GrafreeD.clipboardIsTempGroup)
4392
+ if (Grafreed.clipboardIsTempGroup)
42804393 tGroup.add/*Child*/(child);
42814394 else
4282
- GrafreeD.clipboard = child;
4395
+ Grafreed.clipboard = child;
42834396 }
42844397
42854398 //ResetModel();
....@@ -4311,21 +4424,21 @@
43114424 //System.out.println("cut " + elem);
43124425 //System.out.println("parent = " + elem.parent);
43134426 // tmp.addChild(elem);
4314
- if (GrafreeD.clipboardIsTempGroup)
4427
+ if (Grafreed.clipboardIsTempGroup)
43154428 tGroup.add/*Child*/(tmp);
43164429 else
4317
- GrafreeD.clipboard = tmp;
4430
+ Grafreed.clipboard = tmp;
43184431 }
43194432 else
4320
- if (GrafreeD.clipboardIsTempGroup)
4433
+ if (Grafreed.clipboardIsTempGroup)
43214434 tGroup.add/*Child*/(child);
43224435 else
4323
- GrafreeD.clipboard = child;
4436
+ Grafreed.clipboard = child;
43244437 }
43254438
43264439 }
4327
- if (GrafreeD.clipboardIsTempGroup)
4328
- GrafreeD.clipboard = tGroup;
4440
+ if (Grafreed.clipboardIsTempGroup)
4441
+ Grafreed.clipboard = tGroup;
43294442 if (cut)
43304443 {
43314444 ResetModel();
....@@ -4339,7 +4452,7 @@
43394452 // return;
43404453 boolean first = true;
43414454
4342
- if (GrafreeD.clipboardIsTempGroup)
4455
+ if (Grafreed.clipboardIsTempGroup)
43434456 {
43444457 Composite temp;
43454458
....@@ -4350,7 +4463,7 @@
43504463 temp = (Composite)Applet3D.clipboard.deepCopy();
43514464 */
43524465 Object3D elem;
4353
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4466
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43544467 {
43554468 Object3D child = (Object3D)e.nextElement();
43564469
....@@ -4384,21 +4497,21 @@
43844497 //Object3D cb = Applet3D.clipboard;
43854498 //temp.addChild(cb);
43864499 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4387
- assert(GrafreeD.clipboard.parent == null);
4388
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4389
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4390
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4391
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4500
+ assert(Grafreed.clipboard.parent == null);
4501
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4502
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4503
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4504
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43924505 else
4393
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4394
- GrafreeD.clipboard.get(0).parent = keepparent;
4506
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4507
+ Grafreed.clipboard.get(0).parent = keepparent;
43954508 }
43964509
43974510 ResetModel();
43984511 refreshContents();
43994512 }
44004513
4401
- void pasteInto(boolean copyit)
4514
+ void pasteInto(boolean copyit, boolean clone)
44024515 {
44034516 // if (GrafreeD.clipboard == null)
44044517 // return;
....@@ -4427,15 +4540,22 @@
44274540 if (copyit)
44284541 {
44294542 // paste(false);
4430
- CloneClipboard(false); // sept 2014
4543
+ if (clone)
4544
+ {
4545
+ CloneClipboard(false); // sept 2014
4546
+ }
4547
+ else
4548
+ {
4549
+ paste(false);
4550
+ }
44314551 }
44324552 else
44334553 {
44344554 boolean first = true;
44354555
4436
- if (GrafreeD.clipboardIsTempGroup)
4556
+ if (Grafreed.clipboardIsTempGroup)
44374557 {
4438
- Composite temp = (Composite)GrafreeD.clipboard;
4558
+ Composite temp = (Composite)Grafreed.clipboard;
44394559 Object3D copy;
44404560 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44414561 {
....@@ -4445,7 +4565,7 @@
44454565 }
44464566 } else
44474567 {
4448
- linkSomething(GrafreeD.clipboard); //.get(0));
4568
+ linkSomething(Grafreed.clipboard); //.get(0));
44494569 }
44504570 }
44514571 }
....@@ -4890,7 +5010,7 @@
48905010
48915011 void ImportVRMLX3D()
48925012 {
4893
- if (GrafreeD.standAlone)
5013
+ if (Grafreed.standAlone)
48945014 {
48955015 /**/
48965016 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4907,7 +5027,7 @@
49075027
49085028 String GetFile(String dialogName)
49095029 {
4910
- if (GrafreeD.standAlone)
5030
+ if (Grafreed.standAlone)
49115031 {
49125032 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49135033 browser.show();
....@@ -4971,10 +5091,12 @@
49715091 cButton flashSelectionButton;
49725092 cButton editButton;
49735093 cButton uneditButton;
5094
+ JCheckBox allParamsButton;
49745095 cButton clearpanelButton;
4975
- cButton allParamsButton;
49765096 cButton unselectButton;
49775097
5098
+ cButton oneStepButton;
5099
+
49785100 cButton screenfitButton;
49795101 cButton screenfitpointButton;
49805102 cButton snapobjectButton;
....@@ -5018,7 +5140,7 @@
50185140 private MenuItem linkverticesItem;
50195141 private MenuItem relinkverticesItem;
50205142 private MenuItem setMasterItem;
5021
- private MenuItem resetMeshItem;
5143
+ private MenuItem resetAllItem;
50225144 private MenuItem stepAllItem;
50235145 private MenuItem revertMeshItem;
50245146 private MenuItem poseMeshItem;
....@@ -5029,6 +5151,7 @@
50295151 private MenuItem mergeGeometriesItem;
50305152 private MenuItem copyItem;
50315153 private MenuItem pasteItem;
5154
+ private MenuItem pasteIntoItem;
50325155 private MenuItem pasteLinkItem;
50335156 private MenuItem pasteCloneItem;
50345157 private MenuItem pasteExpandItem;
....@@ -5078,8 +5201,10 @@
50785201 private MenuItem panoTexturesItem;
50795202
50805203 private MenuItem resetCentroidItem;
5081
- private MenuItem transformgeometryItem;
5204
+ private MenuItem resetCentroidXZItem;
50825205 private MenuItem resetTransformItem;
5206
+ private MenuItem transformGeometryItem;
5207
+ private MenuItem transformChildrenItem;
50835208 private MenuItem hideItem;
50845209 private MenuItem grabItem;
50855210 private MenuItem backItem;
....@@ -5126,7 +5251,7 @@
51265251 private MenuItem blobItem;
51275252 private MenuItem latheItem;
51285253 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
5254
+ private MenuItem overlayItem;
51305255 private MenuItem meshItem;
51315256 // private MenuItem meshGroupItem;
51325257 private MenuItem springItem;