CameraPane.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history | |
ScriptNode.java | ●●●●● patch | view | raw | blame | history | |
cFileSystemModel.java | ●●●●● patch | view | raw | blame | history | |
cTools.java | ●●●●● patch | view | raw | blame | history |
CameraPane.java
.. .. @@ -2065,7 +2065,7 @@ 2065 2065 //System.err.println("Oeil on"); 2066 2066 OEIL = true; 2067 2067 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) 2068 - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);2068 + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);2069 2069 //pingthread.StepToTarget(true); 2070 2070 } 2071 2071 .. .. @@ -11527,7 +11527,7 @@ 11527 11527 if ((TRACK || SHADOWTRACK) || zoomonce) 11528 11528 { 11529 11529 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) 11530 - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);11530 + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);11531 11531 pingthread.StepToTarget(true); // true); 11532 11532 // zoomonce = false; 11533 11533 } .. .. @@ -13943,7 +13943,7 @@ 13943 13943 13944 13944 // fev 2014??? 13945 13945 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) 13946 - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);13946 + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);13947 13947 pingthread.StepToTarget(true); // true); 13948 13948 } 13949 13949 // if (!LIVE) .. .. @@ -15190,17 +15190,17 @@ 15190 15190 case '=': 15191 15191 IncDepth(); 15192 15192 //fontsize += 1; 15193 - object.editWindow.refreshContents(true);15193 + object.GetWindow().refreshContents(true);15194 15194 maskbit = 6; 15195 15195 break; 15196 15196 case '-': //if (PixelThreshold>1) PixelThreshold /= 2; 15197 15197 DecDepth(); 15198 15198 maskbit = 5; 15199 15199 //if(fontsize > 1) fontsize -= 1; 15200 - if (object.editWindow == null)15201 - new Exception().printStackTrace();15202 - else15203 - object.editWindow.refreshContents(true);15200 +// if (object.editWindow == null)15201 +// new Exception().printStackTrace();15202 +// else15203 + object.GetWindow().refreshContents(true);15204 15204 break; 15205 15205 case '{': 15206 15206 manipCamera.shaper_fovy /= 1.1; .. .. @@ -15424,7 +15424,7 @@ 15424 15424 } 15425 15425 */ 15426 15426 15427 - object.editWindow.EditSelection(false);15427 + object.GetWindow().EditSelection(false);15428 15428 } 15429 15429 15430 15430 void SelectParent() .. .. @@ -15441,10 +15441,10 @@ 15441 15441 { 15442 15442 //selectees.remove(i); 15443 15443 System.out.println("select parent of " + elem); 15444 - group.editWindow.Select(elem.parent.GetTreePath(), first, true);15444 + group.GetWindow().Select(elem.parent.GetTreePath(), first, true);15445 15445 } else 15446 15446 { 15447 - group.editWindow.Select(elem.GetTreePath(), first, true);15447 + group.GetWindow().Select(elem.GetTreePath(), first, true);15448 15448 } 15449 15449 15450 15450 first = false; .. .. @@ -15486,12 +15486,12 @@ 15486 15486 for (int j = 0; j < group.children.size(); j++) 15487 15487 { 15488 15488 elem = (Object3D) group.children.elementAt(j); 15489 - object.editWindow.Select(elem.GetTreePath(), first, true);15489 + object.GetWindow().Select(elem.GetTreePath(), first, true);15490 15490 first = false; 15491 15491 } 15492 15492 } else 15493 15493 { 15494 - object.editWindow.Select(elem.GetTreePath(), first, true);15494 + object.GetWindow().Select(elem.GetTreePath(), first, true);15495 15495 } 15496 15496 15497 15497 first = false; .. .. @@ -15502,21 +15502,21 @@ 15502 15502 { 15503 15503 //Composite group = (Composite) object; 15504 15504 Object3D group = object; 15505 - group.editWindow.loadClipboard(true); // ClearSelection(false);15505 + group.GetWindow().loadClipboard(true); // ClearSelection(false);15506 15506 } 15507 15507 15508 15508 void ResetTransform(int mask) 15509 15509 { 15510 15510 //Composite group = (Composite) object; 15511 15511 Object3D group = object; 15512 - group.editWindow.ResetTransform(mask);15512 + group.GetWindow().ResetTransform(mask);15513 15513 } 15514 15514 15515 15515 void FlipTransform() 15516 15516 { 15517 15517 //Composite group = (Composite) object; 15518 15518 Object3D group = object; 15519 - group.editWindow.FlipTransform();15519 + group.GetWindow().FlipTransform();15520 15520 // group.editWindow.ReduceMesh(true); 15521 15521 } 15522 15522 .. .. @@ -15524,7 +15524,7 @@ 15524 15524 { 15525 15525 //Composite group = (Composite) object; 15526 15526 Object3D group = object; 15527 - group.editWindow.PrintMemory();15527 + group.GetWindow().PrintMemory();15528 15528 // group.editWindow.ReduceMesh(true); 15529 15529 } 15530 15530 .. .. @@ -15532,7 +15532,7 @@ 15532 15532 { 15533 15533 //Composite group = (Composite) object; 15534 15534 Object3D group = object; 15535 - group.editWindow.ResetCentroid();15535 + group.GetWindow().ResetCentroid();15536 15536 } 15537 15537 15538 15538 void IncDepth() .. .. @@ -16724,7 +16724,7 @@ 16724 16724 } 16725 16725 16726 16726 if (!movingcamera && !PAINTMODE) 16727 - object.editWindow.ScreenFitPoint(); // fev 201416727 + object.GetWindow().ScreenFitPoint(); // fev 201416728 16728 16729 16729 if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) 16730 16730 { .. .. @@ -16736,17 +16736,17 @@ 16736 16736 16737 16737 group.add(paintobj); // link 16738 16738 16739 - object.editWindow.SnapObject(group);16739 + object.GetWindow().SnapObject(group);16740 16740 16741 - Object3D folder = object.editWindow.copy;16741 + Object3D folder = object.GetWindow().copy;16742 16742 16743 - if (object.editWindow.copy.selection.Size() > 0)16744 - folder = object.editWindow.copy.selection.elementAt(0);16743 + if (object.GetWindow().copy.selection.Size() > 0)16744 + folder = object.GetWindow().copy.selection.elementAt(0);16745 16745 16746 16746 folder.add(group); 16747 16747 16748 - object.editWindow.ResetModel();16749 - object.editWindow.refreshContents();16748 + object.GetWindow().ResetModel();16749 + object.GetWindow().refreshContents();16750 16750 } 16751 16751 else 16752 16752 paintcount = 0; GroupEditor.java
.. .. @@ -1472,8 +1472,8 @@ 1472 1472 animationItem.addItemListener(this); 1473 1473 animationItem.setState(Globals.ANIMATION); 1474 1474 1475 - menu.add(archiveItem = new CheckboxMenuItem("Archive3D..."));1476 - archiveItem.addItemListener(this);1475 + menu.add(archiveItem = new MenuItem("Archive3D..."));1476 + archiveItem.addActionListener(this);1477 1477 1478 1478 menu.add("-"); 1479 1479 parseverticesItem = menu.add(new MenuItem("Multiplicity")); .. .. @@ -4734,7 +4734,7 @@ 4734 4734 void refreshContents(boolean cp) 4735 4735 { 4736 4736 if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) 4737 - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)4737 + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)4738 4738 { 4739 4739 objEditor.ClearInfo(); // .GetMaterial()); 4740 4740 ObjEditor.java
.. .. @@ -449,7 +449,7 @@ 449 449 // TEXTAREA infoarea.setLineWrap(true); 450 450 // TEXTAREA infoarea.setWrapStyleWord(true); 451 451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); 452 - //infoPanel.setPreferredSize(new Dimension(50, 200));452 + infoPanel.setPreferredSize(new Dimension(1, 1));453 453 infoPanel.setName("Info"); 454 454 //infoPanel.setLayout(new BorderLayout()); 455 455 //infoPanel.add(createTextPane()); .. .. @@ -1494,7 +1494,7 @@ 1494 1494 // objectPanel.add(north); 1495 1495 objectPanel.add(editPanel); 1496 1496 1497 - if (Globals.ADVANCED)1497 + //if (Globals.ADVANCED)1498 1498 objectPanel.add(infoPanel); 1499 1499 1500 1500 objectPanel.add(toolboxPanel); .. .. @@ -3201,10 +3201,6 @@ 3201 3201 { 3202 3202 ToggleAnimation(); 3203 3203 return; 3204 - } else if (event.getSource() == archiveItem)3205 - {3206 - cTools.Archive(frame);3207 - return;3208 3204 } else if (event.getSource() == flipVCB) 3209 3205 { 3210 3206 copy.flipV ^= true; .. .. @@ -3425,6 +3421,10 @@ 3425 3421 { 3426 3422 generatePOV(); 3427 3423 //return true; 3424 + } else if (event.getSource() == archiveItem)3425 + {3426 + cTools.Archive(frame);3427 + return;3428 3428 } else if (source == zBufferItem) 3429 3429 { 3430 3430 try .. .. @@ -5035,7 +5035,7 @@ 5035 5035 CheckboxMenuItem toggleSwitchItem; 5036 5036 CheckboxMenuItem toggleRootItem; 5037 5037 CheckboxMenuItem animationItem; 5038 - CheckboxMenuItem archiveItem;5038 + MenuItem archiveItem;5039 5039 CheckboxMenuItem toggleHandleItem; 5040 5040 CheckboxMenuItem togglePaintItem; 5041 5041 JSplitPane mainPanel; ScriptNode.java
.. .. @@ -388,7 +388,7 @@ 388 388 { 389 389 System.err.println("LoadBVHFile = " + obj + "; name = " + iname + "; first frame = " + firstframe + "; last frame = " + lastframe); 390 390 obj.blockloop = false; // to force crash right now 391 - GetRoot().editWindow.LoadBVHFile(iname, obj, false, force?firstframe:-1, lastframe);391 + GetRoot().GetWindow().LoadBVHFile(iname, obj, false, force?firstframe:-1, lastframe);392 392 } 393 393 else 394 394 { .. .. @@ -522,7 +522,7 @@ 522 522 if (command.equals("recompile")) 523 523 { 524 524 // TODO assert (GetRoot() == Globals.theRenderer.object); 525 - GetRoot().editWindow.Recompile();525 + GetRoot().GetWindow().Recompile();526 526 return; 527 527 } 528 528 if (command.equals("resetframecount")) .. .. @@ -533,7 +533,7 @@ 533 533 if (command.equals("deselect") || command.equals("unselect")) 534 534 { 535 535 // TODO assert (GetRoot() == Globals.theRenderer.object); 536 - GetRoot().editWindow.jTree.clearSelection();536 + GetRoot().GetWindow().jTree.clearSelection();537 537 return; 538 538 } 539 539 if (command.equals("stoplive") || command.equals("liveoff")) .. .. @@ -771,7 +771,7 @@ 771 771 if (!CameraPane.BOXMODE) 772 772 { 773 773 Globals.theRenderer.ToggleBoxMode(); 774 - GetRoot().editWindow.Recompile();774 + GetRoot().GetWindow().Recompile();775 775 } 776 776 return; 777 777 } .. .. @@ -780,7 +780,7 @@ 780 780 if (CameraPane.BOXMODE) 781 781 { 782 782 Globals.theRenderer.ToggleBoxMode(); 783 - GetRoot().editWindow.Recompile();783 + GetRoot().GetWindow().Recompile();784 784 } 785 785 return; 786 786 } .. .. @@ -1172,7 +1172,7 @@ 1172 1172 Object3D root = GetObject(rootobject); 1173 1173 1174 1174 System.err.println("ZOOM: root = " + root + "; rootobject = " + rootobject); 1175 - GetRoot().editWindow.objEditor.ScreenFit(root, false);1175 + GetRoot().GetWindow().objEditor.ScreenFit(root, false);1176 1176 CameraPane.trackedobject = root; 1177 1177 CameraPane.ABORTED = true; 1178 1178 System.err.println("SET ABORTED (SPEAKERFOCUS) "); .. .. @@ -1464,7 +1464,7 @@ 1464 1464 { 1465 1465 // TODO assert (GetRoot() == Globals.theRenderer.object); 1466 1466 String path = GetAlias(strs[index+1]); 1467 - GetRoot().editWindow.Select(GetRoot().GetTreePath(path.split("/"), 0), false, false);1467 + GetRoot().GetWindow().Select(GetRoot().GetTreePath(path.split("/"), 0), false, false);1468 1468 return; 1469 1469 } 1470 1470 if (command.equals("mocap")) cFileSystemModel.java
.. .. @@ -113,35 +113,74 @@ 113 113 114 114 if (valueString.toLowerCase().endsWith(".gfd") || valueString.toLowerCase().endsWith(".obj") || valueString.toLowerCase().endsWith(".3ds")) 115 115 { 116 - String valueTruncated = valueString.substring(0, valueString.length()-4);117 -118 - System.out.println(valueTruncated);119 -120 - javax.swing.ImageIcon rendererIcon = icons.get(valueTruncated);121 -122 - if (rendererIcon == null)116 + if (true)123 117 { 124 - if (new File(valueTruncated + ".jpg").exists())125 - {126 - rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".jpg");127 - }128 - else129 - {130 - if (new File(valueTruncated + ".png").exists())131 - {132 - rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".png");133 - }134 - }135 -118 + // Small icons119 + String valueTruncated = valueString.substring(0, valueString.length()-4);120 +121 + System.out.println(valueTruncated);122 +123 + javax.swing.ImageIcon rendererIcon = icons.get(valueTruncated);124 +136 125 if (rendererIcon == null) 137 126 { 138 - rendererIcon = new javax.swing.ImageIcon();127 + if (new File(valueTruncated + ".jpg").exists())128 + {129 + rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".jpg");130 + }131 + else132 + {133 + if (new File(valueTruncated + ".png").exists())134 + {135 + rendererIcon = new javax.swing.ImageIcon(valueTruncated + ".png");136 + }137 + }138 +139 + if (rendererIcon == null)140 + {141 + rendererIcon = new javax.swing.ImageIcon();142 + }143 +144 + icons.put(valueTruncated, rendererIcon);145 + }146 +147 + setIcon(rendererIcon);148 + }149 + else150 + {151 + // Large icons152 + String[] split = valueString.split("/");153 +154 + String valueTruncated = "";155 +156 + for (int i=1; i<split.length-1; i++)157 + {158 + valueTruncated += "/" + split[i];139 159 } 140 160 141 - icons.put(valueTruncated, rendererIcon);161 + valueTruncated += "/icon.jpg";162 +163 + System.out.println(valueTruncated);164 +165 + javax.swing.ImageIcon rendererIcon = icons.get(valueTruncated);166 +167 + if (rendererIcon == null)168 + {169 + if (new File(valueTruncated).exists())170 + {171 + rendererIcon = new javax.swing.ImageIcon(valueTruncated);172 + }173 +174 + if (rendererIcon == null)175 + {176 + rendererIcon = new javax.swing.ImageIcon();177 + }178 +179 + icons.put(valueTruncated, rendererIcon);180 + }181 +182 + setIcon(rendererIcon);142 183 } 143 -144 - setIcon(rendererIcon);145 184 } 146 185 else 147 186 { cTools.java
.. .. @@ -1,6 +1,7 @@ 1 1 2 2 import java.io.*; 3 3 import java.awt.*; 4 +import java.net.URL;4 5 import java.util.zip.ZipInputStream; 5 6 6 7 public class cTools .. .. @@ -15,6 +16,16 @@ 15 16 16 17 java.net.URL u; 17 18 InputStream is = null; 19 +20 + if (new File(location).exists())21 + {22 + // Already downloaded23 + System.out.println(location + ": Already downloaded");24 +25 + GetIcon(icon, location, "icon");26 +27 + return;28 + }18 29 19 30 java.util.zip.ZipInputStream zis; 20 31 .. .. @@ -39,13 +50,13 @@ 39 50 if (entryName.endsWith(".gsm")) 40 51 { 41 52 // ArchiCAD 42 - // continue;53 + continue;43 54 } 44 55 45 56 if (entryName.endsWith(".max")) 46 57 { 47 58 // 3DS MAX 48 - // continue;59 + continue;49 60 } 50 61 51 62 if (entryName.endsWith(".3ds") || entryName.endsWith(".obj")) .. .. @@ -63,6 +74,8 @@ 63 74 // reading until read returns 0 or less. 64 75 String outpath = location + "/" + entry.getName(); 65 76 77 + //new java.io.File(outpath).mkdirs();78 +66 79 TransferFile(outpath, zis); 67 80 } 68 81 } catch (java.net.MalformedURLException mue) .. .. @@ -72,8 +85,13 @@ 72 85 //System.exit(2); 73 86 } catch (IOException ioe) 74 87 { 75 - //System.err.println("Oops - an IOException happened.");76 - //ioe.printStackTrace();88 + System.err.println("Oops - an IOException happened.");89 + ioe.printStackTrace();90 + //System.exit(3);91 + } catch (IllegalArgumentException iae)92 + {93 + System.err.println("Oops - an IllegalArgumentException happened.");94 + iae.printStackTrace();77 95 //System.exit(3); 78 96 } finally 79 97 { .. .. @@ -114,6 +132,35 @@ 114 132 modelName = modelName.substring(0, modelName.length() - 4); 115 133 116 134 TransferFile(location + "/" + modelName + ".jpg", is); 135 +136 + GetIcon(icon, location, "icon");137 + }138 + catch (Exception e)139 + {140 + e.printStackTrace();141 + }142 + }143 +144 + private static void GetIcon(String icon, String location, String iconName)145 + {146 + URL u;147 + InputStream is;148 + try149 + {150 + //icon = https://storage3d.com/storage/2008.08/resized/7142f85f2575b35078f15feddaf8b315_64x64.jpg151 +152 + String[] split = icon.split("resized/");153 +154 + icon = split[0] + split[1];155 +156 + split = icon.split("_64x64");157 +158 + icon = split[0] + ".jpg";159 +160 + u = new java.net.URL(icon);161 + is = u.openStream();162 +163 + TransferFile(location + "/" + iconName + ".jpg", is);117 164 } 118 165 catch (Exception e) 119 166 { .. .. @@ -201,7 +248,7 @@ 201 248 GetRemoteZip("https://archive3d.net/?a=download&do=get&id=", browser.getDirectory() + "/" + cat, id, name, icon); 202 249 203 250 // To avoid network overload. 204 - Thread.sleep(2000);251 + Thread.sleep(1000);205 252 } 206 253 207 254 file.close();