.. | .. |
---|
22 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
23 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
24 | 24 | |
---|
| 25 | + // Use GetUUID for backward compatibility with null. |
---|
25 | 26 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 27 | |
---|
27 | 28 | // TEMPORARY for mocap undo. No need to be transient. |
---|
.. | .. |
---|
32 | 33 | String skyboxname; |
---|
33 | 34 | String skyboxext; |
---|
34 | 35 | |
---|
35 | | - Object3D versions[]; |
---|
| 36 | + Object3D versionlist[]; |
---|
36 | 37 | int versionindex = -1; |
---|
37 | 38 | |
---|
| 39 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 40 | + |
---|
38 | 41 | ScriptNode scriptnode; |
---|
39 | 42 | |
---|
40 | 43 | void InitOthers() |
---|
.. | .. |
---|
222 | 225 | // o.bRep.support = null; |
---|
223 | 226 | // } |
---|
224 | 227 | o.selection = this.selection; |
---|
225 | | - o.versions = this.versions; |
---|
| 228 | + o.versionlist = this.versionlist; |
---|
226 | 229 | o.versionindex = this.versionindex; |
---|
227 | 230 | |
---|
228 | 231 | if (this.support != null) |
---|
.. | .. |
---|
245 | 248 | // this.support = null; |
---|
246 | 249 | // this.fileparent = null; |
---|
247 | 250 | } |
---|
| 251 | + |
---|
| 252 | +// Object3D GetObject(java.util.UUID uuid) |
---|
| 253 | +// { |
---|
| 254 | +// if (this.uuid.equals(uuid)) |
---|
| 255 | +// return this; |
---|
| 256 | +// |
---|
| 257 | +// if (blockloop) |
---|
| 258 | +// return null; |
---|
| 259 | +// |
---|
| 260 | +// blockloop = true; |
---|
| 261 | +// |
---|
| 262 | +// for (int i=0; i<Size(); i++) |
---|
| 263 | +// { |
---|
| 264 | +// Object3D o = get(i).GetObject(uuid); |
---|
| 265 | +// |
---|
| 266 | +// if (o != null) |
---|
| 267 | +// return o; |
---|
| 268 | +// } |
---|
| 269 | +// |
---|
| 270 | +// blockloop = false; |
---|
| 271 | +// |
---|
| 272 | +// return null; |
---|
| 273 | +// } |
---|
248 | 274 | |
---|
249 | 275 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
250 | 276 | { |
---|
.. | .. |
---|
280 | 306 | |
---|
281 | 307 | this.selection = o.selection; |
---|
282 | 308 | |
---|
283 | | - this.versions = o.versions; |
---|
| 309 | + this.versionlist = o.versionlist; |
---|
284 | 310 | this.versionindex = o.versionindex; |
---|
285 | 311 | // July 2019 if (this.bRep != null) |
---|
286 | 312 | // this.bRep.support = o.transientrep; |
---|
.. | .. |
---|
2444 | 2470 | else |
---|
2445 | 2471 | { |
---|
2446 | 2472 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2473 | + if (objectUI != null) |
---|
| 2474 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2475 | + else |
---|
| 2476 | + //new Exception().printStackTrace(); |
---|
| 2477 | + System.err.println("objectUI is null"); |
---|
2447 | 2478 | } |
---|
2448 | 2479 | } |
---|
2449 | 2480 | |
---|
.. | .. |
---|
5545 | 5576 | if (fullname == null) |
---|
5546 | 5577 | return ""; |
---|
5547 | 5578 | |
---|
| 5579 | + if (fullname.pigment != null) |
---|
| 5580 | + { |
---|
| 5581 | + return fullname.pigment; |
---|
| 5582 | + } |
---|
| 5583 | + |
---|
5548 | 5584 | // System.out.println("Fullname = " + fullname); |
---|
5549 | 5585 | |
---|
5550 | 5586 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5557 | 5593 | |
---|
5558 | 5594 | if (split.length == 0) |
---|
5559 | 5595 | { |
---|
5560 | | - return ""; |
---|
| 5596 | + return fullname.pigment = ""; |
---|
5561 | 5597 | } |
---|
5562 | 5598 | |
---|
5563 | 5599 | if (split.length <= 2) |
---|
.. | .. |
---|
5565 | 5601 | if (fullname.name.endsWith(":")) |
---|
5566 | 5602 | { |
---|
5567 | 5603 | // Windows |
---|
5568 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5604 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5569 | 5605 | } |
---|
5570 | 5606 | |
---|
5571 | | - return split[0]; |
---|
| 5607 | + return fullname.pigment = split[0]; |
---|
5572 | 5608 | } |
---|
5573 | 5609 | |
---|
5574 | 5610 | // Windows |
---|
5575 | 5611 | assert(split.length == 4); |
---|
5576 | 5612 | |
---|
5577 | | - return split[0] + ":" + split[1]; |
---|
| 5613 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5578 | 5614 | } |
---|
5579 | 5615 | |
---|
5580 | 5616 | static String GetBump(cTexture fullname) |
---|
5581 | 5617 | { |
---|
5582 | 5618 | if (fullname == null) |
---|
5583 | 5619 | return ""; |
---|
| 5620 | + |
---|
| 5621 | + if (fullname.bump != null) |
---|
| 5622 | + { |
---|
| 5623 | + return fullname.bump; |
---|
| 5624 | + } |
---|
5584 | 5625 | |
---|
5585 | 5626 | // System.out.println("Fullname = " + fullname); |
---|
5586 | 5627 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5592 | 5633 | |
---|
5593 | 5634 | if (split.length == 0) |
---|
5594 | 5635 | { |
---|
5595 | | - return ""; |
---|
| 5636 | + return fullname.bump = ""; |
---|
5596 | 5637 | } |
---|
5597 | 5638 | |
---|
5598 | 5639 | if (split.length == 1) |
---|
5599 | 5640 | { |
---|
5600 | | - return ""; |
---|
| 5641 | + return fullname.bump = ""; |
---|
5601 | 5642 | } |
---|
5602 | 5643 | |
---|
5603 | 5644 | if (split.length == 2) |
---|
.. | .. |
---|
5605 | 5646 | if (fullname.name.endsWith(":")) |
---|
5606 | 5647 | { |
---|
5607 | 5648 | // Windows |
---|
5608 | | - return ""; |
---|
| 5649 | + return fullname.bump = ""; |
---|
5609 | 5650 | } |
---|
5610 | 5651 | |
---|
5611 | | - return split[1]; |
---|
| 5652 | + return fullname.bump = split[1]; |
---|
5612 | 5653 | } |
---|
5613 | 5654 | |
---|
5614 | 5655 | // Windows |
---|
5615 | 5656 | assert(split.length == 4); |
---|
5616 | 5657 | |
---|
5617 | | - return split[2] + ":" + split[3]; |
---|
| 5658 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5618 | 5659 | } |
---|
5619 | 5660 | |
---|
5620 | 5661 | String GetPigmentTexture() |
---|
.. | .. |
---|
5697 | 5738 | texname = ""; |
---|
5698 | 5739 | |
---|
5699 | 5740 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5741 | + |
---|
| 5742 | + GetTextures().pigment = null; |
---|
| 5743 | + |
---|
5700 | 5744 | Touch(); |
---|
5701 | 5745 | } |
---|
5702 | 5746 | |
---|
.. | .. |
---|
5769 | 5813 | texname = ""; |
---|
5770 | 5814 | |
---|
5771 | 5815 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
| 5816 | + |
---|
| 5817 | + GetTextures().bump = null; |
---|
5772 | 5818 | |
---|
5773 | 5819 | Touch(); |
---|
5774 | 5820 | } |
---|
.. | .. |
---|
7373 | 7419 | boundary.y = spot.y - 30; |
---|
7374 | 7420 | boundary.width = spot.width + 60; |
---|
7375 | 7421 | boundary.height = spot.height + 60; |
---|
7376 | | - clickInfo.g.setColor(Color.red); |
---|
| 7422 | + clickInfo.g.setColor(Color.white); |
---|
7377 | 7423 | int spotw = spot.x + spot.width; |
---|
7378 | 7424 | int spoth = spot.y + spot.height; |
---|
7379 | 7425 | clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
7393 | 7439 | // { |
---|
7394 | 7440 | // CameraPane.Ymax = spoth; |
---|
7395 | 7441 | // } |
---|
7396 | | - spot.translate(32, 32); |
---|
| 7442 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7443 | +// { |
---|
| 7444 | +// CameraPane.Xmin = spot.x; |
---|
| 7445 | +// } |
---|
| 7446 | +// if (CameraPane.Xmax < spotw) |
---|
| 7447 | +// { |
---|
| 7448 | +// CameraPane.Xmax = spotw; |
---|
| 7449 | +// } |
---|
| 7450 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7451 | +// { |
---|
| 7452 | +// CameraPane.Ymin = spot.y; |
---|
| 7453 | +// } |
---|
| 7454 | +// if (CameraPane.Ymax < spoth) |
---|
| 7455 | +// { |
---|
| 7456 | +// CameraPane.Ymax = spoth; |
---|
| 7457 | +// } |
---|
| 7458 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7459 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
| 7460 | + spot.translate(32, 0); |
---|
| 7461 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7462 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7463 | + |
---|
| 7464 | + spot.translate(32, 64); |
---|
7397 | 7465 | spotw = spot.x + spot.width; |
---|
7398 | 7466 | spoth = spot.y + spot.height; |
---|
7399 | 7467 | clickInfo.g.setColor(Color.cyan); |
---|
.. | .. |
---|
7414 | 7482 | // { |
---|
7415 | 7483 | // CameraPane.Ymax = spoth; |
---|
7416 | 7484 | // } |
---|
7417 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7418 | | - //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7419 | | - spot.translate(0, -32); |
---|
7420 | | - clickInfo.g.setColor(Color.yellow); |
---|
7421 | | - clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7422 | 7485 | clickInfo.g.setColor(Color.green); |
---|
7423 | | -// if (CameraPane.Xmin > spot.x) |
---|
7424 | | -// { |
---|
7425 | | -// CameraPane.Xmin = spot.x; |
---|
7426 | | -// } |
---|
7427 | | -// if (CameraPane.Xmax < spotw) |
---|
7428 | | -// { |
---|
7429 | | -// CameraPane.Xmax = spotw; |
---|
7430 | | -// } |
---|
7431 | | -// if (CameraPane.Ymin > spot.y) |
---|
7432 | | -// { |
---|
7433 | | -// CameraPane.Ymin = spot.y; |
---|
7434 | | -// } |
---|
7435 | | -// if (CameraPane.Ymax < spoth) |
---|
7436 | | -// { |
---|
7437 | | -// CameraPane.Ymax = spoth; |
---|
7438 | | -// } |
---|
7439 | 7486 | clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
7440 | 7487 | (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7441 | 7488 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
.. | .. |
---|
7494 | 7541 | retval = true; |
---|
7495 | 7542 | } |
---|
7496 | 7543 | spot.translate(0, 32); |
---|
| 7544 | + spot.translate(32, 0); |
---|
| 7545 | + spot.translate(0, 32); |
---|
7497 | 7546 | if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7498 | 7547 | { |
---|
7499 | 7548 | hitSomething = hitScale; |
---|
7500 | 7549 | |
---|
7501 | 7550 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7502 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7551 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7503 | 7552 | double sign = 1; |
---|
7504 | 7553 | if (hScale < 0) |
---|
7505 | 7554 | { |
---|
.. | .. |
---|
7511 | 7560 | //hScale = 0.01; |
---|
7512 | 7561 | } |
---|
7513 | 7562 | |
---|
7514 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7563 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7515 | 7564 | sign = 1; |
---|
7516 | 7565 | if (vScale < 0) |
---|
7517 | 7566 | { |
---|
.. | .. |
---|
7726 | 7775 | break; |
---|
7727 | 7776 | |
---|
7728 | 7777 | case hitScale: // scale |
---|
7729 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7778 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7730 | 7779 | double sign = 1; |
---|
7731 | 7780 | if (hScale < 0) |
---|
7732 | 7781 | { |
---|
.. | .. |
---|
7738 | 7787 | //hScale = 0.01; |
---|
7739 | 7788 | } |
---|
7740 | 7789 | |
---|
7741 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7790 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7742 | 7791 | sign = 1; |
---|
7743 | 7792 | if (vScale < 0) |
---|
7744 | 7793 | { |
---|
.. | .. |
---|
7771 | 7820 | case 3: // '\001' |
---|
7772 | 7821 | if (modified || opposite) |
---|
7773 | 7822 | { |
---|
| 7823 | + if (modified && opposite) |
---|
| 7824 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7825 | + else |
---|
7774 | 7826 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7775 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 7827 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7776 | 7828 | } // vScale, 1); |
---|
7777 | 7829 | else |
---|
7778 | 7830 | { |
---|
7779 | 7831 | // EXCEPTION! |
---|
7780 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7832 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7781 | 7833 | } // vScale, 1); |
---|
7782 | 7834 | break; |
---|
7783 | 7835 | |
---|
7784 | 7836 | case 2: // '\002' |
---|
7785 | 7837 | if (modified || opposite) |
---|
7786 | 7838 | { |
---|
7787 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7788 | | - LA.matScale(toParent, 1, totalScale, 1); |
---|
| 7839 | + if (modified && opposite) |
---|
| 7840 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7841 | + else |
---|
| 7842 | + //LA.matScale(toParent, hScale, 1, vScale); |
---|
| 7843 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7789 | 7844 | } else |
---|
7790 | 7845 | { |
---|
7791 | 7846 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7795 | 7850 | case 1: // '\003' |
---|
7796 | 7851 | if (modified || opposite) |
---|
7797 | 7852 | { |
---|
7798 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7799 | | - LA.matScale(toParent, 1, 1, totalScale); |
---|
| 7853 | + if (modified && opposite) |
---|
| 7854 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7855 | + else |
---|
| 7856 | + //LA.matScale(toParent, hScale, vScale, 1); |
---|
| 7857 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7800 | 7858 | } else |
---|
7801 | 7859 | { |
---|
7802 | 7860 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|