.. | .. |
---|
24 | 24 | |
---|
25 | 25 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 26 | |
---|
27 | | - // TEMPORARY for mocap undo |
---|
28 | | - mocap.reader.BVHReader.BVHResult bvh; |
---|
29 | | - Object3D skeleton; |
---|
| 27 | + // TEMPORARY for mocap undo. No need to be transient. |
---|
| 28 | + mocap.reader.BVHReader.BVHResult savebvh; |
---|
| 29 | + Object3D saveskeleton; |
---|
30 | 30 | // |
---|
31 | 31 | |
---|
| 32 | + byte[] versions[]; |
---|
| 33 | + int versionindex = -1; |
---|
| 34 | + |
---|
32 | 35 | ScriptNode scriptnode; |
---|
33 | 36 | |
---|
34 | 37 | void InitOthers() |
---|
.. | .. |
---|
170 | 173 | |
---|
171 | 174 | void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
172 | 175 | { |
---|
| 176 | + Object3D o; |
---|
| 177 | + |
---|
173 | 178 | if (hashtable.containsKey(GetUUID())) |
---|
174 | 179 | { |
---|
175 | | - Object3D o = hashtable.get(GetUUID()); |
---|
| 180 | + o = hashtable.get(GetUUID()); |
---|
176 | 181 | |
---|
177 | 182 | Grafreed.Assert(this.bRep == o.bRep); |
---|
178 | | - if (this.bRep != null) |
---|
179 | | - assert(this.bRep.support == o.transientrep); |
---|
| 183 | + //if (this.bRep != null) |
---|
| 184 | + // assert(this.bRep.support == o.transientrep); |
---|
| 185 | + if (this.support != null) |
---|
| 186 | + assert(this.support.bRep == o.transientrep); |
---|
| 187 | + } |
---|
| 188 | + else |
---|
| 189 | + { |
---|
| 190 | + o = new Object3D("copy of " + this.name); |
---|
180 | 191 | |
---|
181 | | - return; |
---|
| 192 | + hashtable.put(GetUUID(), o); |
---|
182 | 193 | } |
---|
183 | 194 | |
---|
184 | | - Object3D o = new Object3D(); |
---|
185 | | - |
---|
186 | | - hashtable.put(GetUUID(), o); |
---|
187 | | - |
---|
188 | | - for (int i=0; i<Size(); i++) |
---|
| 195 | + if (!blockloop) |
---|
189 | 196 | { |
---|
190 | | - get(i).ExtractBigData(hashtable); |
---|
| 197 | + blockloop = true; |
---|
| 198 | + |
---|
| 199 | + for (int i=0; i<Size(); i++) |
---|
| 200 | + { |
---|
| 201 | + get(i).ExtractBigData(hashtable); |
---|
| 202 | + } |
---|
| 203 | + |
---|
| 204 | + blockloop = false; |
---|
191 | 205 | } |
---|
192 | 206 | |
---|
193 | 207 | ExtractBigData(o); |
---|
.. | .. |
---|
195 | 209 | |
---|
196 | 210 | void ExtractBigData(Object3D o) |
---|
197 | 211 | { |
---|
| 212 | + if (o.bRep != null) |
---|
| 213 | + Grafreed.Assert(o.bRep == this.bRep); |
---|
| 214 | + |
---|
198 | 215 | o.bRep = this.bRep; |
---|
199 | | - if (this.bRep != null) |
---|
| 216 | +// July 2019 if (this.bRep != null) |
---|
| 217 | +// { |
---|
| 218 | +// o.transientrep = this.bRep.support; |
---|
| 219 | +// o.bRep.support = null; |
---|
| 220 | +// } |
---|
| 221 | + o.selection = this.selection; |
---|
| 222 | + o.versions = this.versions; |
---|
| 223 | + o.versionindex = this.versionindex; |
---|
| 224 | + |
---|
| 225 | + if (this.support != null) |
---|
200 | 226 | { |
---|
201 | | - o.transientrep = this.bRep.support; |
---|
202 | | - o.bRep.support = null; |
---|
| 227 | + if (o.transientrep != null) |
---|
| 228 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 229 | + |
---|
| 230 | + o.transientrep = this.support.bRep; |
---|
| 231 | + this.support.bRep = null; |
---|
203 | 232 | } |
---|
204 | 233 | |
---|
205 | 234 | // o.support = this.support; |
---|
.. | .. |
---|
223 | 252 | |
---|
224 | 253 | RestoreBigData(o); |
---|
225 | 254 | |
---|
226 | | - hashtable.remove(GetUUID()); |
---|
| 255 | + if (blockloop) |
---|
| 256 | + return; |
---|
| 257 | + |
---|
| 258 | + blockloop = true; |
---|
| 259 | + |
---|
| 260 | + //hashtable.remove(GetUUID()); |
---|
227 | 261 | |
---|
228 | 262 | for (int i=0; i<Size(); i++) |
---|
229 | 263 | { |
---|
230 | 264 | get(i).RestoreBigData(hashtable); |
---|
231 | 265 | } |
---|
| 266 | + |
---|
| 267 | + blockloop = false; |
---|
232 | 268 | } |
---|
233 | 269 | |
---|
234 | 270 | void RestoreBigData(Object3D o) |
---|
235 | 271 | { |
---|
236 | 272 | this.bRep = o.bRep; |
---|
237 | | - if (this.bRep != null) |
---|
238 | | - this.bRep.support = o.transientrep; |
---|
| 273 | + if (this.support != null && o.transientrep != null) |
---|
| 274 | + { |
---|
| 275 | + this.support.bRep = o.transientrep; |
---|
| 276 | + } |
---|
| 277 | + |
---|
| 278 | + this.selection = o.selection; |
---|
| 279 | + |
---|
| 280 | + this.versions = o.versions; |
---|
| 281 | + this.versionindex = o.versionindex; |
---|
| 282 | +// July 2019 if (this.bRep != null) |
---|
| 283 | +// this.bRep.support = o.transientrep; |
---|
239 | 284 | // this.support = o.support; |
---|
240 | 285 | // this.fileparent = o.fileparent; |
---|
241 | 286 | } |
---|
.. | .. |
---|
381 | 426 | } |
---|
382 | 427 | |
---|
383 | 428 | boolean live = false; |
---|
| 429 | + transient boolean keepdontselect; |
---|
384 | 430 | boolean dontselect = false; |
---|
385 | 431 | boolean hide = false; |
---|
386 | 432 | boolean link2master = false; // performs reset support/master at each frame |
---|
.. | .. |
---|
881 | 927 | |
---|
882 | 928 | if (marked && Globals.isLIVE() && live && |
---|
883 | 929 | //TEMP21aug2018 |
---|
884 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 930 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
885 | 931 | currentframe != Globals.framecount) |
---|
886 | 932 | { |
---|
887 | 933 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
966 | 1012 | if (material == null || material.multiply) |
---|
967 | 1013 | return true; |
---|
968 | 1014 | |
---|
| 1015 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
969 | 1016 | return material.opacity > 0.99; |
---|
970 | 1017 | } |
---|
971 | 1018 | |
---|
.. | .. |
---|
1366 | 1413 | toParent = LA.newMatrix(); |
---|
1367 | 1414 | fromParent = LA.newMatrix(); |
---|
1368 | 1415 | } |
---|
| 1416 | + |
---|
1369 | 1417 | LA.matCopy(other.toParent, toParent); |
---|
1370 | 1418 | LA.matCopy(other.fromParent, fromParent); |
---|
1371 | 1419 | |
---|
.. | .. |
---|
2387 | 2435 | } |
---|
2388 | 2436 | */ |
---|
2389 | 2437 | } |
---|
| 2438 | + else |
---|
| 2439 | + { |
---|
| 2440 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2441 | + } |
---|
2390 | 2442 | } |
---|
2391 | 2443 | |
---|
2392 | 2444 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2428 | 2480 | { |
---|
2429 | 2481 | editWindow.refreshContents(); |
---|
2430 | 2482 | } |
---|
| 2483 | + else |
---|
| 2484 | + { |
---|
| 2485 | + if (manipWindow != null) |
---|
| 2486 | + { |
---|
| 2487 | + manipWindow.refreshContents(); |
---|
| 2488 | + } |
---|
| 2489 | + } |
---|
| 2490 | + |
---|
2431 | 2491 | //if (parent != null) |
---|
2432 | 2492 | //parent.refreshEditWindow(); |
---|
2433 | 2493 | } |
---|
.. | .. |
---|
3058 | 3118 | { |
---|
3059 | 3119 | if (bRep != null) |
---|
3060 | 3120 | { |
---|
3061 | | - bRep.GenerateNormalsMINE(); |
---|
| 3121 | + bRep.MergeNormals(); //.GenerateNormalsMINE(); |
---|
3062 | 3122 | Touch(); |
---|
3063 | 3123 | } |
---|
3064 | 3124 | } |
---|
.. | .. |
---|
4958 | 5018 | } |
---|
4959 | 5019 | } |
---|
4960 | 5020 | |
---|
| 5021 | + ObjEditor GetWindow() |
---|
| 5022 | + { |
---|
| 5023 | + if (editWindow != null) |
---|
| 5024 | + return editWindow; |
---|
| 5025 | + |
---|
| 5026 | + return manipWindow; |
---|
| 5027 | + } |
---|
| 5028 | + |
---|
4961 | 5029 | cTreePath Select(int indexcount, boolean deselect) |
---|
4962 | 5030 | { |
---|
4963 | 5031 | if (hide || dontselect) |
---|
.. | .. |
---|
4994 | 5062 | if (leaf != null) |
---|
4995 | 5063 | { |
---|
4996 | 5064 | cTreePath tp = new cTreePath(this, leaf); |
---|
4997 | | - if (editWindow != null) |
---|
| 5065 | + ObjEditor window = GetWindow(); |
---|
| 5066 | + if (window != null) |
---|
4998 | 5067 | { |
---|
4999 | 5068 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
5000 | | - editWindow.Select(tp, deselect, true); |
---|
| 5069 | + window.Select(tp, deselect, true); |
---|
5001 | 5070 | } |
---|
5002 | 5071 | |
---|
5003 | 5072 | return tp; |
---|
.. | .. |
---|
5014 | 5083 | |
---|
5015 | 5084 | if (child == null) |
---|
5016 | 5085 | continue; |
---|
| 5086 | + |
---|
5017 | 5087 | if (child.HasTransparency() && child.size() != 0) |
---|
5018 | 5088 | { |
---|
5019 | 5089 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
5023 | 5093 | if (leaf != null) |
---|
5024 | 5094 | { |
---|
5025 | 5095 | cTreePath tp = new cTreePath(this, leaf); |
---|
5026 | | - if (editWindow != null) |
---|
| 5096 | + ObjEditor window = GetWindow(); |
---|
| 5097 | + if (window != null) |
---|
5027 | 5098 | { |
---|
5028 | | - editWindow.Select(tp, deselect, true); |
---|
| 5099 | + window.Select(tp, deselect, true); |
---|
5029 | 5100 | } |
---|
5030 | 5101 | |
---|
5031 | 5102 | return tp; |
---|
.. | .. |
---|
5350 | 5421 | blockloop = false; |
---|
5351 | 5422 | } |
---|
5352 | 5423 | |
---|
| 5424 | + void ResetSelectable() |
---|
| 5425 | + { |
---|
| 5426 | + if (blockloop) |
---|
| 5427 | + return; |
---|
| 5428 | + |
---|
| 5429 | + blockloop = true; |
---|
| 5430 | + |
---|
| 5431 | + keepdontselect = dontselect; |
---|
| 5432 | + dontselect = true; |
---|
| 5433 | + |
---|
| 5434 | + Object3D child; |
---|
| 5435 | + int nb = Size(); |
---|
| 5436 | + for (int i = 0; i < nb; i++) |
---|
| 5437 | + { |
---|
| 5438 | + child = (Object3D) get(i); |
---|
| 5439 | + if (child == null) |
---|
| 5440 | + continue; |
---|
| 5441 | + child.ResetSelectable(); |
---|
| 5442 | + } |
---|
| 5443 | + |
---|
| 5444 | + blockloop = false; |
---|
| 5445 | + } |
---|
| 5446 | + |
---|
| 5447 | + void RestoreSelectable() |
---|
| 5448 | + { |
---|
| 5449 | + if (blockloop) |
---|
| 5450 | + return; |
---|
| 5451 | + |
---|
| 5452 | + blockloop = true; |
---|
| 5453 | + |
---|
| 5454 | + dontselect = keepdontselect; |
---|
| 5455 | + |
---|
| 5456 | + Object3D child; |
---|
| 5457 | + int nb = Size(); |
---|
| 5458 | + for (int i = 0; i < nb; i++) |
---|
| 5459 | + { |
---|
| 5460 | + child = (Object3D) get(i); |
---|
| 5461 | + if (child == null) |
---|
| 5462 | + continue; |
---|
| 5463 | + child.RestoreSelectable(); |
---|
| 5464 | + } |
---|
| 5465 | + |
---|
| 5466 | + blockloop = false; |
---|
| 5467 | + } |
---|
| 5468 | + |
---|
5353 | 5469 | boolean IsSelected() |
---|
5354 | 5470 | { |
---|
5355 | 5471 | if (parent == null) |
---|
.. | .. |
---|
5659 | 5775 | } |
---|
5660 | 5776 | } |
---|
5661 | 5777 | |
---|
| 5778 | + void EmbedTextures() |
---|
| 5779 | + { |
---|
| 5780 | + if (blockloop) |
---|
| 5781 | + return; |
---|
| 5782 | + |
---|
| 5783 | + CameraPane.EmbedTextures(texture); |
---|
| 5784 | + |
---|
| 5785 | + int nb = Size(); |
---|
| 5786 | + for (int i = 0; i < nb; i++) |
---|
| 5787 | + { |
---|
| 5788 | + Object3D child = (Object3D) get(i); |
---|
| 5789 | + |
---|
| 5790 | + if (child == null) |
---|
| 5791 | + continue; |
---|
| 5792 | + |
---|
| 5793 | + blockloop = true; |
---|
| 5794 | + child.EmbedTextures(); |
---|
| 5795 | + blockloop = false; |
---|
| 5796 | + } |
---|
| 5797 | + } |
---|
| 5798 | + |
---|
5662 | 5799 | void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5663 | 5800 | { |
---|
5664 | 5801 | Draw(display, root, selected, blocked); |
---|
.. | .. |
---|
5746 | 5883 | support = support; |
---|
5747 | 5884 | |
---|
5748 | 5885 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5749 | | - boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5886 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5750 | 5887 | |
---|
5751 | 5888 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5752 | 5889 | { |
---|
.. | .. |
---|
5767 | 5904 | |
---|
5768 | 5905 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5769 | 5906 | //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5770 | | - (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
| 5907 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5771 | 5908 | { |
---|
5772 | 5909 | Globals.lighttouched = true; |
---|
5773 | 5910 | } // all panes... |
---|
.. | .. |
---|
5899 | 6036 | if (GetBRep() != null) |
---|
5900 | 6037 | { |
---|
5901 | 6038 | display.NextIndex(); |
---|
| 6039 | + |
---|
5902 | 6040 | // vertex color conflict : gl.glCallList(list); |
---|
5903 | 6041 | DrawNode(display, root, selected); |
---|
5904 | 6042 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
6359 | 6497 | // dec 2012 |
---|
6360 | 6498 | new Exception().printStackTrace(); |
---|
6361 | 6499 | return; |
---|
| 6500 | + } |
---|
| 6501 | + |
---|
| 6502 | + if (dontselect) |
---|
| 6503 | + { |
---|
| 6504 | + //bRep.GenerateNormalsMINE(); |
---|
6362 | 6505 | } |
---|
6363 | 6506 | |
---|
6364 | 6507 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
7251 | 7394 | // { |
---|
7252 | 7395 | // CameraPane.Ymax = spoth; |
---|
7253 | 7396 | // } |
---|
7254 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7255 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7397 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7398 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
7256 | 7399 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7257 | 7400 | // if (CameraPane.Xmin > boundary.x) |
---|
7258 | 7401 | // { |
---|
.. | .. |
---|
7796 | 7939 | editWindow = null; |
---|
7797 | 7940 | } // ? |
---|
7798 | 7941 | } |
---|
| 7942 | + else |
---|
| 7943 | + { |
---|
| 7944 | + //editWindow.closeUI(); |
---|
| 7945 | + } |
---|
7799 | 7946 | } |
---|
7800 | 7947 | |
---|
7801 | 7948 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7953 | 8100 | } |
---|
7954 | 8101 | |
---|
7955 | 8102 | transient ObjEditor editWindow; |
---|
| 8103 | + transient ObjEditor manipWindow; |
---|
| 8104 | + |
---|
| 8105 | + transient boolean pinned; |
---|
| 8106 | + |
---|
7956 | 8107 | transient ObjectUI objectUI; |
---|
7957 | 8108 | public static int povDepth = 0; |
---|
7958 | 8109 | private static cVector tbMin = new cVector(); |
---|