CameraPane.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history | |
icons/overlay.png | patch | view | raw | blame | history | |
icons/switch.png | patch | view | raw | blame | history |
CameraPane.java
.. .. @@ -335,14 +335,28 @@ 335 335 display.options1[2] = material.shadowbias; 336 336 display.options1[3] = material.aniso; 337 337 display.options1[4] = material.anisoV; 338 +// System.out.println("display.options1[0] " + display.options1[0]);339 +// System.out.println("display.options1[1] " + display.options1[1]);340 +// System.out.println("display.options1[2] " + display.options1[2]);341 +// System.out.println("display.options1[3] " + display.options1[3]);342 +// System.out.println("display.options1[4] " + display.options1[4]);338 343 display.options2[0] = material.opacity; 339 344 display.options2[1] = material.diffuse; 340 345 display.options2[2] = material.factor; 346 +// System.out.println("display.options2[0] " + display.options2[0]);347 +// System.out.println("display.options2[1] " + display.options2[1]);348 +// System.out.println("display.options2[2] " + display.options2[2]);341 349 342 350 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3); 351 +// System.out.println("display.options3[0] " + display.options3[0]);352 +// System.out.println("display.options3[1] " + display.options3[1]);353 +// System.out.println("display.options3[2] " + display.options3[2]);343 354 display.options4[0] = material.cameralight/0.2f; 344 355 display.options4[1] = material.subsurface; 345 356 display.options4[2] = material.sheen; 357 +// System.out.println("display.options4[0] " + display.options4[0]);358 +// System.out.println("display.options4[1] " + display.options4[1]);359 +// System.out.println("display.options4[2] " + display.options4[2]);346 360 347 361 // if (display.CURRENTANTIALIAS > 0) 348 362 // display.options3[3] /= 4; .. .. @@ -9374,13 +9388,13 @@ 9374 9388 void ResetOptions() 9375 9389 { 9376 9390 options1[0] = 100; 9377 - options1[1] = 0.00001f;9378 - options1[2] = 20;9391 + options1[1] = 0.025f;9392 + options1[2] = 0.01f;9379 9393 options1[3] = 0; 9380 9394 options1[4] = 0; 9381 9395 9382 9396 options2[0] = 0; 9383 - options2[1] = 1;9397 + options2[1] = 0.75f;9384 9398 options2[2] = 0; 9385 9399 options2[3] = 0; 9386 9400 GroupEditor.java
.. .. @@ -605,10 +605,12 @@ 605 605 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); 606 606 undoButton.setToolTipText("Undo changes"); 607 607 undoButton.addActionListener(this); 608 + undoButton.setEnabled(false);608 609 609 610 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); 610 611 redoButton.setToolTipText("Redo changes"); 611 612 redoButton.addActionListener(this); 613 + redoButton.setEnabled(false);612 614 613 615 copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); 614 616 saveButton.setToolTipText("Save changes"); .. .. @@ -743,6 +745,18 @@ 743 745 lightButton.setToolTipText("Create light"); 744 746 lightButton.addActionListener(this); 745 747 748 + for (int i=6; --i>=0;)749 + {750 + oe.toolboxPanel.Return();751 + oe.toolboxPanel.add(new cGridBag());752 + oe.toolboxPanel.add(new cGridBag());753 + oe.toolboxPanel.add(new cGridBag());754 + oe.toolboxPanel.add(new cGridBag());755 + oe.toolboxPanel.add(new cGridBag());756 + oe.toolboxPanel.add(new cGridBag());757 + oe.toolboxPanel.add(new cGridBag());758 + }759 +746 760 // EDIT panel 747 761 editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); 748 762 editButton.setToolTipText("Edit selection"); .. .. @@ -3326,6 +3340,12 @@ 3326 3340 } else 3327 3341 if (source == editItem || source == editButton) 3328 3342 { 3343 + for (Enumeration e = group.selection.elements(); e.hasMoreElements();)3344 + {3345 + Object3D child = (Object3D)e.nextElement();3346 + child.pinned = true;3347 + }3348 +3329 3349 EditSelection(false); 3330 3350 } else 3331 3351 if (source == uneditButton) .. .. @@ -3335,6 +3355,7 @@ 3335 3355 Object3D child = (Object3D)e.nextElement(); 3336 3356 if(child.editWindow != null) 3337 3357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); 3358 + child.pinned = false;3338 3359 child.CloseUI(); 3339 3360 listUI.remove(child); 3340 3361 .. .. @@ -3351,6 +3372,7 @@ 3351 3372 //copy.ClearUI(); 3352 3373 for (Object3D obj : listUI) 3353 3374 { 3375 + obj.pinned = true;3354 3376 obj.CloseUI(); 3355 3377 } 3356 3378 listUI.clear(); .. .. @@ -3360,7 +3382,7 @@ 3360 3382 { 3361 3383 assert(copy == group); 3362 3384 3363 - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));3385 + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));3364 3386 3365 3387 for (Object3D obj : listUI) 3366 3388 { .. .. @@ -4502,10 +4524,6 @@ 4502 4524 // } 4503 4525 // } 4504 4526 4505 - static boolean allparams = true;4506 -4507 - static Vector<Object3D> listUI = new Vector<Object3D>();4508 -4509 4527 void EditSelection(boolean newWindow) 4510 4528 { 4511 4529 // aConstraints.gridy = 0; .. .. @@ -4599,6 +4617,17 @@ 4599 4617 4600 4618 freezemodel = true; 4601 4619 4620 + //for (Object3D obj : listUI)4621 + for (int i=listUI.size(); --i>=0;)4622 + {4623 + Object3D obj = listUI.elementAt(i);4624 + if (!obj.pinned)4625 + {4626 + obj.CloseUI();4627 + listUI.remove(i);4628 + }4629 + }4630 +4602 4631 /**/ 4603 4632 //switch (event.id) 4604 4633 { .. .. @@ -4631,7 +4660,7 @@ 4631 4660 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) 4632 4661 // a camera 4633 4662 { 4634 - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())4663 + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace4635 4664 { 4636 4665 CameraPane.camerachangeframe = 0; // don't refuse it 4637 4666 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); .. .. @@ -4640,6 +4669,13 @@ 4640 4669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; 4641 4670 } 4642 4671 4672 + if (tps != null && tps.length == 1)4673 + {4674 + EditSelection(false);4675 + }4676 +4677 + SetPinStates(tps != null && tps.length > 0);4678 +4643 4679 refreshContents(); 4644 4680 //return true; 4645 4681 } .. .. @@ -4649,6 +4685,12 @@ 4649 4685 freezemodel = false; 4650 4686 } 4651 4687 4688 + void SetPinStates(boolean enabled)4689 + {4690 + editButton.setEnabled(enabled);4691 + uneditButton.setEnabled(enabled);4692 + }4693 +4652 4694 void refreshContents(boolean cp) 4653 4695 { 4654 4696 if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) .. .. @@ -5475,8 +5517,6 @@ 5475 5517 cButton minButton; 5476 5518 cButton maxButton; 5477 5519 cButton fullButton; 5478 - cButton undoButton;5479 - cButton redoButton;5480 5520 cButton saveButton; 5481 5521 cButton oneStepButton; 5482 5522 ObjEditor.java
.. .. @@ -207,7 +207,7 @@ 207 207 208 208 objEditor.ctrlPanel.remove(namePanel); 209 209 210 - if (!GroupEditor.allparams)210 + if (!allparams)211 211 return; 212 212 213 213 // objEditor.ctrlPanel.remove(liveCB); .. .. @@ -337,6 +337,11 @@ 337 337 return frame.action(event, obj); 338 338 } 339 339 340 + // Cannot work without static341 + static boolean allparams = true;342 +343 + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();344 +340 345 void SetupMenu() 341 346 { 342 347 frame.setMenuBar(menuBar = new MenuBar()); .. .. @@ -397,6 +402,11 @@ 397 402 // } 398 403 // 399 404 // materialFlushed = true; 405 +// }406 +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))407 +// {408 +// if (listUI.size() == 0)409 +// EditSelection(false);400 410 // } 401 411 402 412 refreshContents(false); // To refresh Info tab .. .. @@ -1102,7 +1112,7 @@ 1102 1112 1103 1113 oe.ctrlPanel.Return(); 1104 1114 1105 - if (!GroupEditor.allparams)1115 + if (!allparams)1106 1116 return; 1107 1117 1108 1118 setupPanel = new cGridBag().setVertical(false); .. .. @@ -1439,13 +1449,13 @@ 1439 1449 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); 1440 1450 //tmp.setName("Edit"); 1441 1451 objectPanel.add(materialPanel); 1442 - objectPanel.add(toolboxPanel);1443 1452 // JPanel north = new JPanel(new BorderLayout()); 1444 1453 // north.setName("Edit"); 1445 1454 // north.add(ctrlPanel, BorderLayout.NORTH); 1446 1455 // objectPanel.add(north); 1447 1456 objectPanel.add(editPanel); 1448 1457 objectPanel.add(infoPanel); 1458 + objectPanel.add(toolboxPanel);1449 1459 1450 1460 /* 1451 1461 aConstraints.gridx = 0; .. .. @@ -1454,7 +1464,7 @@ 1454 1464 aConstraints.gridy += 1; 1455 1465 aConstraints.gridwidth = 1; 1456 1466 mainPanel.add(objectPanel, aConstraints); 1457 - */1467 + */1458 1468 1459 1469 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, 1460 1470 VERTICAL_SCROLLBAR_AS_NEEDED, .. .. @@ -3527,6 +3537,8 @@ 3527 3537 tab.graphs[i] = null; 3528 3538 } 3529 3539 3540 + SetUndoStates();3541 +3530 3542 // test save 3531 3543 if (false) 3532 3544 { .. .. @@ -3549,6 +3561,8 @@ 3549 3561 3550 3562 void CopyChanged(Object3D obj) 3551 3563 { 3564 + SetUndoStates();3565 +3552 3566 boolean temp = CameraPane.SWITCH; 3553 3567 CameraPane.SWITCH = false; 3554 3568 .. .. @@ -3586,6 +3600,17 @@ 3586 3600 } 3587 3601 3588 3602 refreshContents(); 3603 + }3604 +3605 + cButton undoButton;3606 + cButton redoButton;3607 +3608 + void SetUndoStates()3609 + {3610 + cRadio tab = GetCurrentTab();3611 +3612 + undoButton.setEnabled(tab.undoindex > 0);3613 + redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);3589 3614 } 3590 3615 3591 3616 public void Undo() .. .. @@ -4765,6 +4790,8 @@ 4765 4790 String filename = browser.getFile(); 4766 4791 if (filename != null && filename.length() > 0) 4767 4792 { 4793 + if (!filename.endsWith(".gfd"))4794 + filename += ".gfd";4768 4795 lastname = browser.getDirectory() + filename; 4769 4796 save(); 4770 4797 } Object3D.java
.. .. @@ -7994,6 +7994,8 @@ 7994 7994 transient ObjEditor editWindow; 7995 7995 transient ObjEditor manipWindow; 7996 7996 7997 + transient boolean pinned;7998 +7997 7999 transient ObjectUI objectUI; 7998 8000 public static int povDepth = 0; 7999 8001 private static cVector tbMin = new cVector(); icons/overlay.pngBinary files differ
icons/switch.pngBinary files differ