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