.. | .. |
---|
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("copy of " + this.name); |
---|
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; |
---|
.. | .. |
---|
219 | 248 | if (!hashtable.containsKey(GetUUID())) |
---|
220 | 249 | return; |
---|
221 | 250 | |
---|
| 251 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 252 | + |
---|
| 253 | + RestoreBigData(o); |
---|
| 254 | + |
---|
222 | 255 | if (blockloop) |
---|
223 | 256 | return; |
---|
224 | 257 | |
---|
225 | 258 | blockloop = true; |
---|
226 | | - |
---|
227 | | - Object3D o = hashtable.get(GetUUID()); |
---|
228 | | - |
---|
229 | | - RestoreBigData(o); |
---|
230 | 259 | |
---|
231 | 260 | //hashtable.remove(GetUUID()); |
---|
232 | 261 | |
---|
.. | .. |
---|
241 | 270 | void RestoreBigData(Object3D o) |
---|
242 | 271 | { |
---|
243 | 272 | this.bRep = o.bRep; |
---|
244 | | - if (this.bRep != null) |
---|
245 | | - 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; |
---|
246 | 284 | // this.support = o.support; |
---|
247 | 285 | // this.fileparent = o.fileparent; |
---|
248 | 286 | } |
---|
.. | .. |
---|
388 | 426 | } |
---|
389 | 427 | |
---|
390 | 428 | boolean live = false; |
---|
| 429 | + transient boolean keepdontselect; |
---|
391 | 430 | boolean dontselect = false; |
---|
392 | 431 | boolean hide = false; |
---|
393 | 432 | boolean link2master = false; // performs reset support/master at each frame |
---|
.. | .. |
---|
1374 | 1413 | toParent = LA.newMatrix(); |
---|
1375 | 1414 | fromParent = LA.newMatrix(); |
---|
1376 | 1415 | } |
---|
| 1416 | + |
---|
1377 | 1417 | LA.matCopy(other.toParent, toParent); |
---|
1378 | 1418 | LA.matCopy(other.fromParent, fromParent); |
---|
1379 | 1419 | |
---|
.. | .. |
---|
3078 | 3118 | { |
---|
3079 | 3119 | if (bRep != null) |
---|
3080 | 3120 | { |
---|
3081 | | - bRep.GenerateNormalsMINE(); |
---|
| 3121 | + bRep.MergeNormals(); //.GenerateNormalsMINE(); |
---|
3082 | 3122 | Touch(); |
---|
3083 | 3123 | } |
---|
3084 | 3124 | } |
---|
.. | .. |
---|
5043 | 5083 | |
---|
5044 | 5084 | if (child == null) |
---|
5045 | 5085 | continue; |
---|
| 5086 | + |
---|
5046 | 5087 | if (child.HasTransparency() && child.size() != 0) |
---|
5047 | 5088 | { |
---|
5048 | 5089 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
5380 | 5421 | blockloop = false; |
---|
5381 | 5422 | } |
---|
5382 | 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 | + |
---|
5383 | 5469 | boolean IsSelected() |
---|
5384 | 5470 | { |
---|
5385 | 5471 | if (parent == null) |
---|
.. | .. |
---|
5689 | 5775 | } |
---|
5690 | 5776 | } |
---|
5691 | 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 | + |
---|
5692 | 5799 | void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5693 | 5800 | { |
---|
5694 | 5801 | Draw(display, root, selected, blocked); |
---|
.. | .. |
---|
5797 | 5904 | |
---|
5798 | 5905 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5799 | 5906 | //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5800 | | - (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5907 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5801 | 5908 | { |
---|
5802 | 5909 | Globals.lighttouched = true; |
---|
5803 | 5910 | } // all panes... |
---|
.. | .. |
---|
5929 | 6036 | if (GetBRep() != null) |
---|
5930 | 6037 | { |
---|
5931 | 6038 | display.NextIndex(); |
---|
| 6039 | + |
---|
5932 | 6040 | // vertex color conflict : gl.glCallList(list); |
---|
5933 | 6041 | DrawNode(display, root, selected); |
---|
5934 | 6042 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
7286 | 7394 | // { |
---|
7287 | 7395 | // CameraPane.Ymax = spoth; |
---|
7288 | 7396 | // } |
---|
7289 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7290 | | - 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); |
---|
7291 | 7399 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7292 | 7400 | // if (CameraPane.Xmin > boundary.x) |
---|
7293 | 7401 | // { |
---|
.. | .. |
---|
7994 | 8102 | transient ObjEditor editWindow; |
---|
7995 | 8103 | transient ObjEditor manipWindow; |
---|
7996 | 8104 | |
---|
| 8105 | + transient boolean pinned; |
---|
| 8106 | + |
---|
7997 | 8107 | transient ObjectUI objectUI; |
---|
7998 | 8108 | public static int povDepth = 0; |
---|
7999 | 8109 | private static cVector tbMin = new cVector(); |
---|