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 {
....@@ -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
....@@ -766,10 +763,10 @@
766763 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
767764 shadowZItem.addActionListener(this);
768765
769
- if (Globals.ADVANCED)
770
- {
771766 attributeItem = menu.add(new MenuItem("Attribute"));
772767 attributeItem.addActionListener(this);
768
+ if (Globals.ADVANCED)
769
+ {
773770 menu.add("-");
774771 linkerItem = menu.add(new MenuItem("Linker"));
775772 linkerItem.addActionListener(this);
....@@ -806,7 +803,7 @@
806803 genNormalsCADItem.addActionListener(this);
807804 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
808805 genNormalsMESHItem.addActionListener(this);
809
- if (Globals.ADVANCED)
806
+ //if (Globals.ADVANCED)
810807 {
811808 genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
812809 genNormalsMINEItem.addActionListener(this);
....@@ -969,7 +966,7 @@
969966 currenttab.setName(tabname);
970967 //added = false;
971968 resourcecontainer.add(currenttab);
972
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
969
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname);
973970 rowcount = 1;
974971 colcount = 0;
975972 texturecount = 0;
....@@ -984,6 +981,11 @@
984981 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
985982 }
986983
984
+ columns = 5;
985
+
986
+ if (path[0].contains("D&R") || path[0].contains("Paint"))
987
+ columns = 4;
988
+
987989 AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
988990 totalcount++;
989991
....@@ -1081,13 +1083,17 @@
10811083 // }
10821084 // });
10831085
1086
+ oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1087
+ fullScreenButton.setToolTipText("Full-screen window");
1088
+ fullScreenButton.addActionListener(this);
1089
+
10841090 oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10851091 collapseButton.setToolTipText("Collapse toolbar");
10861092 collapseButton.addActionListener(this);
10871093
1088
- oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1089
- maximize3DButton.setToolTipText("Maximize 3D view");
1090
- 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);
10911097
10921098 oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10931099 twoButton.setToolTipText("Show 3D view only");
....@@ -1107,10 +1113,6 @@
11071113 // sevenButton.setToolTipText("3-column layout");
11081114 // sevenButton.addActionListener(this);
11091115 //
1110
-
1111
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1112
- fullButton.setToolTipText("Full-screen window");
1113
- fullButton.addActionListener(this);
11141116
11151117 oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11161118 screenfitButton.setToolTipText("Screen fit");
....@@ -1198,6 +1200,7 @@
11981200 //clearButton.addActionListener(this);
11991201
12001202 cGridBag row1 = new cGridBag();
1203
+ row1.preferredHeight = 8;
12011204
12021205 // INSERT
12031206 row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1238,6 +1241,7 @@
12381241 oe.toolboxPanel.add(row1);
12391242
12401243 cGridBag row2 = new cGridBag();
1244
+ row2.preferredHeight = 8;
12411245
12421246 row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12431247 groupButton.setToolTipText("Create group");
....@@ -1340,6 +1344,7 @@
13401344
13411345 oe.treePanel.add(versionManagerPanel);
13421346 oe.treePanel.Return();
1347
+
13431348 versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
13441349 versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
13451350 versionSliderPane.preferredHeight = 3;
....@@ -1399,7 +1404,7 @@
13991404 // supportCB.setToolTipText("Enable rigging");
14001405 // supportCB.addItemListener(this);
14011406
1402
- panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1407
+ panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints);
14031408 freezeCB.setToolTipText("Fast moving camera");
14041409 freezeCB.addItemListener(this);
14051410
....@@ -1408,9 +1413,12 @@
14081413
14091414 panel.Return();
14101415
1416
+ if (Globals.ADVANCED)
1417
+ {
14111418 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
14121419 crowdCB.setToolTipText("Used for crowds");
14131420 crowdCB.addItemListener(this);
1421
+ }
14141422
14151423 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
14161424 smoothCB.setToolTipText("Snapping delay");
....@@ -1423,30 +1431,26 @@
14231431 minshaderCB.setToolTipText("Minimal fast shader");
14241432 minshaderCB.addItemListener(this);
14251433
1426
-// constraints.gridy += 1;
14271434 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
14281435 // speakerMocapCB.addItemListener(this);
14291436
1430
- panel.Return();
1431
-
14321437 if (false)
14331438 {
14341439 // handled in scripts
1435
- //constraints.gridy += 1;
14361440 panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
14371441 speakerCameraCB.addItemListener(this);
14381442
1439
- //constraints.gridy += 1;
14401443 panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
14411444 speakerFocusCB.addItemListener(this);
14421445
1443
- //constraints.gridy += 1;
1444
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1445
- smoothfocusCB.addItemListener(this);
14461446 panel.Return();
14471447 }
14481448
1449
-//constraints.gridx += 1;
1449
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1450
+ smoothfocusCB.addItemListener(this);
1451
+
1452
+ panel.Return();
1453
+
14501454 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
14511455 // debugCB.addItemListener(this);
14521456
....@@ -2085,7 +2089,7 @@
20852089 Object3D obj = (Object3D)group.selection.elementAt(0);
20862090 objEditor.ScreenFit(obj, false);
20872091
2088
- cameraView.pingthread.StepToTarget(true);
2092
+ cameraView.pingthread.StepToTarget(); //true);
20892093 refreshContents();
20902094 }
20912095
....@@ -2122,7 +2126,7 @@
21222126 obj.parent.TransformToWorld(maxima); //, maxima);
21232127 }
21242128
2125
- Object3D shadow = new Object3D("Shadow " + obj.name);
2129
+ Object3D shadow = new Object3D("Shadow" + obj.name);
21262130
21272131 shadow.toParent = LA.newMatrix();
21282132 shadow.fromParent = LA.newMatrix();
....@@ -2722,11 +2726,11 @@
27222726 if (!group.selection.isEmpty())
27232727 {
27242728 Composite csg = new GroupLeaf();
2729
+ group(csg);
27252730 csg.count = 5;
27262731 Composite child = new cGroup("Branch");
27272732 csg.addChild(child);
27282733 child.addChild(csg);
2729
- group(csg);
27302734 }
27312735 } else
27322736 if (source == doubleItem)
....@@ -2734,6 +2738,7 @@
27342738 if (!group.selection.isEmpty())
27352739 {
27362740 Composite csg = new GroupLeaf("Fork");
2741
+ group(csg);
27372742 csg.count = 5;
27382743 Composite child = new cGroup("Branch A");
27392744 csg.addChild(child);
....@@ -2741,7 +2746,6 @@
27412746 child = new cGroup("Branch B");
27422747 csg.addChild(child);
27432748 child.addChild(csg);
2744
- group(csg);
27452749 }
27462750 } else
27472751 if (source == tripleItem)
....@@ -2807,7 +2811,7 @@
28072811 {
28082812 Maximize();
28092813 } else
2810
- if (source == fullButton)
2814
+ if (source == fullScreenButton)
28112815 {
28122816 ToggleFullScreen();
28132817 } else
....@@ -2816,13 +2820,13 @@
28162820 this.expandedLayout = radio.layout;
28172821 CollapseToolbar();
28182822 } else
2819
- if (source == maximize3DButton)
2820
- {
2821
- this.expandedLayout = radio.layout;
2822
- radio.layout = twoButton;
2823
- Show3DView();
2824
- CollapseToolbar();
2825
- } else
2823
+// if (source == maximize3DButton)
2824
+// {
2825
+// this.expandedLayout = radio.layout;
2826
+// radio.layout = twoButton;
2827
+// CollapseToolbar();
2828
+// Show3DView();
2829
+// } else
28262830 if (source == previousVersionButton)
28272831 {
28282832 // Go to previous version
....@@ -2850,7 +2854,7 @@
28502854 if (source == saveVersionButton)
28512855 {
28522856 // Save a new version
2853
- if (!Save(true))
2857
+ if (!DuplicateVersion()) //true))
28542858 java.awt.Toolkit.getDefaultToolkit().beep();
28552859 } else
28562860 if (source == deleteVersionButton)
....@@ -4169,9 +4173,10 @@
41694173 // and check if any of these nodes are reachable below the root.
41704174 Grafreed.grafreed.universe.TagObjects(copy, true);
41714175
4172
- if (copy instanceof Composite && copy.versionlist == null && !copy.HasTags())
4176
+ if (copy instanceof Composite && !copy.HasTags())
41734177 {
4174
- copy.versionlist = new Object3D[100];
4178
+ if (copy.versionlist == null)
4179
+ copy.versionlist = new Object3D[100];
41754180
41764181 //Save(true);
41774182 }
....@@ -4311,6 +4316,31 @@
43114316 void ResetTransform()
43124317 {
43134318 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();
43144344 }
43154345
43164346 void ResetTransform(int mask)
....@@ -4843,6 +4873,7 @@
48434873 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
48444874 }
48454875
4876
+ Globals.lighttouched = true;
48464877 refreshContents();
48474878 }
48484879
....@@ -5377,7 +5408,7 @@
53775408 if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace
53785409 {
53795410 CameraPane.camerachangeframe = 0; // don't refuse it
5380
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5411
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true);
53815412 }
53825413 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
53835414 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;