Normand Briere
2019-09-20 cbe4e90105d07d7d3fecabffaa01342403aa2ae3
GroupEditor.java
....@@ -347,7 +347,7 @@
347347
348348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
349349 {
350
- JTabbedPane skyboxpane = new JTabbedPane();
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351351
352352 AddSkyboxTab0(skyboxpane);
353353 AddSkyboxTab1(skyboxpane);
....@@ -366,16 +366,6 @@
366366 }
367367
368368 refreshContents();
369
- }
370
-
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();
379369 }
380370
381371 //ObjEditor objEditor;
....@@ -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,13 +966,13 @@
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;
965973 }
966974
967
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
975
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
968976 {
969977 //if (!added)
970978 {
....@@ -973,7 +981,13 @@
973981 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
974982 }
975983
976
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
984
+ columns = 5;
985
+
986
+ if (path[0].contains("D&R") || path[0].contains("Paint"))
987
+ columns = 4;
988
+
989
+ 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");
....@@ -1259,7 +1277,10 @@
12591277
12601278 CreateTexturePanel(textures);
12611279
1262
- resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1280
+ int tabCount = resourcecontainer.getTabCount();
1281
+
1282
+ if (tabCount > 0)
1283
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
12631284
12641285 oe.toolboxPanel.add(textures);
12651286
....@@ -1323,6 +1344,7 @@
13231344
13241345 oe.treePanel.add(versionManagerPanel);
13251346 oe.treePanel.Return();
1347
+
13261348 versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
13271349 versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
13281350 versionSliderPane.preferredHeight = 3;
....@@ -1382,7 +1404,7 @@
13821404 // supportCB.setToolTipText("Enable rigging");
13831405 // supportCB.addItemListener(this);
13841406
1385
- panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1407
+ panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints);
13861408 freezeCB.setToolTipText("Fast moving camera");
13871409 freezeCB.addItemListener(this);
13881410
....@@ -1391,9 +1413,12 @@
13911413
13921414 panel.Return();
13931415
1416
+ if (Globals.ADVANCED)
1417
+ {
13941418 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
13951419 crowdCB.setToolTipText("Used for crowds");
13961420 crowdCB.addItemListener(this);
1421
+ }
13971422
13981423 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
13991424 smoothCB.setToolTipText("Snapping delay");
....@@ -1406,30 +1431,26 @@
14061431 minshaderCB.setToolTipText("Minimal fast shader");
14071432 minshaderCB.addItemListener(this);
14081433
1409
-// constraints.gridy += 1;
14101434 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
14111435 // speakerMocapCB.addItemListener(this);
14121436
1413
- panel.Return();
1414
-
14151437 if (false)
14161438 {
14171439 // handled in scripts
1418
- //constraints.gridy += 1;
14191440 panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
14201441 speakerCameraCB.addItemListener(this);
14211442
1422
- //constraints.gridy += 1;
14231443 panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
14241444 speakerFocusCB.addItemListener(this);
14251445
1426
- //constraints.gridy += 1;
1427
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1428
- smoothfocusCB.addItemListener(this);
14291446 panel.Return();
14301447 }
14311448
1432
-//constraints.gridx += 1;
1449
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1450
+ smoothfocusCB.addItemListener(this);
1451
+
1452
+ panel.Return();
1453
+
14331454 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
14341455 // debugCB.addItemListener(this);
14351456
....@@ -1483,7 +1504,7 @@
14831504
14841505 void EditObject(Object3D obj)
14851506 {
1486
- assert(obj instanceof Composite);
1507
+ //assert(obj instanceof Composite);
14871508
14881509 // if (obj.versionlist == null)
14891510 // {
....@@ -2068,7 +2089,7 @@
20682089 Object3D obj = (Object3D)group.selection.elementAt(0);
20692090 objEditor.ScreenFit(obj, false);
20702091
2071
- cameraView.pingthread.StepToTarget(true);
2092
+ cameraView.pingthread.StepToTarget(); //true);
20722093 refreshContents();
20732094 }
20742095
....@@ -2105,7 +2126,7 @@
21052126 obj.parent.TransformToWorld(maxima); //, maxima);
21062127 }
21072128
2108
- Object3D shadow = new Object3D("Shadow " + obj.name);
2129
+ Object3D shadow = new Object3D("Shadow" + obj.name);
21092130
21102131 shadow.toParent = LA.newMatrix();
21112132 shadow.fromParent = LA.newMatrix();
....@@ -2119,24 +2140,24 @@
21192140 switch(axis)
21202141 {
21212142 case 0 :
2122
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2123
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
2124
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2125
- 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;
21262147 norm = cVector.X;
21272148 break;
21282149 case 1 :
2129
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2130
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2131
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2132
- 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;
21332154 norm = cVector.Y;
21342155 break;
21352156 case 2 :
2136
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2137
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2138
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
2139
- 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;
21402161 norm = cVector.Z;
21412162 break;
21422163 }
....@@ -2705,11 +2726,11 @@
27052726 if (!group.selection.isEmpty())
27062727 {
27072728 Composite csg = new GroupLeaf();
2729
+ group(csg);
27082730 csg.count = 5;
27092731 Composite child = new cGroup("Branch");
27102732 csg.addChild(child);
27112733 child.addChild(csg);
2712
- group(csg);
27132734 }
27142735 } else
27152736 if (source == doubleItem)
....@@ -2717,6 +2738,7 @@
27172738 if (!group.selection.isEmpty())
27182739 {
27192740 Composite csg = new GroupLeaf("Fork");
2741
+ group(csg);
27202742 csg.count = 5;
27212743 Composite child = new cGroup("Branch A");
27222744 csg.addChild(child);
....@@ -2724,7 +2746,6 @@
27242746 child = new cGroup("Branch B");
27252747 csg.addChild(child);
27262748 child.addChild(csg);
2727
- group(csg);
27282749 }
27292750 } else
27302751 if (source == tripleItem)
....@@ -2790,7 +2811,7 @@
27902811 {
27912812 Maximize();
27922813 } else
2793
- if (source == fullButton)
2814
+ if (source == fullScreenButton)
27942815 {
27952816 ToggleFullScreen();
27962817 } else
....@@ -2799,13 +2820,13 @@
27992820 this.expandedLayout = radio.layout;
28002821 CollapseToolbar();
28012822 } else
2802
- if (source == maximize3DButton)
2803
- {
2804
- this.expandedLayout = radio.layout;
2805
- radio.layout = twoButton;
2806
- Show3DView();
2807
- CollapseToolbar();
2808
- } else
2823
+// if (source == maximize3DButton)
2824
+// {
2825
+// this.expandedLayout = radio.layout;
2826
+// radio.layout = twoButton;
2827
+// CollapseToolbar();
2828
+// Show3DView();
2829
+// } else
28092830 if (source == previousVersionButton)
28102831 {
28112832 // Go to previous version
....@@ -2833,7 +2854,7 @@
28332854 if (source == saveVersionButton)
28342855 {
28352856 // Save a new version
2836
- if (!Save(true))
2857
+ if (!DuplicateVersion()) //true))
28372858 java.awt.Toolkit.getDefaultToolkit().beep();
28382859 } else
28392860 if (source == deleteVersionButton)
....@@ -3458,6 +3479,10 @@
34583479 {
34593480 ClearMaterials();
34603481 } else
3482
+ if (source == clearVersionsItem)
3483
+ {
3484
+ ClearVersions();
3485
+ } else
34613486 if (source == liveleavesItem)
34623487 {
34633488 LiveLeaves(true);
....@@ -3597,6 +3622,18 @@
35973622 if (source == transformChildrenItem)
35983623 {
35993624 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);
36003637 } else
36013638 if (source == resetTransformItem)
36023639 {
....@@ -3970,7 +4007,8 @@
39704007 if (source == closeButton)
39714008 {
39724009 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3973
- Replace();
4010
+ if (copy.versionlist != null)
4011
+ Replace();
39744012
39754013 cRadio ab;
39764014 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
....@@ -4070,7 +4108,8 @@
40704108 } else
40714109 if(source instanceof cRadio)
40724110 {
4073
- Replace();
4111
+ if (copy.versionlist != null)
4112
+ Replace();
40744113
40754114 group.parent = keepparent;
40764115 group.attributes = 0;
....@@ -4123,7 +4162,7 @@
41234162 */
41244163 radio.layout.doClick();
41254164
4126
- assert(copy instanceof Composite);
4165
+ //assert(copy instanceof Composite);
41274166
41284167 if (copy.versionlist == null)
41294168 {
....@@ -4134,12 +4173,15 @@
41344173 // and check if any of these nodes are reachable below the root.
41354174 Grafreed.grafreed.universe.TagObjects(copy, true);
41364175
4137
- if (!copy.HasTags())
4176
+ if (copy instanceof Composite && !copy.HasTags())
41384177 {
4139
- copy.versionlist = new Object3D[100];
4178
+ if (copy.versionlist == null)
4179
+ copy.versionlist = new Object3D[100];
41404180
4141
- Save(true);
4181
+ //Save(true);
41424182 }
4183
+ else
4184
+ copy.versionindex = -2;
41434185
41444186 Grafreed.grafreed.universe.TagObjects(copy, false);
41454187 }
....@@ -4259,9 +4301,46 @@
42594301 refreshContents();
42604302 }
42614303
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
+
42624316 void ResetTransform()
42634317 {
42644318 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();
42654344 }
42664345
42674346 void ResetTransform(int mask)
....@@ -4274,38 +4353,8 @@
42744353 if (obj.toParent == null)
42754354 continue;
42764355
4277
- if (mask == -1)
4278
- {
4279
- if (obj instanceof Camera) // jan 2014
4280
- {
4281
- LA.matIdentity(obj.toParent);
4282
- LA.matIdentity(obj.fromParent);
4283
- }
4284
- else
4285
- {
4286
- obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
4287
- obj.fromParent = null; // LA.matIdentity(obj.fromParent);
4288
- }
4289
- TouchTransform(obj);
4290
- continue;
4291
- }
4292
- if ((mask&2) != 0) // Scale/rotation
4293
- {
4294
- obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
4295
- obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
4296
- obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
4297
- obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
4298
- obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
4299
- obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4300
- }
4301
- if ((mask&1) != 0) // Translation
4302
- {
4303
- if (obj.toParent != null)
4304
- {
4305
- obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
4306
- obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
4307
- }
4308
- }
4356
+ obj.ResetTransform(mask);
4357
+
43094358 if (obj.parent == null)
43104359 {
43114360 System.out.println("NULL PARENT!");
....@@ -4814,10 +4863,17 @@
48144863 {
48154864 Object3D obj = group.selection.get(i);
48164865
4866
+ if (obj.toParent == null)
4867
+ {
4868
+ obj.toParent = LA.newMatrix();
4869
+ obj.fromParent = LA.newMatrix();
4870
+ }
4871
+
48174872 LA.matTranslate(obj.toParent, i * scale, 0, 0);
48184873 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
48194874 }
48204875
4876
+ Globals.lighttouched = true;
48214877 refreshContents();
48224878 }
48234879
....@@ -5105,6 +5161,12 @@
51055161 refreshContents();
51065162 }
51075163
5164
+ void ClearVersions()
5165
+ {
5166
+ group.selection.ClearVersions();
5167
+ refreshContents();
5168
+ }
5169
+
51085170 void FlipV(boolean flip)
51095171 {
51105172 group.selection.FlipV(flip);
....@@ -5343,10 +5405,10 @@
53435405 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
53445406 // a camera
53455407 {
5346
- 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
53475409 {
53485410 CameraPane.camerachangeframe = 0; // don't refuse it
5349
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5411
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true);
53505412 }
53515413 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
53525414 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
....@@ -5390,12 +5452,12 @@
53905452 }
53915453 }
53925454
5393
- rootButton.setEnabled(allComposites);
5455
+ rootButton.setEnabled(true); // allComposites);
53945456 }
53955457
53965458 void refreshContents(boolean cp)
53975459 {
5398
- if (Globals.ADVANCED)
5460
+ if (Globals.SHOWINFO)
53995461 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
54005462 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
54015463 {
....@@ -6346,6 +6408,7 @@
63466408 private MenuItem clipMeshItem;
63476409 private MenuItem smoothMeshItem;
63486410 private MenuItem clearMaterialsItem;
6411
+ private MenuItem clearVersionsItem;
63496412
63506413 private MenuItem liveleavesItem;
63516414 private MenuItem unliveleavesItem;
....@@ -6369,6 +6432,9 @@
63696432 private MenuItem maxTexturesItem;
63706433 private MenuItem panoTexturesItem;
63716434
6435
+ private MenuItem textureRatioRItem;
6436
+ private MenuItem textureRatioGItem;
6437
+ private MenuItem textureRatioBItem;
63726438 private MenuItem resetCentroidItem;
63736439 private MenuItem resetCentroidXZItem;
63746440 private MenuItem resetTransformItem;