Normand Briere
2019-07-25 f2b6a33fdf84a06b958f9cb9d667a2eff3063d8b
GroupEditor.java
....@@ -80,18 +80,20 @@
8080 this.copy = this.group = copy;
8181 //selectees = this.group.selectees;
8282
83
- if (copy.versions == null)
84
- {
85
- copy.versions = new byte[100][];
86
- copy.versionindex = -1;
87
- }
88
-
8983 SetupMenu2(this); //objEditor);
9084 SetupUI2(objEditor);
9185 objEditor.SetupUI(true);
9286 SetupViews(objEditor);
9387
9488 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
9597 }
9698
9799 void CloneSelection(boolean supports)
....@@ -206,8 +208,8 @@
206208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
207209 // pasteExpandItem.addActionListener(this);
208210 menu.add("-");
209
- clearItem = menu.add(new MenuItem("Clear"));
210
- clearItem.addActionListener(this);
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
211213
212214 if (Globals.ADVANCED)
213215 {
....@@ -433,7 +435,7 @@
433435 genNormalsMESHItem.addActionListener(this);
434436 if (Globals.ADVANCED)
435437 {
436
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437439 genNormalsMINEItem.addActionListener(this);
438440 }
439441 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -526,10 +528,15 @@
526528 attachBumpItem.addActionListener(this);
527529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
528530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
529532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
530533 detachPigmentItem.addActionListener(this);
531534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
532535 detachBumpItem.addActionListener(this);
536
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
537
+ embedTexturesItem.addActionListener(this);
538
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
539
+ deEmbedTexturesItem.addActionListener(this);
533540 menu.add("-");
534541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
535542 sortbysizeItem.addActionListener(this);
....@@ -685,27 +692,28 @@
685692
686693 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
687694
688
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
- twoButton.setToolTipText("Show center view only");
690
- twoButton.addActionListener(this);
691
- this.fullscreenLayout = twoButton;
692
-
693695 oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694696 fourButton.addActionListener(this);
695697 fourButton.setToolTipText("Show left panel only");
698
+
699
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ twoButton.setToolTipText("Show right view only");
701
+ twoButton.addActionListener(this);
702
+ this.fullscreenLayout = twoButton;
703
+
696704 oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
- sixButton.setToolTipText("2-column layout left");
705
+ sixButton.setToolTipText("Show left and right");
698706 sixButton.addActionListener(this);
699
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
- threeButton.setToolTipText("2-column layout right");
701
- threeButton.addActionListener(this);
702
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
- sevenButton.setToolTipText("3-column layout");
704
- sevenButton.addActionListener(this);
707
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+// threeButton.setToolTipText("2-column layout right");
709
+// threeButton.addActionListener(this);
710
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+// sevenButton.setToolTipText("3-column layout");
712
+// sevenButton.addActionListener(this);
705713 //
706714
707
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
- rootButton.setToolTipText("Edit selection in new tab");
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
709717 rootButton.addActionListener(this);
710718
711719 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -871,7 +879,7 @@
871879 dgr.addDragGestureListener(this);
872880 }catch(Exception e) {}
873881 */
874
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
875883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
876884 }
877885
....@@ -1013,7 +1021,7 @@
10131021 }
10141022
10151023 radioButton.SetObject(obj);
1016
- radioButton.layout = sevenButton;
1024
+ radioButton.layout = sixButton; // sevenButton;
10171025 radioButton.SetCamera(cameraView.renderCamera, false);
10181026 radioButton.addActionListener(this);
10191027 radioPanel.add(radioButton);
....@@ -1692,6 +1700,16 @@
16921700 listUI.remove(i);
16931701 }
16941702 }
1703
+ }
1704
+
1705
+ private void EditElement(Object3D elem, boolean newWindow)
1706
+ {
1707
+ // if (!(elem instanceof Composite))
1708
+ // newWindow = false;
1709
+ listUI.add(elem);
1710
+ elem.openEditWindow(this, newWindow); //, false);
1711
+ System.out.println("edit : " + elem);
1712
+ elem.editWindow.refreshContents(true); // ? new
16951713 }
16961714
16971715 /**
....@@ -2658,7 +2676,7 @@
26582676 {
26592677 StepAll();
26602678 } else
2661
- if (source == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
26622680 {
26632681 //int indices[] = jList.getSelectedIndices();
26642682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3140,7 +3158,7 @@
31403158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
31413159 {
31423160 obj = (Object3D)e.nextElement();
3143
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
31443162 }
31453163
31463164 refreshContents();
....@@ -3154,6 +3172,31 @@
31543172 obj.SetBumpTexture(obj.GetPigmentTexture());
31553173 }
31563174
3175
+ refreshContents();
3176
+ } else
3177
+ if (source == embedTexturesItem)
3178
+ {
3179
+ Object3D obj;
3180
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3181
+ {
3182
+ obj = (Object3D)e.nextElement();
3183
+ obj.EmbedTextures(true);
3184
+ }
3185
+
3186
+ refreshContents();
3187
+ } else
3188
+ if (source == deEmbedTexturesItem)
3189
+ {
3190
+ Object3D obj;
3191
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3192
+ {
3193
+ obj = (Object3D)e.nextElement();
3194
+ obj.EmbedTextures(false);
3195
+ }
3196
+
3197
+ CameraPane.texturepigment.clear();
3198
+ CameraPane.texturebump.clear();
3199
+
31573200 refreshContents();
31583201 } else
31593202 if (source == flashSelectionButton)
....@@ -3553,10 +3596,10 @@
35533596 radio.layout.doClick();
35543597
35553598 ClearUnpinned();
3556
- Grafreed.Assert(group != null);
3557
- Grafreed.Assert(group.selection != null);
3558
- SetPinStates(group.selection.size() > 0);
3559
- if (group.selection.size() == 1)
3599
+ //Grafreed.Assert(group != null);
3600
+ //Grafreed.Assert(group.selection != null);
3601
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3602
+ if (group.selection == null || group.selection.size() == 1)
35603603 EditSelection(false);
35613604 keepparent = group.parent;
35623605 // PARENT = NULL or not???
....@@ -4150,7 +4193,7 @@
41504193
41514194 try
41524195 {
4153
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4196
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
41544197 }
41554198 catch (Exception e)
41564199 {
....@@ -4627,6 +4670,12 @@
46274670
46284671 void EditSelection(boolean newWindow)
46294672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
46304679 // aConstraints.gridy = 0;
46314680 for (int i=0; i<group.selection.size(); i++)
46324681 {
....@@ -4637,12 +4686,7 @@
46374686 Object3D elem = (Object3D)group.selection.elementAt(i);
46384687 if(elem != group || !newWindow)
46394688 {
4640
- // if (!(elem instanceof Composite))
4641
- // newWindow = false;
4642
- listUI.add(elem);
4643
- elem.openEditWindow(this, newWindow); //, false);
4644
- System.out.println("edit : " + elem);
4645
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
46464690 }
46474691 }
46484692 }
....@@ -4786,7 +4830,7 @@
47864830
47874831 void refreshContents(boolean cp)
47884832 {
4789
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4833
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
47904834 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
47914835 {
47924836 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5695,7 +5739,7 @@
56955739 private MenuItem pasteLinkItem;
56965740 private MenuItem pasteCloneItem;
56975741 private MenuItem pasteExpandItem;
5698
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
56995743 private MenuItem clearAllItem;
57005744 private MenuItem genUVItem;
57015745 private MenuItem genNormalsMESHItem;
....@@ -5779,6 +5823,8 @@
57795823 private MenuItem attachBumpItem;
57805824 private MenuItem detachBumpItem;
57815825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
57825828
57835829 private MenuItem particleItem;
57845830 private MenuItem ragdollItem;