Normand Briere
2019-06-09 3ae9b1de47e51e7c150412f2bb14383cb6a5f8f8
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);
....@@ -436,96 +492,96 @@
436492 */
437493 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438494
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
441497 liveCB.addItemListener(this);
442498
443
- 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);
444508 trackCB.setToolTipText("Enable tracking");
445509 trackCB.addItemListener(this);
446510
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448512 screenfitButton.setToolTipText("Screen fit");
449513 screenfitButton.addActionListener(this);
450514
451515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452516 // screenfitpointButton.addActionListener(this);
453
-// oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455
- snapobjectButton.addActionListener(this);
456
- snapobjectButton.setToolTipText("Snap Object");
457
- oe.aConstraints.gridx += 1;
458517
459
- //aConstraints.gridx = 0;
460
- //aConstraints.gridy += 1;
461
- oe.aConstraints.weighty = 0;
462
- oe.aConstraints.gridwidth = 1;
463
-
464
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, 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);
465526 flashSelectionButton.setToolTipText("Show selection");
466527 flashSelectionButton.addActionListener(this);
467528
468529 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469530
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471532 twoButton.setToolTipText("Show center view only");
472533 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474535 fourButton.addActionListener(this);
475536 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477538 sixButton.setToolTipText("2-column layout left");
478539 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480541 threeButton.setToolTipText("2-column layout right");
481542 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483544 sevenButton.setToolTipText("3-column layout");
484545 sevenButton.addActionListener(this);
485546 //
486547
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- 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");
489550 rootButton.addActionListener(this);
490
- oe.aConstraints.gridx += 1;
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492553 closeButton.setToolTipText("Close tab");
493554 closeButton.addActionListener(this);
494555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495556 //clearButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497557
498
- oe.aConstraints.gridx = 1; //
499
- 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");
500562 editButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.aConstraints.weighty = 0;
503
- oe.aConstraints.gridwidth = 1;
504563
505
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
506566 uneditButton.addActionListener(this);
507567
508
- oe.aConstraints.gridx += 1;
509
- oe.aConstraints.weighty = 0;
510
- oe.aConstraints.gridwidth = 1;
511
-
512
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
513
- clearPanelButton.addActionListener(this);
514
-
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518
-
519
- 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");
520570 allParamsButton.addActionListener(this);
521571
522
- oe.aConstraints.gridx += 1;
523
- oe.aConstraints.weighty = 0;
524
- oe.aConstraints.gridwidth = 1;
525
-
526
- 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");
527578 unselectButton.addActionListener(this);
528579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
529585 // oe.aConstraints.gridx += 1;
530586 // oe.aConstraints.weighty = 0;
531587 // oe.aConstraints.gridwidth = 1;
....@@ -537,40 +593,37 @@
537593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
538594 // gcButton.addActionListener(this);
539595
540
- oe.aConstraints.gridx = 0;
541
- oe.aConstraints.gridy += 1;
542
-
543
- //ctrlPanel.add(objList = new List(5, true));
544
- oe.aConstraints.gridwidth = 100;
545
- // oe.aConstraints.gridheight = 100;
546
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
547
- oe.aConstraints.gridheight = 1;
548
- oe.aConstraints.weighty = 0.5;
549
- oe.aConstraints.gridx = 0;
550
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
551599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
552
- 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);
553601 ResetModel();
554
- oe.aConstraints.weighty = 0.5;
555
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
556
- oe.aConstraints.gridy += 1;
557
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
558605
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 2;
561
-
562
- 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");
563610 colorCB.addItemListener(this);
564
- oe.aConstraints.gridx += 2;
565
- 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");
566614 materialCB.addItemListener(this);
567
- oe.aConstraints.gridx += 2;
568
- 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");
569618 textureCB.addItemListener(this);
570619
571
- oe.aConstraints.gridx = 0;
572
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
573623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
574627 //jList.addListSelectionListener(this);
575628 oe.jTree.addTreeSelectionListener(this);
576629 //jTree.setRootVisible(false);
....@@ -595,43 +648,35 @@
595648
596649 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
597650 {
598
- //constraints.gridx = 0;
599
- //constraints.gridy = 0;
600
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
- fastCB.setToolTipText("Fast mode");
602
- fastCB.addItemListener(this);
603
- //constraints.gridy += 1;
604
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
- supportCB.setToolTipText("Enabled rigging");
606
- supportCB.addItemListener(this);
607
-
608
- // constraints.gridy += 1;
609
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
610
- // localCB.addItemListener(this);
611
-
612
- //constraints.gridy += 1;
613
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
614
- crowdCB.setToolTipText("Used for crowds");
615
- crowdCB.addItemListener(this);
616
-
617
- //constraints.gridy += 1;
618
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
619
- smoothCB.setToolTipText("Snapping delay");
620
- smoothCB.addItemListener(this);
621
-
622
- //constraints.gridy += 1;
623
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624
- slowCB.setToolTipText("Smooth interpolation");
625
- slowCB.addItemListener(this);
626
- //constraints.gridy += 1;
627651 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628652 boxCB.setToolTipText("Display bounding boxes");
629653 boxCB.addItemListener(this);
630
- //constraints.gridy += 1;
654
+
631655 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633657 zoomBoxCB.addItemListener(this);
634658
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
+
635680 // constraints.gridy += 1;
636681 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
637682 // speakerMocapCB.addItemListener(this);
....@@ -656,14 +701,20 @@
656701 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
657702 // debugCB.addItemListener(this);
658703
659
- //constraints.gridy += 1;
660704 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
661705 oeilCB.addItemListener(this);
662706
663
- //constraints.gridy += 1;
664707 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665708 lookAtCB.setToolTipText("Look-at target");
666709 lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
667718
668719 }
669720
....@@ -678,6 +729,7 @@
678729 buttonGroup.add(radioButton);
679730 radioButton.doClick();
680731 }
732
+
681733 void SetupViews(ObjEditor oe)
682734 {
683735 oe.SetupViews();
....@@ -894,7 +946,9 @@
894946 // objEditor.DropFile((java.io.File[]) object, true);
895947 // return;
896948 // }
897
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
898952 {
899953 // file(s)
900954 String[] names = string.split("\n");
....@@ -921,7 +975,7 @@
921975
922976 flashIt = false;
923977 CameraPane pane = (CameraPane) target;
924
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
925979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
926980
927981 if (group.selection.size() == 1)
....@@ -948,11 +1002,11 @@
9481002 {
9491003 loadClipboard(true);
9501004 objEditor.jTree.setSelectionPath(destinationPath);
951
- pasteInto(false);
1005
+ pasteInto(false, false);
9521006 } else {
9531007 loadClipboard(false);
9541008 objEditor.jTree.setSelectionPath(destinationPath);
955
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9561010 }
9571011 }
9581012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1074,27 +1128,33 @@
10741128 kleinItem.addActionListener(this);
10751129 particleItem = menu.add(new MenuItem("Particle system"));
10761130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10771133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10781134 ragdollItem.addActionListener(this);
10791135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10801136 ragdoll2Item.addActionListener(this);
1137
+ }
10811138 menu.add("-");
1082
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10831140 meshItem.addActionListener(this);
10841141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10851142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10861145 springItem = menu.add(new MenuItem("Spring"));
10871146 springItem.addActionListener(this);
10881147 flagItem = menu.add(new MenuItem("Flag"));
10891148 flagItem.addActionListener(this);
1090
- bezierItem = menu.add(new MenuItem("Patch"));
1091
- bezierItem.addActionListener(this);
1092
- checkerItem = menu.add(new MenuItem("Checker"));
1093
- checkerItem.addActionListener(this);
10941149 blobItem = menu.add(new MenuItem("Blob"));
10951150 blobItem.addActionListener(this);
10961151 latheItem = menu.add(new MenuItem("Lathe"));
10971152 latheItem.addActionListener(this);
1153
+ }
1154
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1155
+ bezierItem.addActionListener(this);
1156
+ overlayItem = menu.add(new MenuItem("Overlay"));
1157
+ overlayItem.addActionListener(this);
10981158 lightItem = menu.add(new MenuItem("Light"));
10991159 lightItem.addActionListener(this);
11001160 menu.add("-");
....@@ -1104,34 +1164,39 @@
11041164 loopItem.addActionListener(this);
11051165 doubleItem = menu.add(new MenuItem("Fork"));
11061166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
11071169 tripleItem = menu.add(new MenuItem("Trident"));
11081170 tripleItem.addActionListener(this);
1171
+ }
11091172 }
11101173
11111174 void buildToolsMenu(Menu menu)
11121175 {
11131176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11141177 animationItem.addItemListener(this);
1115
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
11161179
11171180 menu.add("-");
11181181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11191182 parseverticesItem.addActionListener(this);
11201183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11211184 textureFieldItem.addActionListener(this);
1122
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
11231186 alignItem.addActionListener(this);
1124
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1125
- mirrorItem.addActionListener(this);
11261187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11271188 reduceMorphItem.addActionListener(this);
11281189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11291190 reduce34MorphItem.addActionListener(this);
1130
-
1191
+ menu.add("-");
11311192 menu.add(computeAOItem = new MenuItem("Compute AO"));
11321193 computeAOItem.addActionListener(this);
1133
- menu.add("-");
11341194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
11351200 menu.add(memoryItem = new MenuItem("Memory Usage"));
11361201 memoryItem.addActionListener(this);
11371202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1154,6 +1219,7 @@
11541219 menu.add("-");
11551220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11561221 editScriptItem.addActionListener(this);
1222
+ }
11571223 }
11581224
11591225 void ScreenFit()
....@@ -1482,9 +1548,9 @@
14821548
14831549 void Overwrite(int mask)
14841550 {
1485
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14861552 {
1487
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14881554
14891555 if (content instanceof cGroup && ((cGroup)content).transientlink )
14901556 content = ((cGroup)content).get(0);
....@@ -1655,7 +1721,7 @@
16551721 {
16561722 makeSomething(new BezierSurface());
16571723 } else
1658
- if (source == checkerItem)
1724
+ if (source == overlayItem)
16591725 {
16601726 /*
16611727 Object3D obj = new BezierSurface(5,8);
....@@ -1804,7 +1870,15 @@
18041870 } else
18051871 if (source == importOBJItem)
18061872 {
1807
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1874
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1875
+ browser.setVisible(true);
1876
+ String filename = browser.getFile();
1877
+ if (filename != null && filename.length() > 0)
1878
+ {
1879
+ String fullname = browser.getDirectory() + filename;
1880
+ makeSomething(ReadOBJ(fullname), true);
1881
+ }
18081882 } else
18091883 if (source == computeAOItem)
18101884 {
....@@ -1824,7 +1898,7 @@
18241898 if (source == invariantsItem)
18251899 {
18261900 System.out.println("Invariants:");
1827
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
18281902 } else
18291903 if (source == memoryItem)
18301904 {
....@@ -1842,6 +1916,11 @@
18421916 if (source == dumpItem)
18431917 {
18441918 DumpObject();
1919
+ } else
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
18451924 } else
18461925 if (source == screenfitButton)
18471926 {
....@@ -1894,10 +1973,10 @@
18941973 } else
18951974 if (source == duplicateItem)
18961975 {
1897
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
18981977 loadClipboard(false);
18991978 paste(false);
1900
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
19011980 } else
19021981 if (source == cloneItem)
19031982 {
....@@ -1915,13 +1994,17 @@
19151994 {
19161995 paste(false);
19171996 } else
1997
+ if (source == pasteIntoItem)
1998
+ {
1999
+ pasteInto(true, false);
2000
+ } else
19182001 if (source == pasteLinkItem)
19192002 {
1920
- pasteInto(false);
2003
+ pasteInto(false, false);
19212004 } else
19222005 if (source == pasteCloneItem)
19232006 {
1924
- pasteInto(true);
2007
+ pasteInto(true, true);
19252008 } else
19262009 if (source == pasteExpandItem)
19272010 {
....@@ -2113,9 +2196,9 @@
21132196 // group.selection.get(0).setMasterThis(content); // should be identity
21142197 // refreshContents();
21152198 // }
2116
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21172200 {
2118
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
21192202
21202203 if (content instanceof cGroup && ((cGroup)content).transientlink )
21212204 content = ((cGroup)content).get(0);
....@@ -2123,11 +2206,11 @@
21232206 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21242207 for (int i=0; i<group.selection.size(); i++)
21252208 {
2126
- boolean random = CameraPane.RANDOM;
2127
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
21282211 group.selection.get(i).linkVerticesThis(content);
21292212 // group.selection.get(i).setMasterThis(content); // should be identity
2130
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
21312214 }
21322215 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21332216 refreshContents();
....@@ -2137,20 +2220,20 @@
21372220 {
21382221 for (int i=0; i<group.selection.size(); i++)
21392222 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
21422225 group.selection.get(i).linkVerticesThis(null);
2143
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
21442227 }
21452228
21462229 refreshContents();
21472230 } else
21482231 if (source == relinkverticesItem)
21492232 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
21522235 group.selection.RelinkToSupport();
2153
- CameraPane.RANDOM = random;
2236
+ CameraPane.SWITCH = random;
21542237
21552238 refreshContents();
21562239 } else
....@@ -2165,9 +2248,9 @@
21652248 } else
21662249 if (source == setMasterItem)
21672250 {
2168
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21692252 {
2170
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21712254
21722255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21732256 content = ((cGroup)content).get(0);
....@@ -2180,9 +2263,9 @@
21802263 {
21812264 if (group.selection.size() == 1)
21822265 {
2183
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21842267 {
2185
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21862269
21872270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21882271 content = ((cGroup)content).get(0);
....@@ -2199,7 +2282,7 @@
21992282 {
22002283 RevertMeshes();
22012284 } else
2202
- if (source == resetMeshItem)
2285
+ if (source == resetAllItem)
22032286 {
22042287 ResetAll();
22052288 } else
....@@ -2248,7 +2331,7 @@
22482331 RandomNode random = new RandomNode();
22492332 group(random);
22502333 if (random.size() > 0)
2251
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
22522335 } else
22532336 if (source == physicsItem)
22542337 {
....@@ -2537,9 +2620,13 @@
25372620 {
25382621 SmoothMesh();
25392622 } else
2540
- if (source == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
25412624 {
25422625 TransformGeometry();
2626
+ } else
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
25432630 } else
25442631 if (source == resetTransformItem)
25452632 {
....@@ -2547,7 +2634,11 @@
25472634 } else
25482635 if (source == resetCentroidItem)
25492636 {
2550
- ResetCentroid();
2637
+ ResetCentroid(true);
2638
+ } else
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
25512642 } else
25522643 if (source == resetParentItem)
25532644 {
....@@ -2905,7 +2996,7 @@
29052996
29062997 child.editWindow = null; // ???????????
29072998 }
2908
- objEditor.ctrlPanel.validate();
2999
+ objEditor.ctrlPanel.FlushUI();
29093000 //objEditor.jTree.clearSelection();
29103001 //objEditor.ResetSliders();
29113002 refreshContents(true);
....@@ -2989,7 +3080,9 @@
29893080 frontView.object = group;
29903081 sideView.object = group;
29913082 }
2992
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
29933086 /*
29943087 currentLayout = radio.layout;
29953088 if (currentLayout == null)
....@@ -3063,6 +3156,28 @@
30633156 refreshContents();
30643157 }
30653158
3159
+ void TransformChildren()
3160
+ {
3161
+ Object3D obj;
3162
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3163
+ {
3164
+ obj = (Object3D)e.nextElement();
3165
+ obj.KeepTextureMatrices();
3166
+ obj.TransformChildren();
3167
+ obj.RestoreTextureMatrices();
3168
+
3169
+// if (obj.parent == null)
3170
+// {
3171
+// System.out.println("NULL PARENT!");
3172
+// new Exception().printStackTrace();
3173
+// }
3174
+// else
3175
+// TouchTransform(obj);
3176
+// //obj.parent.Touch();
3177
+ }
3178
+
3179
+ refreshContents();
3180
+ }
30663181
30673182 void ResetTransform()
30683183 {
....@@ -3175,7 +3290,7 @@
31753290 refreshContents();
31763291 }
31773292
3178
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
31793294 {
31803295 Object3D obj;
31813296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3190,12 +3305,16 @@
31903305 LA.matIdentity(Object3D.mat);
31913306 obj.getBounds(minima, maxima, false);
31923307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3193
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31943310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31953311 obj.TransformMesh(Object3D.mat);
3312
+
31963313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3197
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31983316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
31993318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32003319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32013320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3261,9 +3380,9 @@
32613380 obj = (Object3D)e.nextElement();
32623381
32633382 System.out.println("Object is: " + obj);
3264
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
32653384 System.out.println("Boundary rep: " + obj.bRep);
3266
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
32673386
32683387 // System.err.println((size/1024) + " KB is the size of " + obj);
32693388 }
....@@ -3477,8 +3596,8 @@
34773596
34783597 void ParseVertices()
34793598 {
3480
- boolean epsequal = GrafreeD.epsequal;
3481
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
34823601
34833602 for (int i=0; i<group.selection.size(); i++)
34843603 {
....@@ -3503,7 +3622,7 @@
35033622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35043623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35053624
3506
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
35073626
35083627 buffer.add(g);
35093628 }
....@@ -3518,7 +3637,7 @@
35183637 makeSomething(buffer, i==group.selection.size()-1);
35193638 }
35203639
3521
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
35223641
35233642 refreshContents();
35243643 }
....@@ -3536,7 +3655,16 @@
35363655 String pigment = Object3D.GetPigment(tex);
35373656 //String bump = Object3D.GetBump(tex);
35383657
3539
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3658
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3659
+
3660
+ try
3661
+ {
3662
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3663
+ }
3664
+ catch (Exception e)
3665
+ {
3666
+ System.err.println("FAIL: " + node);
3667
+ }
35403668
35413669 double s = v.s;
35423670
....@@ -3624,11 +3752,11 @@
36243752
36253753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36263754
3627
- boolean random = CameraPane.RANDOM;
3628
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
36293757 lowres.linkVerticesThis(null);
36303758 lowres.linkVerticesThis(sn);
3631
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
36323760
36333761 System.err.flush();
36343762
....@@ -3668,7 +3796,7 @@
36683796 return;
36693797
36703798 Object3D poses = group.selection.get(0);
3671
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
36723800
36733801 Object3D newgroup = new Object3D("Po:" + poses.name);
36743802
....@@ -3862,9 +3990,9 @@
38623990
38633991 void ClipMesh()
38643992 {
3865
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38663994 {
3867
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
38683996
38693997 if (content instanceof cGroup && ((cGroup)content).transientlink )
38703998 content = ((cGroup)content).get(0);
....@@ -3873,7 +4001,7 @@
38734001 // {
38744002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38754003 // }
3876
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
38774005 }
38784006 // group.selection.ClipMesh(GrafreeD.clipboard);
38794007 System.out.println("DONE.");
....@@ -4008,7 +4136,7 @@
40084136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40094137
40104138 Object3D elem = (Object3D)group.selection.elementAt(i);
4011
- if(elem != group)
4139
+ if(elem != group || !newWindow)
40124140 {
40134141 // if (!(elem instanceof Composite))
40144142 // newWindow = false;
....@@ -4113,12 +4241,12 @@
41134241 System.err.println("info : " + child.GetPath());
41144242 }
41154243 }
4116
- else
4117
- {
4118
- objEditor.SetMaterial(group); // .GetMaterial());
4119
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4120
- System.err.println("info : " + group.GetPath());
4121
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
41224250
41234251 objEditor.SetText(); // jan 2014
41244252
....@@ -4213,12 +4341,12 @@
42134341 {
42144342 if (group.selection.isEmpty())
42154343 return;
4216
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
42174345 Composite tGroup = null;
42184346 if (group.selection.size() > 0) // 1)
42194347 {
42204348 tGroup = new cGroup();
4221
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
42224350 }
42234351
42244352 if (cut)
....@@ -4258,16 +4386,16 @@
42584386 //System.out.println("cut " + child);
42594387 //System.out.println("parent = " + child.parent);
42604388 // tmp.addChild(child);
4261
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
42624390 tGroup.add/*Child*/(tmp);
42634391 else
4264
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
42654393 }
42664394 else
4267
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
42684396 tGroup.add/*Child*/(child);
42694397 else
4270
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
42714399 }
42724400
42734401 //ResetModel();
....@@ -4299,21 +4427,21 @@
42994427 //System.out.println("cut " + elem);
43004428 //System.out.println("parent = " + elem.parent);
43014429 // tmp.addChild(elem);
4302
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
43034431 tGroup.add/*Child*/(tmp);
43044432 else
4305
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
43064434 }
43074435 else
4308
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
43094437 tGroup.add/*Child*/(child);
43104438 else
4311
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
43124440 }
43134441
43144442 }
4315
- if (GrafreeD.clipboardIsTempGroup)
4316
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
43174445 if (cut)
43184446 {
43194447 ResetModel();
....@@ -4327,7 +4455,7 @@
43274455 // return;
43284456 boolean first = true;
43294457
4330
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
43314459 {
43324460 Composite temp;
43334461
....@@ -4338,7 +4466,7 @@
43384466 temp = (Composite)Applet3D.clipboard.deepCopy();
43394467 */
43404468 Object3D elem;
4341
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4469
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43424470 {
43434471 Object3D child = (Object3D)e.nextElement();
43444472
....@@ -4372,21 +4500,21 @@
43724500 //Object3D cb = Applet3D.clipboard;
43734501 //temp.addChild(cb);
43744502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4375
- assert(GrafreeD.clipboard.parent == null);
4376
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4377
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4378
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4379
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4503
+ assert(Grafreed.clipboard.parent == null);
4504
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4505
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4506
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4507
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43804508 else
4381
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4382
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
43834511 }
43844512
43854513 ResetModel();
43864514 refreshContents();
43874515 }
43884516
4389
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
43904518 {
43914519 // if (GrafreeD.clipboard == null)
43924520 // return;
....@@ -4415,15 +4543,22 @@
44154543 if (copyit)
44164544 {
44174545 // paste(false);
4418
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
44194554 }
44204555 else
44214556 {
44224557 boolean first = true;
44234558
4424
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
44254560 {
4426
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
44274562 Object3D copy;
44284563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44294564 {
....@@ -4433,7 +4568,7 @@
44334568 }
44344569 } else
44354570 {
4436
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
44374572 }
44384573 }
44394574 }
....@@ -4878,7 +5013,7 @@
48785013
48795014 void ImportVRMLX3D()
48805015 {
4881
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
48825017 {
48835018 /**/
48845019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4895,7 +5030,7 @@
48955030
48965031 String GetFile(String dialogName)
48975032 {
4898
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
48995034 {
49005035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49015036 browser.show();
....@@ -4959,10 +5094,12 @@
49595094 cButton flashSelectionButton;
49605095 cButton editButton;
49615096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
49625098 cButton clearpanelButton;
4963
- cButton allParamsButton;
49645099 cButton unselectButton;
49655100
5101
+ cButton oneStepButton;
5102
+
49665103 cButton screenfitButton;
49675104 cButton screenfitpointButton;
49685105 cButton snapobjectButton;
....@@ -5006,7 +5143,7 @@
50065143 private MenuItem linkverticesItem;
50075144 private MenuItem relinkverticesItem;
50085145 private MenuItem setMasterItem;
5009
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
50105147 private MenuItem stepAllItem;
50115148 private MenuItem revertMeshItem;
50125149 private MenuItem poseMeshItem;
....@@ -5017,6 +5154,7 @@
50175154 private MenuItem mergeGeometriesItem;
50185155 private MenuItem copyItem;
50195156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
50205158 private MenuItem pasteLinkItem;
50215159 private MenuItem pasteCloneItem;
50225160 private MenuItem pasteExpandItem;
....@@ -5066,8 +5204,10 @@
50665204 private MenuItem panoTexturesItem;
50675205
50685206 private MenuItem resetCentroidItem;
5069
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
50705208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
50715211 private MenuItem hideItem;
50725212 private MenuItem grabItem;
50735213 private MenuItem backItem;
....@@ -5114,7 +5254,7 @@
51145254 private MenuItem blobItem;
51155255 private MenuItem latheItem;
51165256 private MenuItem bezierItem;
5117
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
51185258 private MenuItem meshItem;
51195259 // private MenuItem meshGroupItem;
51205260 private MenuItem springItem;