Normand Briere
2019-09-18 f9325048496d7cdbcad233f8a6b84c88e79adcc2
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"));
....@@ -936,6 +942,8 @@
936942 cGridBag currenttab;
937943 //boolean added; // patch for jar
938944
945
+ int totalcount = 0;
946
+
939947 int tabcount = 0;
940948 int colcount = 0;
941949 int rowcount = 0;
....@@ -958,7 +966,7 @@
958966 currenttab.setName(tabname);
959967 //added = false;
960968 resourcecontainer.add(currenttab);
961
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
969
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname);
962970 rowcount = 1;
963971 colcount = 0;
964972 texturecount = 0;
....@@ -973,7 +981,13 @@
973981 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
974982 }
975983
984
+ columns = 5;
985
+
986
+ if (path[0].contains("D&R") || path[0].contains("Paint"))
987
+ columns = 4;
988
+
976989 AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
990
+ totalcount++;
977991
978992 if (++colcount >= columns)
979993 {
....@@ -999,6 +1013,8 @@
9991013 container.add(resourcecontainer);
10001014
10011015 Grafreed.ParseResources("textures", this);
1016
+
1017
+ // 935. System.out.println("Total = " + totalcount);
10021018 }
10031019
10041020 void SetupUI2(ObjEditor oe)
....@@ -1067,13 +1083,17 @@
10671083 // }
10681084 // });
10691085
1086
+ oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1087
+ fullScreenButton.setToolTipText("Full-screen window");
1088
+ fullScreenButton.addActionListener(this);
1089
+
10701090 oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10711091 collapseButton.setToolTipText("Collapse toolbar");
10721092 collapseButton.addActionListener(this);
10731093
1074
- oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1075
- maximize3DButton.setToolTipText("Maximize 3D view");
1076
- 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);
10771097
10781098 oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10791099 twoButton.setToolTipText("Show 3D view only");
....@@ -1093,10 +1113,6 @@
10931113 // sevenButton.setToolTipText("3-column layout");
10941114 // sevenButton.addActionListener(this);
10951115 //
1096
-
1097
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1098
- fullButton.setToolTipText("Full-screen window");
1099
- fullButton.addActionListener(this);
11001116
11011117 oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11021118 screenfitButton.setToolTipText("Screen fit");
....@@ -1184,6 +1200,7 @@
11841200 //clearButton.addActionListener(this);
11851201
11861202 cGridBag row1 = new cGridBag();
1203
+ row1.preferredHeight = 8;
11871204
11881205 // INSERT
11891206 row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1210,7 +1227,7 @@
12101227 torusButton.setToolTipText("Create torus");
12111228 torusButton.addActionListener(this);
12121229
1213
- if (Globals.ADVANCED)
1230
+ if (false) //Globals.ADVANCED)
12141231 {
12151232 oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12161233 kleinButton.setToolTipText("Create Klein bottle");
....@@ -1224,6 +1241,7 @@
12241241 oe.toolboxPanel.add(row1);
12251242
12261243 cGridBag row2 = new cGridBag();
1244
+ row2.preferredHeight = 8;
12271245
12281246 row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12291247 groupButton.setToolTipText("Create group");
....@@ -1326,6 +1344,7 @@
13261344
13271345 oe.treePanel.add(versionManagerPanel);
13281346 oe.treePanel.Return();
1347
+
13291348 versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
13301349 versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
13311350 versionSliderPane.preferredHeight = 3;
....@@ -1385,7 +1404,7 @@
13851404 // supportCB.setToolTipText("Enable rigging");
13861405 // supportCB.addItemListener(this);
13871406
1388
- panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1407
+ panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints);
13891408 freezeCB.setToolTipText("Fast moving camera");
13901409 freezeCB.addItemListener(this);
13911410
....@@ -1394,9 +1413,12 @@
13941413
13951414 panel.Return();
13961415
1416
+ if (Globals.ADVANCED)
1417
+ {
13971418 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
13981419 crowdCB.setToolTipText("Used for crowds");
13991420 crowdCB.addItemListener(this);
1421
+ }
14001422
14011423 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
14021424 smoothCB.setToolTipText("Snapping delay");
....@@ -1409,30 +1431,26 @@
14091431 minshaderCB.setToolTipText("Minimal fast shader");
14101432 minshaderCB.addItemListener(this);
14111433
1412
-// constraints.gridy += 1;
14131434 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
14141435 // speakerMocapCB.addItemListener(this);
14151436
1416
- panel.Return();
1417
-
14181437 if (false)
14191438 {
14201439 // handled in scripts
1421
- //constraints.gridy += 1;
14221440 panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
14231441 speakerCameraCB.addItemListener(this);
14241442
1425
- //constraints.gridy += 1;
14261443 panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
14271444 speakerFocusCB.addItemListener(this);
14281445
1429
- //constraints.gridy += 1;
1430
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1431
- smoothfocusCB.addItemListener(this);
14321446 panel.Return();
14331447 }
14341448
1435
-//constraints.gridx += 1;
1449
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1450
+ smoothfocusCB.addItemListener(this);
1451
+
1452
+ panel.Return();
1453
+
14361454 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
14371455 // debugCB.addItemListener(this);
14381456
....@@ -1486,7 +1504,7 @@
14861504
14871505 void EditObject(Object3D obj)
14881506 {
1489
- assert(obj instanceof Composite);
1507
+ //assert(obj instanceof Composite);
14901508
14911509 // if (obj.versionlist == null)
14921510 // {
....@@ -2071,7 +2089,7 @@
20712089 Object3D obj = (Object3D)group.selection.elementAt(0);
20722090 objEditor.ScreenFit(obj, false);
20732091
2074
- cameraView.pingthread.StepToTarget(true);
2092
+ cameraView.pingthread.StepToTarget(); //true);
20752093 refreshContents();
20762094 }
20772095
....@@ -2108,7 +2126,7 @@
21082126 obj.parent.TransformToWorld(maxima); //, maxima);
21092127 }
21102128
2111
- Object3D shadow = new Object3D("Shadow " + obj.name);
2129
+ Object3D shadow = new Object3D("Shadow" + obj.name);
21122130
21132131 shadow.toParent = LA.newMatrix();
21142132 shadow.fromParent = LA.newMatrix();
....@@ -2122,24 +2140,24 @@
21222140 switch(axis)
21232141 {
21242142 case 0 :
2125
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2126
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
2127
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2128
- 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;
21292147 norm = cVector.X;
21302148 break;
21312149 case 1 :
2132
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2133
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2134
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2135
- 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;
21362154 norm = cVector.Y;
21372155 break;
21382156 case 2 :
2139
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2140
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2141
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
2142
- 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;
21432161 norm = cVector.Z;
21442162 break;
21452163 }
....@@ -2708,11 +2726,11 @@
27082726 if (!group.selection.isEmpty())
27092727 {
27102728 Composite csg = new GroupLeaf();
2729
+ group(csg);
27112730 csg.count = 5;
27122731 Composite child = new cGroup("Branch");
27132732 csg.addChild(child);
27142733 child.addChild(csg);
2715
- group(csg);
27162734 }
27172735 } else
27182736 if (source == doubleItem)
....@@ -2720,6 +2738,7 @@
27202738 if (!group.selection.isEmpty())
27212739 {
27222740 Composite csg = new GroupLeaf("Fork");
2741
+ group(csg);
27232742 csg.count = 5;
27242743 Composite child = new cGroup("Branch A");
27252744 csg.addChild(child);
....@@ -2727,7 +2746,6 @@
27272746 child = new cGroup("Branch B");
27282747 csg.addChild(child);
27292748 child.addChild(csg);
2730
- group(csg);
27312749 }
27322750 } else
27332751 if (source == tripleItem)
....@@ -2793,7 +2811,7 @@
27932811 {
27942812 Maximize();
27952813 } else
2796
- if (source == fullButton)
2814
+ if (source == fullScreenButton)
27972815 {
27982816 ToggleFullScreen();
27992817 } else
....@@ -2802,13 +2820,13 @@
28022820 this.expandedLayout = radio.layout;
28032821 CollapseToolbar();
28042822 } else
2805
- if (source == maximize3DButton)
2806
- {
2807
- this.expandedLayout = radio.layout;
2808
- radio.layout = twoButton;
2809
- Show3DView();
2810
- CollapseToolbar();
2811
- } else
2823
+// if (source == maximize3DButton)
2824
+// {
2825
+// this.expandedLayout = radio.layout;
2826
+// radio.layout = twoButton;
2827
+// CollapseToolbar();
2828
+// Show3DView();
2829
+// } else
28122830 if (source == previousVersionButton)
28132831 {
28142832 // Go to previous version
....@@ -2836,7 +2854,7 @@
28362854 if (source == saveVersionButton)
28372855 {
28382856 // Save a new version
2839
- if (!Save(true))
2857
+ if (!DuplicateVersion()) //true))
28402858 java.awt.Toolkit.getDefaultToolkit().beep();
28412859 } else
28422860 if (source == deleteVersionButton)
....@@ -3461,6 +3479,10 @@
34613479 {
34623480 ClearMaterials();
34633481 } else
3482
+ if (source == clearVersionsItem)
3483
+ {
3484
+ ClearVersions();
3485
+ } else
34643486 if (source == liveleavesItem)
34653487 {
34663488 LiveLeaves(true);
....@@ -3600,6 +3622,18 @@
36003622 if (source == transformChildrenItem)
36013623 {
36023624 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);
36033637 } else
36043638 if (source == resetTransformItem)
36053639 {
....@@ -3973,7 +4007,8 @@
39734007 if (source == closeButton)
39744008 {
39754009 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3976
- Replace();
4010
+ if (copy.versionlist != null)
4011
+ Replace();
39774012
39784013 cRadio ab;
39794014 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
....@@ -4073,7 +4108,8 @@
40734108 } else
40744109 if(source instanceof cRadio)
40754110 {
4076
- Replace();
4111
+ if (copy.versionlist != null)
4112
+ Replace();
40774113
40784114 group.parent = keepparent;
40794115 group.attributes = 0;
....@@ -4126,7 +4162,7 @@
41264162 */
41274163 radio.layout.doClick();
41284164
4129
- assert(copy instanceof Composite);
4165
+ //assert(copy instanceof Composite);
41304166
41314167 if (copy.versionlist == null)
41324168 {
....@@ -4137,12 +4173,15 @@
41374173 // and check if any of these nodes are reachable below the root.
41384174 Grafreed.grafreed.universe.TagObjects(copy, true);
41394175
4140
- if (!copy.HasTags())
4176
+ if (copy instanceof Composite && !copy.HasTags())
41414177 {
4142
- copy.versionlist = new Object3D[100];
4178
+ if (copy.versionlist == null)
4179
+ copy.versionlist = new Object3D[100];
41434180
4144
- Save(true);
4181
+ //Save(true);
41454182 }
4183
+ else
4184
+ copy.versionindex = -2;
41464185
41474186 Grafreed.grafreed.universe.TagObjects(copy, false);
41484187 }
....@@ -4262,9 +4301,46 @@
42624301 refreshContents();
42634302 }
42644303
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
+
42654316 void ResetTransform()
42664317 {
42674318 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();
42684344 }
42694345
42704346 void ResetTransform(int mask)
....@@ -4277,38 +4353,8 @@
42774353 if (obj.toParent == null)
42784354 continue;
42794355
4280
- if (mask == -1)
4281
- {
4282
- if (obj instanceof Camera) // jan 2014
4283
- {
4284
- LA.matIdentity(obj.toParent);
4285
- LA.matIdentity(obj.fromParent);
4286
- }
4287
- else
4288
- {
4289
- obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
4290
- obj.fromParent = null; // LA.matIdentity(obj.fromParent);
4291
- }
4292
- TouchTransform(obj);
4293
- continue;
4294
- }
4295
- if ((mask&2) != 0) // Scale/rotation
4296
- {
4297
- obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
4298
- obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
4299
- obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
4300
- obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
4301
- obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
4302
- obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4303
- }
4304
- if ((mask&1) != 0) // Translation
4305
- {
4306
- if (obj.toParent != null)
4307
- {
4308
- obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
4309
- obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
4310
- }
4311
- }
4356
+ obj.ResetTransform(mask);
4357
+
43124358 if (obj.parent == null)
43134359 {
43144360 System.out.println("NULL PARENT!");
....@@ -4817,10 +4863,17 @@
48174863 {
48184864 Object3D obj = group.selection.get(i);
48194865
4866
+ if (obj.toParent == null)
4867
+ {
4868
+ obj.toParent = LA.newMatrix();
4869
+ obj.fromParent = LA.newMatrix();
4870
+ }
4871
+
48204872 LA.matTranslate(obj.toParent, i * scale, 0, 0);
48214873 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
48224874 }
48234875
4876
+ Globals.lighttouched = true;
48244877 refreshContents();
48254878 }
48264879
....@@ -5108,6 +5161,12 @@
51085161 refreshContents();
51095162 }
51105163
5164
+ void ClearVersions()
5165
+ {
5166
+ group.selection.ClearVersions();
5167
+ refreshContents();
5168
+ }
5169
+
51115170 void FlipV(boolean flip)
51125171 {
51135172 group.selection.FlipV(flip);
....@@ -5346,10 +5405,10 @@
53465405 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
53475406 // a camera
53485407 {
5349
- 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
53505409 {
53515410 CameraPane.camerachangeframe = 0; // don't refuse it
5352
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5411
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true);
53535412 }
53545413 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
53555414 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
....@@ -5393,12 +5452,12 @@
53935452 }
53945453 }
53955454
5396
- rootButton.setEnabled(allComposites);
5455
+ rootButton.setEnabled(true); // allComposites);
53975456 }
53985457
53995458 void refreshContents(boolean cp)
54005459 {
5401
- if (Globals.ADVANCED)
5460
+ if (Globals.SHOWINFO)
54025461 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
54035462 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
54045463 {
....@@ -6349,6 +6408,7 @@
63496408 private MenuItem clipMeshItem;
63506409 private MenuItem smoothMeshItem;
63516410 private MenuItem clearMaterialsItem;
6411
+ private MenuItem clearVersionsItem;
63526412
63536413 private MenuItem liveleavesItem;
63546414 private MenuItem unliveleavesItem;
....@@ -6372,6 +6432,9 @@
63726432 private MenuItem maxTexturesItem;
63736433 private MenuItem panoTexturesItem;
63746434
6435
+ private MenuItem textureRatioRItem;
6436
+ private MenuItem textureRatioGItem;
6437
+ private MenuItem textureRatioBItem;
63756438 private MenuItem resetCentroidItem;
63766439 private MenuItem resetCentroidXZItem;
63776440 private MenuItem resetTransformItem;