Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
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
....@@ -210,10 +210,6 @@
210210 oe.menuBar.add(menu = new Menu("Setting"));
211211 if (Globals.ADVANCED)
212212 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218214 revertMeshItem.addActionListener(this);
219215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -318,8 +314,12 @@
318314 resetTransformItem.addActionListener(this);
319315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320316 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- 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);
323323
324324 oe.menuBar.add(menu = new Menu("Geometry"));
325325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -368,6 +368,10 @@
368368 oe.menuBar.add(menu = new Menu("Attributes"));
369369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370370 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);
371375 menu.add("-");
372376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
373377 liveleavesItem.addActionListener(this);
....@@ -422,31 +426,35 @@
422426 sortbysizeItem.addActionListener(this);
423427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424428 sortbynameItem.addActionListener(this);
429
+ 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);
425434 if (Globals.ADVANCED)
426435 {
427
- menu.add("-");
436
+ // Pretty much the same as duplicate and clone.
428437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429438 extractGeometriesItem.addActionListener(this);
430439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431440 cloneGeometriesItem.addActionListener(this);
432
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
- shareGeometriesItem.addActionListener(this);
434
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
- mergeGeometriesItem.addActionListener(this);
436441 }
437442
438443 oe.menuBar.add(menu = new Menu("Insert"));
439444 buildCreateMenu(menu);
440445
441446 oe.menuBar.add(menu = new Menu("Include"));
442
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
443
- importGFDItem.addActionListener(this);
444
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
445
- importVRMLX3DItem.addActionListener(this);
446
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
447448 importOBJItem.addActionListener(this);
448
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
449451 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);
450458
451459 oe.menuBar.add(menu = new Menu("Tools"));
452460 buildToolsMenu(menu);
....@@ -485,10 +493,10 @@
485493 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
486494
487495 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
- liveCB.setToolTipText("Enabled animation");
496
+ liveCB.setToolTipText("Enable animation");
489497 liveCB.addItemListener(this);
490498
491
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492500 oneStepButton.setToolTipText("Animate one step forward");
493501 oneStepButton.addActionListener(this);
494502
....@@ -500,7 +508,7 @@
500508 trackCB.setToolTipText("Enable tracking");
501509 trackCB.addItemListener(this);
502510
503
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504512 screenfitButton.setToolTipText("Screen fit");
505513 screenfitButton.addActionListener(this);
506514
....@@ -509,39 +517,39 @@
509517
510518 if (Globals.ADVANCED)
511519 {
512
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
513521 snapobjectButton.addActionListener(this);
514522 snapobjectButton.setToolTipText("Snap Object");
515523 }
516524
517
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
518526 flashSelectionButton.setToolTipText("Show selection");
519527 flashSelectionButton.addActionListener(this);
520528
521529 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522530
523
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
524532 twoButton.setToolTipText("Show center view only");
525533 twoButton.addActionListener(this);
526
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527535 fourButton.addActionListener(this);
528536 fourButton.setToolTipText("Show left panel only");
529
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530538 sixButton.setToolTipText("2-column layout left");
531539 sixButton.addActionListener(this);
532
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533541 threeButton.setToolTipText("2-column layout right");
534542 threeButton.addActionListener(this);
535
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536544 sevenButton.setToolTipText("3-column layout");
537545 sevenButton.addActionListener(this);
538546 //
539547
540
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541549 rootButton.setToolTipText("Edit selection in new tab");
542550 rootButton.addActionListener(this);
543551
544
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
545553 closeButton.setToolTipText("Close tab");
546554 closeButton.addActionListener(this);
547555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -549,11 +557,11 @@
549557
550558 cGridBag commandsPanel = new cGridBag();
551559
552
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553561 editButton.setToolTipText("Edit selection");
554562 editButton.addActionListener(this);
555563
556
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557565 uneditButton.setToolTipText("Unedit selection");
558566 uneditButton.addActionListener(this);
559567
....@@ -561,11 +569,11 @@
561569 allParamsButton.setToolTipText("Edit all params");
562570 allParamsButton.addActionListener(this);
563571
564
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565573 clearPanelButton.setToolTipText("Clear edit panel");
566574 clearPanelButton.addActionListener(this);
567575
568
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569577 unselectButton.setToolTipText("Unselect");
570578 unselectButton.addActionListener(this);
571579
....@@ -648,7 +656,7 @@
648656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649657 zoomBoxCB.addItemListener(this);
650658
651
- if (Globals.ADVANCED)
659
+ if (true) // Globals.ADVANCED)
652660 {
653661 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654662 supportCB.setToolTipText("Enable rigging");
....@@ -721,6 +729,7 @@
721729 buttonGroup.add(radioButton);
722730 radioButton.doClick();
723731 }
732
+
724733 void SetupViews(ObjEditor oe)
725734 {
726735 oe.SetupViews();
....@@ -937,7 +946,9 @@
937946 // objEditor.DropFile((java.io.File[]) object, true);
938947 // return;
939948 // }
940
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
941952 {
942953 // file(s)
943954 String[] names = string.split("\n");
....@@ -964,7 +975,7 @@
964975
965976 flashIt = false;
966977 CameraPane pane = (CameraPane) target;
967
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
968979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
969980
970981 if (group.selection.size() == 1)
....@@ -1537,9 +1548,9 @@
15371548
15381549 void Overwrite(int mask)
15391550 {
1540
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15411552 {
1542
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
15431554
15441555 if (content instanceof cGroup && ((cGroup)content).transientlink )
15451556 content = ((cGroup)content).get(0);
....@@ -1859,7 +1870,15 @@
18591870 } else
18601871 if (source == importOBJItem)
18611872 {
1862
- 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
+ }
18631882 } else
18641883 if (source == computeAOItem)
18651884 {
....@@ -1879,7 +1898,7 @@
18791898 if (source == invariantsItem)
18801899 {
18811900 System.out.println("Invariants:");
1882
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
18831902 } else
18841903 if (source == memoryItem)
18851904 {
....@@ -1954,10 +1973,10 @@
19541973 } else
19551974 if (source == duplicateItem)
19561975 {
1957
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
19581977 loadClipboard(false);
19591978 paste(false);
1960
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
19611980 } else
19621981 if (source == cloneItem)
19631982 {
....@@ -2177,9 +2196,9 @@
21772196 // group.selection.get(0).setMasterThis(content); // should be identity
21782197 // refreshContents();
21792198 // }
2180
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21812200 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
21832202
21842203 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852204 content = ((cGroup)content).get(0);
....@@ -2229,9 +2248,9 @@
22292248 } else
22302249 if (source == setMasterItem)
22312250 {
2232
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22332252 {
2234
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
22352254
22362255 if (content instanceof cGroup && ((cGroup)content).transientlink )
22372256 content = ((cGroup)content).get(0);
....@@ -2244,9 +2263,9 @@
22442263 {
22452264 if (group.selection.size() == 1)
22462265 {
2247
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
22482267 {
2249
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
22502269
22512270 if (content instanceof cGroup && ((cGroup)content).transientlink )
22522271 content = ((cGroup)content).get(0);
....@@ -2263,7 +2282,7 @@
22632282 {
22642283 RevertMeshes();
22652284 } else
2266
- if (source == resetMeshItem)
2285
+ if (source == resetAllItem)
22672286 {
22682287 ResetAll();
22692288 } else
....@@ -2601,9 +2620,13 @@
26012620 {
26022621 SmoothMesh();
26032622 } else
2604
- if (source == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
26052624 {
26062625 TransformGeometry();
2626
+ } else
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
26072630 } else
26082631 if (source == resetTransformItem)
26092632 {
....@@ -2611,7 +2634,11 @@
26112634 } else
26122635 if (source == resetCentroidItem)
26132636 {
2614
- ResetCentroid();
2637
+ ResetCentroid(true);
2638
+ } else
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
26152642 } else
26162643 if (source == resetParentItem)
26172644 {
....@@ -3053,7 +3080,9 @@
30533080 frontView.object = group;
30543081 sideView.object = group;
30553082 }
3056
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
30573086 /*
30583087 currentLayout = radio.layout;
30593088 if (currentLayout == null)
....@@ -3127,6 +3156,28 @@
31273156 refreshContents();
31283157 }
31293158
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
+ }
31303181
31313182 void ResetTransform()
31323183 {
....@@ -3239,7 +3290,7 @@
32393290 refreshContents();
32403291 }
32413292
3242
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
32433294 {
32443295 Object3D obj;
32453296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3254,12 +3305,16 @@
32543305 LA.matIdentity(Object3D.mat);
32553306 obj.getBounds(minima, maxima, false);
32563307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3257
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32583310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32593311 obj.TransformMesh(Object3D.mat);
3312
+
32603313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3261
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32623316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
32633318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32643319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32653320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3325,9 +3380,9 @@
33253380 obj = (Object3D)e.nextElement();
33263381
33273382 System.out.println("Object is: " + obj);
3328
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
33293384 System.out.println("Boundary rep: " + obj.bRep);
3330
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
33313386
33323387 // System.err.println((size/1024) + " KB is the size of " + obj);
33333388 }
....@@ -3541,8 +3596,8 @@
35413596
35423597 void ParseVertices()
35433598 {
3544
- boolean epsequal = GrafreeD.epsequal;
3545
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
35463601
35473602 for (int i=0; i<group.selection.size(); i++)
35483603 {
....@@ -3567,7 +3622,7 @@
35673622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35683623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35693624
3570
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
35713626
35723627 buffer.add(g);
35733628 }
....@@ -3582,7 +3637,7 @@
35823637 makeSomething(buffer, i==group.selection.size()-1);
35833638 }
35843639
3585
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
35863641
35873642 refreshContents();
35883643 }
....@@ -3600,7 +3655,16 @@
36003655 String pigment = Object3D.GetPigment(tex);
36013656 //String bump = Object3D.GetBump(tex);
36023657
3603
- 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
+ }
36043668
36053669 double s = v.s;
36063670
....@@ -3732,7 +3796,7 @@
37323796 return;
37333797
37343798 Object3D poses = group.selection.get(0);
3735
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
37363800
37373801 Object3D newgroup = new Object3D("Po:" + poses.name);
37383802
....@@ -3926,9 +3990,9 @@
39263990
39273991 void ClipMesh()
39283992 {
3929
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39303994 {
3931
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
39323996
39333997 if (content instanceof cGroup && ((cGroup)content).transientlink )
39343998 content = ((cGroup)content).get(0);
....@@ -3937,7 +4001,7 @@
39374001 // {
39384002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39394003 // }
3940
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
39414005 }
39424006 // group.selection.ClipMesh(GrafreeD.clipboard);
39434007 System.out.println("DONE.");
....@@ -4072,7 +4136,7 @@
40724136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40734137
40744138 Object3D elem = (Object3D)group.selection.elementAt(i);
4075
- if(elem != group)
4139
+ if(elem != group || !newWindow)
40764140 {
40774141 // if (!(elem instanceof Composite))
40784142 // newWindow = false;
....@@ -4277,12 +4341,12 @@
42774341 {
42784342 if (group.selection.isEmpty())
42794343 return;
4280
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
42814345 Composite tGroup = null;
42824346 if (group.selection.size() > 0) // 1)
42834347 {
42844348 tGroup = new cGroup();
4285
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
42864350 }
42874351
42884352 if (cut)
....@@ -4322,16 +4386,16 @@
43224386 //System.out.println("cut " + child);
43234387 //System.out.println("parent = " + child.parent);
43244388 // tmp.addChild(child);
4325
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
43264390 tGroup.add/*Child*/(tmp);
43274391 else
4328
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
43294393 }
43304394 else
4331
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
43324396 tGroup.add/*Child*/(child);
43334397 else
4334
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
43354399 }
43364400
43374401 //ResetModel();
....@@ -4363,21 +4427,21 @@
43634427 //System.out.println("cut " + elem);
43644428 //System.out.println("parent = " + elem.parent);
43654429 // tmp.addChild(elem);
4366
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
43674431 tGroup.add/*Child*/(tmp);
43684432 else
4369
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
43704434 }
43714435 else
4372
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
43734437 tGroup.add/*Child*/(child);
43744438 else
4375
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
43764440 }
43774441
43784442 }
4379
- if (GrafreeD.clipboardIsTempGroup)
4380
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
43814445 if (cut)
43824446 {
43834447 ResetModel();
....@@ -4391,7 +4455,7 @@
43914455 // return;
43924456 boolean first = true;
43934457
4394
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
43954459 {
43964460 Composite temp;
43974461
....@@ -4402,7 +4466,7 @@
44024466 temp = (Composite)Applet3D.clipboard.deepCopy();
44034467 */
44044468 Object3D elem;
4405
- 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))
44064470 {
44074471 Object3D child = (Object3D)e.nextElement();
44084472
....@@ -4436,14 +4500,14 @@
44364500 //Object3D cb = Applet3D.clipboard;
44374501 //temp.addChild(cb);
44384502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4439
- assert(GrafreeD.clipboard.parent == null);
4440
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4441
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4442
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4443
- 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());
44444508 else
4445
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4446
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
44474511 }
44484512
44494513 ResetModel();
....@@ -4492,9 +4556,9 @@
44924556 {
44934557 boolean first = true;
44944558
4495
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
44964560 {
4497
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
44984562 Object3D copy;
44994563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45004564 {
....@@ -4504,7 +4568,7 @@
45044568 }
45054569 } else
45064570 {
4507
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
45084572 }
45094573 }
45104574 }
....@@ -4949,7 +5013,7 @@
49495013
49505014 void ImportVRMLX3D()
49515015 {
4952
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
49535017 {
49545018 /**/
49555019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4966,7 +5030,7 @@
49665030
49675031 String GetFile(String dialogName)
49685032 {
4969
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
49705034 {
49715035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49725036 browser.show();
....@@ -5079,7 +5143,7 @@
50795143 private MenuItem linkverticesItem;
50805144 private MenuItem relinkverticesItem;
50815145 private MenuItem setMasterItem;
5082
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
50835147 private MenuItem stepAllItem;
50845148 private MenuItem revertMeshItem;
50855149 private MenuItem poseMeshItem;
....@@ -5140,8 +5204,10 @@
51405204 private MenuItem panoTexturesItem;
51415205
51425206 private MenuItem resetCentroidItem;
5143
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
51445208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
51455211 private MenuItem hideItem;
51465212 private MenuItem grabItem;
51475213 private MenuItem backItem;