.. | .. |
---|
134 | 134 | |
---|
135 | 135 | try |
---|
136 | 136 | { |
---|
137 | | - BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
138 | | - |
---|
| 137 | + BufferedImage image; |
---|
| 138 | + |
---|
| 139 | + if (name.endsWith("jpg")) |
---|
| 140 | + // Much faster! |
---|
| 141 | + image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage(); |
---|
| 142 | + else |
---|
| 143 | + image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
| 144 | + |
---|
139 | 145 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
140 | 146 | // { |
---|
141 | 147 | // BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
.. | .. |
---|
310 | 316 | objEditor.ctrlPanel.remove(setupPanel2); |
---|
311 | 317 | objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
312 | 318 | objEditor.ctrlPanel.remove(pushPanel); |
---|
| 319 | + if (versionPanel != null) |
---|
| 320 | + objEditor.ctrlPanel.remove(versionPanel); |
---|
313 | 321 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
314 | 322 | |
---|
315 | 323 | //Remove(normalpushField); |
---|
.. | .. |
---|
377 | 385 | client = inClient; |
---|
378 | 386 | copy = client; |
---|
379 | 387 | |
---|
380 | | - if (copy.versionlist == null) |
---|
381 | | - { |
---|
382 | | - copy.versionlist = new Object3D[100]; |
---|
383 | | - copy.versionindex = -1; |
---|
384 | | - |
---|
385 | | -// Save(true); |
---|
386 | | - } |
---|
387 | | - |
---|
388 | 388 | SetupUI2(callee.GetEditor()); |
---|
389 | 389 | } |
---|
390 | 390 | |
---|
.. | .. |
---|
460 | 460 | importOBJItem.addActionListener(this); |
---|
461 | 461 | import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
462 | 462 | import3DSItem.addActionListener(this); |
---|
| 463 | + if (Globals.ADVANCED) |
---|
| 464 | + { |
---|
463 | 465 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
464 | 466 | importVRMLX3DItem.addActionListener(this); |
---|
| 467 | + } |
---|
465 | 468 | menu.add("-"); |
---|
466 | 469 | importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
467 | 470 | importGFDItem.addActionListener(this); |
---|
.. | .. |
---|
1162 | 1165 | cGridBag setupPanel2; |
---|
1163 | 1166 | cGridBag objectCommandsPanel; |
---|
1164 | 1167 | cGridBag pushPanel; |
---|
| 1168 | + cGridBag versionPanel; |
---|
1165 | 1169 | cGridBag fillPanel; |
---|
1166 | 1170 | |
---|
1167 | 1171 | JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
.. | .. |
---|
1408 | 1412 | oe.ctrlPanel.add(objectCommandsPanel); |
---|
1409 | 1413 | oe.ctrlPanel.Return(); |
---|
1410 | 1414 | |
---|
1411 | | - pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1415 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH * 100, 1.1); // To have the buttons |
---|
1412 | 1416 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
1413 | | - //Return(); |
---|
| 1417 | + if (false && copy.versionlist != null && copy.versionindex != -1) |
---|
| 1418 | + { |
---|
| 1419 | + oe.ctrlPanel.Return(); |
---|
| 1420 | + versionPanel = AddSlider(oe.ctrlPanel, "Version", 0, copy.VersionCount() - 1, copy.versionindex); |
---|
| 1421 | + versionField = (cNumberSlider)versionPanel.getComponent(1); |
---|
| 1422 | + } |
---|
1414 | 1423 | |
---|
1415 | 1424 | oe.ctrlPanel.Return(); |
---|
1416 | 1425 | |
---|
.. | .. |
---|
1766 | 1775 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1767 | 1776 | |
---|
1768 | 1777 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1769 | | - scenePanel.preferredWidth = 6; |
---|
| 1778 | + scenePanel.preferredWidth = 5; |
---|
1770 | 1779 | |
---|
1771 | 1780 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1772 | 1781 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1786 | 1795 | cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
1787 | 1796 | creditsPanel.setName("Credits"); |
---|
1788 | 1797 | |
---|
1789 | | - cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1798 | + cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
1790 | 1799 | creditsPanel.add(ogaLabel); |
---|
1791 | 1800 | |
---|
1792 | | - cButton opengameartButton; |
---|
1793 | | - creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
1794 | | - opengameartButton.setToolTipText("https://opengameart.org"); |
---|
| 1801 | + cButton creditButton; |
---|
| 1802 | + creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1803 | + creditButton.setToolTipText("https://opengameart.org"); |
---|
1795 | 1804 | |
---|
1796 | | - opengameartButton.addMouseListener(new MouseAdapter() |
---|
| 1805 | + creditButton.addMouseListener(new MouseAdapter() |
---|
1797 | 1806 | { |
---|
1798 | 1807 | public void mouseClicked(MouseEvent e) |
---|
1799 | 1808 | { |
---|
.. | .. |
---|
1808 | 1817 | } |
---|
1809 | 1818 | }); |
---|
1810 | 1819 | |
---|
1811 | | - for (int i=10; --i>=0;) |
---|
| 1820 | + ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF); |
---|
| 1821 | + creditsPanel.add(ogaLabel); |
---|
| 1822 | + |
---|
| 1823 | + creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF)); |
---|
| 1824 | + creditButton.setToolTipText("https://3delicious.net"); |
---|
| 1825 | + |
---|
| 1826 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1827 | + { |
---|
| 1828 | + public void mouseClicked(MouseEvent e) |
---|
| 1829 | + { |
---|
| 1830 | + try |
---|
| 1831 | + { |
---|
| 1832 | + Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net")); |
---|
| 1833 | + } catch (Exception e1) |
---|
| 1834 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1835 | + { |
---|
| 1836 | + e1.printStackTrace(); |
---|
| 1837 | + } |
---|
| 1838 | + } |
---|
| 1839 | + }); |
---|
| 1840 | + |
---|
| 1841 | + creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF)); |
---|
| 1842 | + creditButton.setToolTipText("https://archive3d.net"); |
---|
| 1843 | + |
---|
| 1844 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1845 | + { |
---|
| 1846 | + public void mouseClicked(MouseEvent e) |
---|
| 1847 | + { |
---|
| 1848 | + try |
---|
| 1849 | + { |
---|
| 1850 | + Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net")); |
---|
| 1851 | + } catch (Exception e1) |
---|
| 1852 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1853 | + { |
---|
| 1854 | + e1.printStackTrace(); |
---|
| 1855 | + } |
---|
| 1856 | + } |
---|
| 1857 | + }); |
---|
| 1858 | + |
---|
| 1859 | + creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF)); |
---|
| 1860 | + creditButton.setToolTipText("https://turbosquid.com"); |
---|
| 1861 | + |
---|
| 1862 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1863 | + { |
---|
| 1864 | + public void mouseClicked(MouseEvent e) |
---|
| 1865 | + { |
---|
| 1866 | + try |
---|
| 1867 | + { |
---|
| 1868 | + Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free")); |
---|
| 1869 | + } catch (Exception e1) |
---|
| 1870 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1871 | + { |
---|
| 1872 | + e1.printStackTrace(); |
---|
| 1873 | + } |
---|
| 1874 | + } |
---|
| 1875 | + }); |
---|
| 1876 | + |
---|
| 1877 | + for (int i=6; --i>=0;) |
---|
1812 | 1878 | { |
---|
1813 | 1879 | creditsPanel.add(new cGridBag()); |
---|
1814 | 1880 | } |
---|
.. | .. |
---|
1818 | 1884 | |
---|
1819 | 1885 | if (Globals.ADVANCED) |
---|
1820 | 1886 | { |
---|
1821 | | - tabbedPane.add(infoPanel); |
---|
1822 | | - tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
1823 | | - tabbedPane.setToolTipTextAt(4, "Information"); |
---|
| 1887 | + objectPanel.add(infoPanel); |
---|
| 1888 | + objectPanel.setIconAt(5, GetIcon("icons/info.png")); |
---|
| 1889 | + objectPanel.setToolTipTextAt(4, "Information"); |
---|
1824 | 1890 | } |
---|
1825 | 1891 | |
---|
1826 | 1892 | /* |
---|
.. | .. |
---|
2304 | 2370 | { |
---|
2305 | 2371 | public void mouseClicked(MouseEvent e) |
---|
2306 | 2372 | { |
---|
2307 | | - borderfadeField.setFloat(0.5); |
---|
| 2373 | + borderfadeField.setFloat(0.4); |
---|
2308 | 2374 | opacityField.setFloat(0.75); |
---|
2309 | 2375 | |
---|
2310 | 2376 | materialtouched = true; |
---|
.. | .. |
---|
2363 | 2429 | cameraField.setFloat(0.001); |
---|
2364 | 2430 | specularField.setFloat(0.001); |
---|
2365 | 2431 | fakedepthField.setFloat(0.001); |
---|
2366 | | - opacityField.setFloat(0.6); |
---|
| 2432 | + opacityField.setFloat(0.4); |
---|
2367 | 2433 | |
---|
2368 | 2434 | materialtouched = true; |
---|
2369 | 2435 | applySelf(); |
---|
2370 | 2436 | } |
---|
2371 | 2437 | }); |
---|
2372 | 2438 | presetpanel.add(shadowShader); |
---|
| 2439 | + |
---|
| 2440 | + cLabel para0 = GetLabel("icons/shadericons/parallax0.png", !Globals.NIMBUSLAF); |
---|
| 2441 | + para0.setToolTipText("No parallax"); |
---|
| 2442 | + para0.addMouseListener(new MouseAdapter() |
---|
| 2443 | + { |
---|
| 2444 | + public void mouseClicked(MouseEvent e) |
---|
| 2445 | + { |
---|
| 2446 | + parallaxField.setFloat(0.125); |
---|
| 2447 | + |
---|
| 2448 | + materialtouched = true; |
---|
| 2449 | + applySelf(); |
---|
| 2450 | + } |
---|
| 2451 | + }); |
---|
| 2452 | + presetpanel.add(para0); |
---|
| 2453 | + |
---|
| 2454 | + cLabel para1 = GetLabel("icons/shadericons/parallax1.png", !Globals.NIMBUSLAF); |
---|
| 2455 | + para1.setToolTipText("With parallax"); |
---|
| 2456 | + para1.addMouseListener(new MouseAdapter() |
---|
| 2457 | + { |
---|
| 2458 | + public void mouseClicked(MouseEvent e) |
---|
| 2459 | + { |
---|
| 2460 | + parallaxField.setFloat(0.13); |
---|
| 2461 | + |
---|
| 2462 | + materialtouched = true; |
---|
| 2463 | + applySelf(); |
---|
| 2464 | + } |
---|
| 2465 | + }); |
---|
| 2466 | + presetpanel.add(para1); |
---|
| 2467 | + |
---|
| 2468 | + cLabel para2 = GetLabel("icons/shadericons/parallax2.png", !Globals.NIMBUSLAF); |
---|
| 2469 | + para2.setToolTipText("Reset parallax"); |
---|
| 2470 | + para2.addMouseListener(new MouseAdapter() |
---|
| 2471 | + { |
---|
| 2472 | + public void mouseClicked(MouseEvent e) |
---|
| 2473 | + { |
---|
| 2474 | + parallaxField.setFloat(0.14); |
---|
| 2475 | + |
---|
| 2476 | + materialtouched = true; |
---|
| 2477 | + applySelf(); |
---|
| 2478 | + } |
---|
| 2479 | + }); |
---|
| 2480 | + presetpanel.add(para2); |
---|
2373 | 2481 | |
---|
2374 | 2482 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2375 | 2483 | |
---|
.. | .. |
---|
2616 | 2724 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
2617 | 2725 | colorSection.add(backlit); |
---|
2618 | 2726 | |
---|
| 2727 | + cGridBag parallax = new cGridBag(); |
---|
| 2728 | + parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints); |
---|
| 2729 | + parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2730 | + parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.25, -0.125)); // , aConstraints); |
---|
| 2731 | + colorSection.add(parallax); |
---|
| 2732 | + |
---|
2619 | 2733 | //panel.add(new JSeparator()); |
---|
2620 | 2734 | |
---|
2621 | 2735 | //panel.add(globalSection); |
---|
.. | .. |
---|
3667 | 3781 | shadowField.setFloat(mat.shadow); |
---|
3668 | 3782 | textureField.setFloat(mat.texture); |
---|
3669 | 3783 | opacityField.setFloat(mat.opacity); |
---|
| 3784 | + parallaxField.setFloat(mat.parallax + 0.125f); |
---|
3670 | 3785 | fakedepthField.setFloat(mat.fakedepth); |
---|
3671 | 3786 | shadowbiasField.setFloat(mat.shadowbias); |
---|
3672 | 3787 | bumpField.setInteger(1); // dec 2013 |
---|
.. | .. |
---|
3960 | 4075 | } else if (event.getSource() == link2masterCB) |
---|
3961 | 4076 | { |
---|
3962 | 4077 | copy.link2master ^= true; |
---|
| 4078 | + objEditor.refreshContents(); |
---|
3963 | 4079 | return; |
---|
3964 | 4080 | } |
---|
3965 | 4081 | if (event.getSource() == randomCB) |
---|
.. | .. |
---|
4350 | 4466 | copy.versionindex -= 1; |
---|
4351 | 4467 | |
---|
4352 | 4468 | if (copy.versionindex != -1) |
---|
4353 | | - CopyChanged(); |
---|
| 4469 | + CopyChanged(copy); |
---|
4354 | 4470 | |
---|
4355 | 4471 | SetVersionStates(); |
---|
4356 | 4472 | } |
---|
.. | .. |
---|
4360 | 4476 | System.err.println("Save"); |
---|
4361 | 4477 | Replace(); |
---|
4362 | 4478 | |
---|
4363 | | - //cRadio tab = GetCurrentTab(); |
---|
| 4479 | + if (copy.versionlist == null) |
---|
| 4480 | + { |
---|
| 4481 | + copy.versionlist = new Object3D[100]; |
---|
| 4482 | + copy.versionindex = -1; |
---|
| 4483 | + } |
---|
4364 | 4484 | |
---|
4365 | 4485 | Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4366 | 4486 | |
---|
.. | .. |
---|
4428 | 4548 | { |
---|
4429 | 4549 | Object3D selection = new Object3D(); |
---|
4430 | 4550 | |
---|
4431 | | - for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4551 | + for (int i = 0; i < objEditor.copy.selection.size(); i++) |
---|
4432 | 4552 | { |
---|
4433 | | - Object3D elem = copy.selection.elementAt(i); |
---|
| 4553 | + Object3D elem = objEditor.copy.selection.elementAt(i); |
---|
4434 | 4554 | |
---|
4435 | | - Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4555 | + Object3D obj = objEditor.copy.GetObject(elem.GetUUID()); |
---|
4436 | 4556 | |
---|
4437 | 4557 | if (obj == null) |
---|
4438 | 4558 | { |
---|
4439 | | - copy.selection.remove(i--); |
---|
| 4559 | + objEditor.copy.selection.remove(i--); |
---|
4440 | 4560 | } |
---|
4441 | 4561 | else |
---|
4442 | 4562 | { |
---|
4443 | 4563 | selection.add(obj); |
---|
4444 | | - copy.selection.setElementAt(obj, i); |
---|
| 4564 | + objEditor.copy.selection.setElementAt(obj, i); |
---|
4445 | 4565 | } |
---|
4446 | 4566 | } |
---|
4447 | 4567 | |
---|
.. | .. |
---|
4454 | 4574 | //refreshContents(false); |
---|
4455 | 4575 | } |
---|
4456 | 4576 | |
---|
4457 | | - void CopyChanged() |
---|
| 4577 | + void CopyChanged(Object3D changed) |
---|
4458 | 4578 | { |
---|
4459 | | - Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
4460 | | - |
---|
4461 | | - SetVersionStates(); |
---|
| 4579 | + Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]); |
---|
4462 | 4580 | |
---|
4463 | 4581 | boolean temp = CameraPane.SWITCH; |
---|
4464 | 4582 | CameraPane.SWITCH = false; |
---|
4465 | 4583 | |
---|
4466 | | - copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4584 | + changed.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
4467 | 4585 | |
---|
4468 | | - copy.clear(); |
---|
| 4586 | + changed.clear(); |
---|
4469 | 4587 | |
---|
4470 | | - copy.skyboxname = obj.skyboxname; |
---|
4471 | | - copy.skyboxext = obj.skyboxext; |
---|
| 4588 | + changed.skyboxname = obj.skyboxname; |
---|
| 4589 | + changed.skyboxext = obj.skyboxext; |
---|
4472 | 4590 | |
---|
4473 | 4591 | for (int i=0; i<obj.Size(); i++) |
---|
4474 | 4592 | { |
---|
4475 | | - copy.add(obj.get(i)); |
---|
| 4593 | + changed.add(obj.get(i)); |
---|
4476 | 4594 | } |
---|
4477 | 4595 | |
---|
4478 | | - copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4596 | + changed.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
4479 | 4597 | |
---|
4480 | 4598 | CameraPane.SWITCH = temp; |
---|
4481 | 4599 | |
---|
4482 | | - RefreshSelection(); |
---|
| 4600 | + if (objEditor == this) |
---|
| 4601 | + RefreshSelection(); |
---|
4483 | 4602 | //assert(hashtable.isEmpty()); |
---|
4484 | 4603 | |
---|
4485 | | - copy.Touch(); |
---|
| 4604 | + objEditor.copy.Touch(); |
---|
4486 | 4605 | |
---|
4487 | 4606 | ResetModel(); |
---|
4488 | | - copy.HardTouch(); // recompile? |
---|
| 4607 | + objEditor.copy.HardTouch(); // recompile? |
---|
4489 | 4608 | |
---|
4490 | 4609 | cRadio ab; |
---|
4491 | | - for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4610 | + for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();) |
---|
4492 | 4611 | { |
---|
4493 | 4612 | ab = (cRadio)e.nextElement(); |
---|
4494 | | - Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4613 | + Object3D test = objEditor.copy.GetObject(ab.object.GetUUID()); |
---|
4495 | 4614 | //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
4496 | 4615 | if (test != null) |
---|
4497 | 4616 | { |
---|
.. | .. |
---|
4500 | 4619 | } |
---|
4501 | 4620 | } |
---|
4502 | 4621 | |
---|
4503 | | - refreshContents(true); |
---|
| 4622 | + objEditor.refreshContents(true); |
---|
4504 | 4623 | } |
---|
4505 | 4624 | |
---|
4506 | 4625 | cButton previousVersionButton; |
---|
.. | .. |
---|
4514 | 4633 | |
---|
4515 | 4634 | int VersionCount() |
---|
4516 | 4635 | { |
---|
4517 | | - int count = 0; |
---|
4518 | | - |
---|
4519 | | - for (int i = copy.versionlist.length; --i >= 0;) |
---|
4520 | | - { |
---|
4521 | | - if (copy.versionlist[i] != null) |
---|
4522 | | - count++; |
---|
4523 | | - } |
---|
4524 | | - |
---|
4525 | | - return count; |
---|
| 4636 | + return copy.VersionCount(); |
---|
4526 | 4637 | } |
---|
4527 | 4638 | |
---|
4528 | 4639 | public cGridBag versionSliderPane; |
---|
.. | .. |
---|
4534 | 4645 | |
---|
4535 | 4646 | //cRadio tab = GetCurrentTab(); |
---|
4536 | 4647 | |
---|
4537 | | - if (copy.versionlist == null) |
---|
| 4648 | + if (copy.versionindex == -2) |
---|
4538 | 4649 | { |
---|
4539 | 4650 | saveVersionButton.setEnabled(false); |
---|
4540 | 4651 | restoreButton.setEnabled(false); |
---|
.. | .. |
---|
4596 | 4707 | |
---|
4597 | 4708 | copy.versionindex -= 1; |
---|
4598 | 4709 | |
---|
4599 | | - CopyChanged(); |
---|
| 4710 | + CopyChanged(copy); |
---|
| 4711 | + |
---|
| 4712 | + SetVersionStates(); |
---|
4600 | 4713 | |
---|
4601 | 4714 | return true; |
---|
4602 | 4715 | } |
---|
.. | .. |
---|
4614 | 4727 | } |
---|
4615 | 4728 | |
---|
4616 | 4729 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
4617 | | - CopyChanged(); |
---|
| 4730 | + CopyChanged(copy); |
---|
| 4731 | + |
---|
| 4732 | + SetVersionStates(); |
---|
4618 | 4733 | |
---|
4619 | 4734 | return true; |
---|
4620 | 4735 | } |
---|
.. | .. |
---|
4651 | 4766 | |
---|
4652 | 4767 | copy.versionindex += 1; |
---|
4653 | 4768 | |
---|
4654 | | - CopyChanged(); |
---|
| 4769 | + CopyChanged(copy); |
---|
4655 | 4770 | |
---|
4656 | 4771 | //if (!tab.user[tab.versionindex]) |
---|
4657 | 4772 | // tab.graphs[tab.versionindex] = null; |
---|
| 4773 | + |
---|
| 4774 | + SetVersionStates(); |
---|
4658 | 4775 | } |
---|
4659 | 4776 | |
---|
4660 | 4777 | void ImportGFD() |
---|
.. | .. |
---|
4891 | 5008 | current.shadow = (float) shadowField.getFloat(); |
---|
4892 | 5009 | current.texture = (float) textureField.getFloat(); |
---|
4893 | 5010 | current.opacity = (float) opacityField.getFloat(); |
---|
| 5011 | + current.parallax = (float) parallaxField.getFloat() - 0.125f; |
---|
4894 | 5012 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4895 | 5013 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4896 | 5014 | |
---|
.. | .. |
---|
4945 | 5063 | textureField.SetToolTipValue((mat.texture)); |
---|
4946 | 5064 | if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
4947 | 5065 | opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5066 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5067 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
4948 | 5068 | if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
4949 | 5069 | fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4950 | 5070 | if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
.. | .. |
---|
4980 | 5100 | } |
---|
4981 | 5101 | |
---|
4982 | 5102 | cNumberSlider versionSlider; |
---|
| 5103 | + cNumberSlider versionField; |
---|
4983 | 5104 | |
---|
4984 | 5105 | public void stateChanged(ChangeEvent e) |
---|
4985 | 5106 | { |
---|
.. | .. |
---|
4996 | 5117 | if (version != -1 && copy.versionlist[version] != null) |
---|
4997 | 5118 | { |
---|
4998 | 5119 | copy.versionindex = version; |
---|
4999 | | - CopyChanged(); |
---|
| 5120 | + CopyChanged(copy); |
---|
| 5121 | + SetVersionStates(); |
---|
5000 | 5122 | } |
---|
5001 | 5123 | |
---|
5002 | 5124 | return; |
---|
5003 | 5125 | } |
---|
5004 | 5126 | |
---|
| 5127 | + if (e.getSource() == versionField) |
---|
| 5128 | + { |
---|
| 5129 | + int version = versionField.getInteger(); |
---|
| 5130 | + |
---|
| 5131 | + if (version != -1 && copy.versionindex != version && copy.versionlist[version] != null) |
---|
| 5132 | + { |
---|
| 5133 | + copy.versionindex = version; |
---|
| 5134 | + CopyChanged(copy); |
---|
| 5135 | + } |
---|
| 5136 | + |
---|
| 5137 | + return; |
---|
| 5138 | + } |
---|
| 5139 | + |
---|
5005 | 5140 | if (freezematerial) |
---|
5006 | 5141 | { |
---|
5007 | 5142 | return; |
---|
.. | .. |
---|
5091 | 5226 | } |
---|
5092 | 5227 | |
---|
5093 | 5228 | if (normalpushField != null) |
---|
5094 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
| 5229 | + copy.NORMALPUSH = (float)normalpushField.getFloat() / 100; |
---|
5095 | 5230 | } |
---|
5096 | 5231 | |
---|
5097 | 5232 | void SnapObject() |
---|
.. | .. |
---|
5465 | 5600 | void ResetModel() |
---|
5466 | 5601 | { |
---|
5467 | 5602 | //assert(copy instanceof Composite); |
---|
5468 | | - Object3D /*Composite*/ group = (Object3D /*Composite*/) copy; |
---|
| 5603 | + Object3D /*Composite*/ group = (Object3D /*Composite*/) objEditor.copy; |
---|
5469 | 5604 | |
---|
5470 | 5605 | // necessary? group.selection = new Object3D(); // java.util.Vector(); |
---|
5471 | 5606 | |
---|
.. | .. |
---|
5476 | 5611 | //group.refreshEditWindow(); |
---|
5477 | 5612 | //refreshContents(); |
---|
5478 | 5613 | |
---|
5479 | | - if (copy.selection == null) |
---|
| 5614 | + if (objEditor.copy.selection == null) |
---|
5480 | 5615 | { |
---|
5481 | | - copy.selection = new Object3D(); |
---|
| 5616 | + objEditor.copy.selection = new Object3D(); |
---|
5482 | 5617 | } |
---|
5483 | 5618 | |
---|
5484 | | - for (int j = 0; j < copy.selection.size(); j++) |
---|
| 5619 | + for (int j = 0; j < objEditor.copy.selection.size(); j++) |
---|
5485 | 5620 | { |
---|
5486 | | - Object3D item = copy.selection.get(j); |
---|
| 5621 | + Object3D item = objEditor.copy.selection.get(j); |
---|
5487 | 5622 | |
---|
5488 | 5623 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5489 | 5624 | { |
---|
.. | .. |
---|
5492 | 5627 | |
---|
5493 | 5628 | if (item.count <= 1) // ??? == 0) |
---|
5494 | 5629 | { |
---|
5495 | | - copy.selection.remove(item); |
---|
| 5630 | + objEditor.copy.selection.remove(item); |
---|
5496 | 5631 | } |
---|
5497 | 5632 | } |
---|
5498 | 5633 | |
---|
5499 | 5634 | boolean first = true; |
---|
5500 | 5635 | |
---|
5501 | | - for (int i = copy.selection.size(); --i >= 0;) |
---|
| 5636 | + for (int i = objEditor.copy.selection.size(); --i >= 0;) |
---|
5502 | 5637 | { |
---|
5503 | | - Object3D item = copy.selection.get(i); |
---|
| 5638 | + Object3D item = objEditor.copy.selection.get(i); |
---|
5504 | 5639 | |
---|
5505 | 5640 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5506 | 5641 | { |
---|
.. | .. |
---|
6201 | 6336 | cNumberSlider textureField; |
---|
6202 | 6337 | JLabel opacityLabel; |
---|
6203 | 6338 | cNumberSlider opacityField; |
---|
| 6339 | + JLabel parallaxLabel; |
---|
| 6340 | + cNumberSlider parallaxField; |
---|
6204 | 6341 | JLabel fakedepthLabel; |
---|
6205 | 6342 | cNumberSlider fakedepthField; |
---|
6206 | 6343 | JLabel shadowbiasLabel; |
---|