Normand Briere
2019-09-20 cbe4e90105d07d7d3fecabffaa01342403aa2ae3
GroupEditor.java
....@@ -483,11 +483,16 @@
483483
484484 Object3D parent = obj.parent;
485485 obj.parent = null;
486
+
486487 // Object3D support = obj.support;
487488 // obj.support = null;
488489 if (!supports)
489490 obj.SaveSupports();
491
+
490492 Object3D clone = (Object3D)Grafreed.clone(obj);
493
+
494
+ clone.ResetUUIDs();
495
+
491496 obj.parent = parent;
492497 // obj.support = support;
493498 // clone.support = support; // aout 2013
....@@ -557,8 +562,10 @@
557562 pasteLinkItem.addActionListener(this);
558563 pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
559564 pasteCloneItem.addActionListener(this);
560
-// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
561
-// pasteExpandItem.addActionListener(this);
565
+// CRASH
566
+ pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
567
+//
568
+ pasteExpandItem.addActionListener(this);
562569 //menu.add("-");
563570 oe.jTree.popup.addSeparator();
564571
....@@ -796,7 +803,7 @@
796803 genNormalsCADItem.addActionListener(this);
797804 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
798805 genNormalsMESHItem.addActionListener(this);
799
- if (Globals.ADVANCED)
806
+ //if (Globals.ADVANCED)
800807 {
801808 genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
802809 genNormalsMINEItem.addActionListener(this);
....@@ -959,7 +966,7 @@
959966 currenttab.setName(tabname);
960967 //added = false;
961968 resourcecontainer.add(currenttab);
962
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
969
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname);
963970 rowcount = 1;
964971 colcount = 0;
965972 texturecount = 0;
....@@ -974,6 +981,11 @@
974981 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
975982 }
976983
984
+ columns = 5;
985
+
986
+ if (path[0].contains("D&R") || path[0].contains("Paint"))
987
+ columns = 4;
988
+
977989 AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
978990 totalcount++;
979991
....@@ -1188,6 +1200,7 @@
11881200 //clearButton.addActionListener(this);
11891201
11901202 cGridBag row1 = new cGridBag();
1203
+ row1.preferredHeight = 8;
11911204
11921205 // INSERT
11931206 row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1228,6 +1241,7 @@
12281241 oe.toolboxPanel.add(row1);
12291242
12301243 cGridBag row2 = new cGridBag();
1244
+ row2.preferredHeight = 8;
12311245
12321246 row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12331247 groupButton.setToolTipText("Create group");
....@@ -1330,6 +1344,7 @@
13301344
13311345 oe.treePanel.add(versionManagerPanel);
13321346 oe.treePanel.Return();
1347
+
13331348 versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
13341349 versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
13351350 versionSliderPane.preferredHeight = 3;
....@@ -1389,7 +1404,7 @@
13891404 // supportCB.setToolTipText("Enable rigging");
13901405 // supportCB.addItemListener(this);
13911406
1392
- panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1407
+ panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints);
13931408 freezeCB.setToolTipText("Fast moving camera");
13941409 freezeCB.addItemListener(this);
13951410
....@@ -1398,9 +1413,12 @@
13981413
13991414 panel.Return();
14001415
1416
+ if (Globals.ADVANCED)
1417
+ {
14011418 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
14021419 crowdCB.setToolTipText("Used for crowds");
14031420 crowdCB.addItemListener(this);
1421
+ }
14041422
14051423 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
14061424 smoothCB.setToolTipText("Snapping delay");
....@@ -1413,30 +1431,26 @@
14131431 minshaderCB.setToolTipText("Minimal fast shader");
14141432 minshaderCB.addItemListener(this);
14151433
1416
-// constraints.gridy += 1;
14171434 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
14181435 // speakerMocapCB.addItemListener(this);
14191436
1420
- panel.Return();
1421
-
14221437 if (false)
14231438 {
14241439 // handled in scripts
1425
- //constraints.gridy += 1;
14261440 panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
14271441 speakerCameraCB.addItemListener(this);
14281442
1429
- //constraints.gridy += 1;
14301443 panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
14311444 speakerFocusCB.addItemListener(this);
14321445
1433
- //constraints.gridy += 1;
1434
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1435
- smoothfocusCB.addItemListener(this);
14361446 panel.Return();
14371447 }
14381448
1439
-//constraints.gridx += 1;
1449
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1450
+ smoothfocusCB.addItemListener(this);
1451
+
1452
+ panel.Return();
1453
+
14401454 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
14411455 // debugCB.addItemListener(this);
14421456
....@@ -2075,7 +2089,7 @@
20752089 Object3D obj = (Object3D)group.selection.elementAt(0);
20762090 objEditor.ScreenFit(obj, false);
20772091
2078
- cameraView.pingthread.StepToTarget(true);
2092
+ cameraView.pingthread.StepToTarget(); //true);
20792093 refreshContents();
20802094 }
20812095
....@@ -2112,7 +2126,7 @@
21122126 obj.parent.TransformToWorld(maxima); //, maxima);
21132127 }
21142128
2115
- Object3D shadow = new Object3D("Shadow " + obj.name);
2129
+ Object3D shadow = new Object3D("Shadow" + obj.name);
21162130
21172131 shadow.toParent = LA.newMatrix();
21182132 shadow.fromParent = LA.newMatrix();
....@@ -2840,7 +2854,7 @@
28402854 if (source == saveVersionButton)
28412855 {
28422856 // Save a new version
2843
- if (!Save(true))
2857
+ if (!DuplicateVersion()) //true))
28442858 java.awt.Toolkit.getDefaultToolkit().beep();
28452859 } else
28462860 if (source == deleteVersionButton)
....@@ -4304,6 +4318,31 @@
43044318 ResetTransform(-1);
43054319 }
43064320
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();
4344
+ }
4345
+
43074346 void ResetTransform(int mask)
43084347 {
43094348 Object3D obj;
....@@ -4834,6 +4873,7 @@
48344873 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
48354874 }
48364875
4876
+ Globals.lighttouched = true;
48374877 refreshContents();
48384878 }
48394879
....@@ -5368,7 +5408,7 @@
53685408 if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace
53695409 {
53705410 CameraPane.camerachangeframe = 0; // don't refuse it
5371
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5411
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true);
53725412 }
53735413 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
53745414 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;