Normand Briere
2019-09-20 cbe4e90105d07d7d3fecabffaa01342403aa2ae3
GroupEditor.java
....@@ -368,16 +368,6 @@
368368 refreshContents();
369369 }
370370
371
- public void Show3DView()
372
- {
373
- // bug
374
- //gridPanel.setDividerLocation(1.0);
375
- //bigPanel.setDividerLocation(0.0);
376
- bigThree.ClearUI();
377
- bigThree.add(centralPanel);
378
- bigThree.FlushUI();
379
- }
380
-
381371 //ObjEditor objEditor;
382372 public void closeUI2()
383373 {
....@@ -417,13 +407,13 @@
417407
418408 assert(false);
419409
420
- if (copy.versionlist == null)
421
- {
422
- copy.versionlist = new Object3D[100];
423
- copy.versionindex = -1;
424
-
425
- //Save(true);
426
- }
410
+// if (copy.versionlist == null)
411
+// {
412
+// copy.versionlist = new Object3D[100];
413
+// copy.versionindex = -1;
414
+//
415
+// //Save(true);
416
+// }
427417
428418 if(ui)
429419 SetupUI(objEditor);
....@@ -446,13 +436,13 @@
446436
447437 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
448438
449
- if (copy.versionlist == null)
450
- {
451
- copy.versionlist = new Object3D[100];
452
- copy.versionindex = -1;
453
-
454
- //Save(true);
455
- }
439
+// if (copy.versionlist == null)
440
+// {
441
+// copy.versionlist = new Object3D[100];
442
+// copy.versionindex = -1;
443
+//
444
+// //Save(true);
445
+// }
456446 }
457447
458448 void CloneSelection(boolean supports)
....@@ -493,11 +483,16 @@
493483
494484 Object3D parent = obj.parent;
495485 obj.parent = null;
486
+
496487 // Object3D support = obj.support;
497488 // obj.support = null;
498489 if (!supports)
499490 obj.SaveSupports();
491
+
500492 Object3D clone = (Object3D)Grafreed.clone(obj);
493
+
494
+ clone.ResetUUIDs();
495
+
501496 obj.parent = parent;
502497 // obj.support = support;
503498 // clone.support = support; // aout 2013
....@@ -567,8 +562,10 @@
567562 pasteLinkItem.addActionListener(this);
568563 pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
569564 pasteCloneItem.addActionListener(this);
570
-// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
571
-// pasteExpandItem.addActionListener(this);
565
+// CRASH
566
+ pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
567
+//
568
+ pasteExpandItem.addActionListener(this);
572569 //menu.add("-");
573570 oe.jTree.popup.addSeparator();
574571
....@@ -765,9 +762,9 @@
765762 shadowYItem.addActionListener(this);
766763 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
767764 shadowZItem.addActionListener(this);
765
+
768766 attributeItem = menu.add(new MenuItem("Attribute"));
769767 attributeItem.addActionListener(this);
770
-
771768 if (Globals.ADVANCED)
772769 {
773770 menu.add("-");
....@@ -779,11 +776,18 @@
779776 pointflowItem.addActionListener(this);
780777 }
781778 menu.add("-");
779
+ textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red"));
780
+ textureRatioRItem.addActionListener(this);
781
+ textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green"));
782
+ textureRatioGItem.addActionListener(this);
783
+ textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue"));
784
+ textureRatioBItem.addActionListener(this);
785
+ menu.add("-");
782786 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
783787 resetTransformItem.addActionListener(this);
784788 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
785789 resetCentroidItem.addActionListener(this);
786
- resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
790
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ"));
787791 resetCentroidXZItem.addActionListener(this);
788792 transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
789793 transformGeometryItem.addActionListener(this);
....@@ -799,7 +803,7 @@
799803 genNormalsCADItem.addActionListener(this);
800804 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
801805 genNormalsMESHItem.addActionListener(this);
802
- if (Globals.ADVANCED)
806
+ //if (Globals.ADVANCED)
803807 {
804808 genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
805809 genNormalsMINEItem.addActionListener(this);
....@@ -835,6 +839,8 @@
835839 }
836840
837841 oe.menuBar.add(menu = new Menu("Attributes"));
842
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
843
+ clearVersionsItem.addActionListener(this);
838844 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
839845 clearMaterialsItem.addActionListener(this);
840846 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -960,7 +966,7 @@
960966 currenttab.setName(tabname);
961967 //added = false;
962968 resourcecontainer.add(currenttab);
963
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
969
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname);
964970 rowcount = 1;
965971 colcount = 0;
966972 texturecount = 0;
....@@ -975,6 +981,11 @@
975981 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
976982 }
977983
984
+ columns = 5;
985
+
986
+ if (path[0].contains("D&R") || path[0].contains("Paint"))
987
+ columns = 4;
988
+
978989 AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
979990 totalcount++;
980991
....@@ -1072,13 +1083,17 @@
10721083 // }
10731084 // });
10741085
1086
+ oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1087
+ fullScreenButton.setToolTipText("Full-screen window");
1088
+ fullScreenButton.addActionListener(this);
1089
+
10751090 oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10761091 collapseButton.setToolTipText("Collapse toolbar");
10771092 collapseButton.addActionListener(this);
10781093
1079
- oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1080
- maximize3DButton.setToolTipText("Maximize 3D view");
1081
- maximize3DButton.addActionListener(this);
1094
+// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1095
+// maximize3DButton.setToolTipText("Maximize 3D view");
1096
+// maximize3DButton.addActionListener(this);
10821097
10831098 oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10841099 twoButton.setToolTipText("Show 3D view only");
....@@ -1098,10 +1113,6 @@
10981113 // sevenButton.setToolTipText("3-column layout");
10991114 // sevenButton.addActionListener(this);
11001115 //
1101
-
1102
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1103
- fullButton.setToolTipText("Full-screen window");
1104
- fullButton.addActionListener(this);
11051116
11061117 oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11071118 screenfitButton.setToolTipText("Screen fit");
....@@ -1189,6 +1200,7 @@
11891200 //clearButton.addActionListener(this);
11901201
11911202 cGridBag row1 = new cGridBag();
1203
+ row1.preferredHeight = 8;
11921204
11931205 // INSERT
11941206 row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1215,7 +1227,7 @@
12151227 torusButton.setToolTipText("Create torus");
12161228 torusButton.addActionListener(this);
12171229
1218
- if (Globals.ADVANCED)
1230
+ if (false) //Globals.ADVANCED)
12191231 {
12201232 oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12211233 kleinButton.setToolTipText("Create Klein bottle");
....@@ -1229,6 +1241,7 @@
12291241 oe.toolboxPanel.add(row1);
12301242
12311243 cGridBag row2 = new cGridBag();
1244
+ row2.preferredHeight = 8;
12321245
12331246 row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12341247 groupButton.setToolTipText("Create group");
....@@ -1331,6 +1344,7 @@
13311344
13321345 oe.treePanel.add(versionManagerPanel);
13331346 oe.treePanel.Return();
1347
+
13341348 versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
13351349 versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
13361350 versionSliderPane.preferredHeight = 3;
....@@ -1390,7 +1404,7 @@
13901404 // supportCB.setToolTipText("Enable rigging");
13911405 // supportCB.addItemListener(this);
13921406
1393
- panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1407
+ panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints);
13941408 freezeCB.setToolTipText("Fast moving camera");
13951409 freezeCB.addItemListener(this);
13961410
....@@ -1399,9 +1413,12 @@
13991413
14001414 panel.Return();
14011415
1416
+ if (Globals.ADVANCED)
1417
+ {
14021418 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
14031419 crowdCB.setToolTipText("Used for crowds");
14041420 crowdCB.addItemListener(this);
1421
+ }
14051422
14061423 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
14071424 smoothCB.setToolTipText("Snapping delay");
....@@ -1414,30 +1431,26 @@
14141431 minshaderCB.setToolTipText("Minimal fast shader");
14151432 minshaderCB.addItemListener(this);
14161433
1417
-// constraints.gridy += 1;
14181434 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
14191435 // speakerMocapCB.addItemListener(this);
14201436
1421
- panel.Return();
1422
-
14231437 if (false)
14241438 {
14251439 // handled in scripts
1426
- //constraints.gridy += 1;
14271440 panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
14281441 speakerCameraCB.addItemListener(this);
14291442
1430
- //constraints.gridy += 1;
14311443 panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
14321444 speakerFocusCB.addItemListener(this);
14331445
1434
- //constraints.gridy += 1;
1435
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1436
- smoothfocusCB.addItemListener(this);
14371446 panel.Return();
14381447 }
14391448
1440
-//constraints.gridx += 1;
1449
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1450
+ smoothfocusCB.addItemListener(this);
1451
+
1452
+ panel.Return();
1453
+
14411454 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
14421455 // debugCB.addItemListener(this);
14431456
....@@ -1491,7 +1504,7 @@
14911504
14921505 void EditObject(Object3D obj)
14931506 {
1494
- assert(obj instanceof Composite);
1507
+ //assert(obj instanceof Composite);
14951508
14961509 // if (obj.versionlist == null)
14971510 // {
....@@ -2076,7 +2089,7 @@
20762089 Object3D obj = (Object3D)group.selection.elementAt(0);
20772090 objEditor.ScreenFit(obj, false);
20782091
2079
- cameraView.pingthread.StepToTarget(true);
2092
+ cameraView.pingthread.StepToTarget(); //true);
20802093 refreshContents();
20812094 }
20822095
....@@ -2113,7 +2126,7 @@
21132126 obj.parent.TransformToWorld(maxima); //, maxima);
21142127 }
21152128
2116
- Object3D shadow = new Object3D("Shadow " + obj.name);
2129
+ Object3D shadow = new Object3D("Shadow" + obj.name);
21172130
21182131 shadow.toParent = LA.newMatrix();
21192132 shadow.fromParent = LA.newMatrix();
....@@ -2127,24 +2140,24 @@
21272140 switch(axis)
21282141 {
21292142 case 0 :
2130
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2131
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
2132
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2133
- vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z;
2143
+ vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z;
2144
+ vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z;
2145
+ vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z;
2146
+ vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z;
21342147 norm = cVector.X;
21352148 break;
21362149 case 1 :
2137
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2138
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2139
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2140
- vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z;
2150
+ vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z;
2151
+ vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z;
2152
+ vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z;
2153
+ vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z;
21412154 norm = cVector.Y;
21422155 break;
21432156 case 2 :
2144
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2145
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2146
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
2147
- vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z;
2157
+ vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f;
2158
+ vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f;
2159
+ vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f;
2160
+ vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f;
21482161 norm = cVector.Z;
21492162 break;
21502163 }
....@@ -2713,11 +2726,11 @@
27132726 if (!group.selection.isEmpty())
27142727 {
27152728 Composite csg = new GroupLeaf();
2729
+ group(csg);
27162730 csg.count = 5;
27172731 Composite child = new cGroup("Branch");
27182732 csg.addChild(child);
27192733 child.addChild(csg);
2720
- group(csg);
27212734 }
27222735 } else
27232736 if (source == doubleItem)
....@@ -2725,6 +2738,7 @@
27252738 if (!group.selection.isEmpty())
27262739 {
27272740 Composite csg = new GroupLeaf("Fork");
2741
+ group(csg);
27282742 csg.count = 5;
27292743 Composite child = new cGroup("Branch A");
27302744 csg.addChild(child);
....@@ -2732,7 +2746,6 @@
27322746 child = new cGroup("Branch B");
27332747 csg.addChild(child);
27342748 child.addChild(csg);
2735
- group(csg);
27362749 }
27372750 } else
27382751 if (source == tripleItem)
....@@ -2798,7 +2811,7 @@
27982811 {
27992812 Maximize();
28002813 } else
2801
- if (source == fullButton)
2814
+ if (source == fullScreenButton)
28022815 {
28032816 ToggleFullScreen();
28042817 } else
....@@ -2807,13 +2820,13 @@
28072820 this.expandedLayout = radio.layout;
28082821 CollapseToolbar();
28092822 } else
2810
- if (source == maximize3DButton)
2811
- {
2812
- this.expandedLayout = radio.layout;
2813
- radio.layout = twoButton;
2814
- Show3DView();
2815
- CollapseToolbar();
2816
- } else
2823
+// if (source == maximize3DButton)
2824
+// {
2825
+// this.expandedLayout = radio.layout;
2826
+// radio.layout = twoButton;
2827
+// CollapseToolbar();
2828
+// Show3DView();
2829
+// } else
28172830 if (source == previousVersionButton)
28182831 {
28192832 // Go to previous version
....@@ -2841,7 +2854,7 @@
28412854 if (source == saveVersionButton)
28422855 {
28432856 // Save a new version
2844
- if (!Save(true))
2857
+ if (!DuplicateVersion()) //true))
28452858 java.awt.Toolkit.getDefaultToolkit().beep();
28462859 } else
28472860 if (source == deleteVersionButton)
....@@ -3466,6 +3479,10 @@
34663479 {
34673480 ClearMaterials();
34683481 } else
3482
+ if (source == clearVersionsItem)
3483
+ {
3484
+ ClearVersions();
3485
+ } else
34693486 if (source == liveleavesItem)
34703487 {
34713488 LiveLeaves(true);
....@@ -3605,6 +3622,18 @@
36053622 if (source == transformChildrenItem)
36063623 {
36073624 TransformChildren();
3625
+ } else
3626
+ if (source == textureRatioRItem)
3627
+ {
3628
+ TextureRatio(0);
3629
+ } else
3630
+ if (source == textureRatioGItem)
3631
+ {
3632
+ TextureRatio(1);
3633
+ } else
3634
+ if (source == textureRatioBItem)
3635
+ {
3636
+ TextureRatio(2);
36083637 } else
36093638 if (source == resetTransformItem)
36103639 {
....@@ -3978,7 +4007,8 @@
39784007 if (source == closeButton)
39794008 {
39804009 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3981
- Replace();
4010
+ if (copy.versionlist != null)
4011
+ Replace();
39824012
39834013 cRadio ab;
39844014 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
....@@ -4078,7 +4108,8 @@
40784108 } else
40794109 if(source instanceof cRadio)
40804110 {
4081
- Replace();
4111
+ if (copy.versionlist != null)
4112
+ Replace();
40824113
40834114 group.parent = keepparent;
40844115 group.attributes = 0;
....@@ -4131,7 +4162,7 @@
41314162 */
41324163 radio.layout.doClick();
41334164
4134
- assert(copy instanceof Composite);
4165
+ //assert(copy instanceof Composite);
41354166
41364167 if (copy.versionlist == null)
41374168 {
....@@ -4142,12 +4173,15 @@
41424173 // and check if any of these nodes are reachable below the root.
41434174 Grafreed.grafreed.universe.TagObjects(copy, true);
41444175
4145
- if (!copy.HasTags())
4176
+ if (copy instanceof Composite && !copy.HasTags())
41464177 {
4147
- copy.versionlist = new Object3D[100];
4178
+ if (copy.versionlist == null)
4179
+ copy.versionlist = new Object3D[100];
41484180
4149
- Save(true);
4181
+ //Save(true);
41504182 }
4183
+ else
4184
+ copy.versionindex = -2;
41514185
41524186 Grafreed.grafreed.universe.TagObjects(copy, false);
41534187 }
....@@ -4267,9 +4301,46 @@
42674301 refreshContents();
42684302 }
42694303
4304
+ void TextureRatio(int axis)
4305
+ {
4306
+ Object3D obj;
4307
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4308
+ {
4309
+ obj = (Object3D)e.nextElement();
4310
+ obj.TextureRatio(axis);
4311
+ }
4312
+
4313
+ refreshContents();
4314
+ }
4315
+
42704316 void ResetTransform()
42714317 {
42724318 ResetTransform(-1);
4319
+ }
4320
+
4321
+ void ScaleSelection(int scale)
4322
+ {
4323
+ Object3D obj;
4324
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4325
+ {
4326
+ obj = (Object3D)e.nextElement();
4327
+
4328
+ if (obj.toParent == null)
4329
+ continue;
4330
+
4331
+ obj.Scale(scale);
4332
+
4333
+ if (obj.parent == null)
4334
+ {
4335
+ System.out.println("NULL PARENT!");
4336
+ // new Exception().printStackTrace();
4337
+ }
4338
+ else
4339
+ TouchTransform(obj);
4340
+ //obj.parent.Touch();
4341
+ }
4342
+
4343
+ refreshContents();
42734344 }
42744345
42754346 void ResetTransform(int mask)
....@@ -4282,38 +4353,8 @@
42824353 if (obj.toParent == null)
42834354 continue;
42844355
4285
- if (mask == -1)
4286
- {
4287
- if (obj instanceof Camera) // jan 2014
4288
- {
4289
- LA.matIdentity(obj.toParent);
4290
- LA.matIdentity(obj.fromParent);
4291
- }
4292
- else
4293
- {
4294
- obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
4295
- obj.fromParent = null; // LA.matIdentity(obj.fromParent);
4296
- }
4297
- TouchTransform(obj);
4298
- continue;
4299
- }
4300
- if ((mask&2) != 0) // Scale/rotation
4301
- {
4302
- obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
4303
- obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
4304
- obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
4305
- obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
4306
- obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
4307
- obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4308
- }
4309
- if ((mask&1) != 0) // Translation
4310
- {
4311
- if (obj.toParent != null)
4312
- {
4313
- obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
4314
- obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
4315
- }
4316
- }
4356
+ obj.ResetTransform(mask);
4357
+
43174358 if (obj.parent == null)
43184359 {
43194360 System.out.println("NULL PARENT!");
....@@ -4822,10 +4863,17 @@
48224863 {
48234864 Object3D obj = group.selection.get(i);
48244865
4866
+ if (obj.toParent == null)
4867
+ {
4868
+ obj.toParent = LA.newMatrix();
4869
+ obj.fromParent = LA.newMatrix();
4870
+ }
4871
+
48254872 LA.matTranslate(obj.toParent, i * scale, 0, 0);
48264873 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
48274874 }
48284875
4876
+ Globals.lighttouched = true;
48294877 refreshContents();
48304878 }
48314879
....@@ -5113,6 +5161,12 @@
51135161 refreshContents();
51145162 }
51155163
5164
+ void ClearVersions()
5165
+ {
5166
+ group.selection.ClearVersions();
5167
+ refreshContents();
5168
+ }
5169
+
51165170 void FlipV(boolean flip)
51175171 {
51185172 group.selection.FlipV(flip);
....@@ -5351,10 +5405,10 @@
53515405 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
53525406 // a camera
53535407 {
5354
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5408
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace
53555409 {
53565410 CameraPane.camerachangeframe = 0; // don't refuse it
5357
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5411
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true);
53585412 }
53595413 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
53605414 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
....@@ -5398,12 +5452,12 @@
53985452 }
53995453 }
54005454
5401
- rootButton.setEnabled(allComposites);
5455
+ rootButton.setEnabled(true); // allComposites);
54025456 }
54035457
54045458 void refreshContents(boolean cp)
54055459 {
5406
- if (Globals.ADVANCED)
5460
+ if (Globals.SHOWINFO)
54075461 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
54085462 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
54095463 {
....@@ -6354,6 +6408,7 @@
63546408 private MenuItem clipMeshItem;
63556409 private MenuItem smoothMeshItem;
63566410 private MenuItem clearMaterialsItem;
6411
+ private MenuItem clearVersionsItem;
63576412
63586413 private MenuItem liveleavesItem;
63596414 private MenuItem unliveleavesItem;
....@@ -6377,6 +6432,9 @@
63776432 private MenuItem maxTexturesItem;
63786433 private MenuItem panoTexturesItem;
63796434
6435
+ private MenuItem textureRatioRItem;
6436
+ private MenuItem textureRatioGItem;
6437
+ private MenuItem textureRatioBItem;
63806438 private MenuItem resetCentroidItem;
63816439 private MenuItem resetCentroidXZItem;
63826440 private MenuItem resetTransformItem;