.. | .. |
---|
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 | 32 | ScriptNode scriptnode; |
---|
.. | .. |
---|
170 | 170 | |
---|
171 | 171 | void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
172 | 172 | { |
---|
| 173 | + Object3D o; |
---|
| 174 | + |
---|
173 | 175 | if (hashtable.containsKey(GetUUID())) |
---|
174 | 176 | { |
---|
175 | | - Object3D o = hashtable.get(GetUUID()); |
---|
| 177 | + o = hashtable.get(GetUUID()); |
---|
176 | 178 | |
---|
177 | 179 | Grafreed.Assert(this.bRep == o.bRep); |
---|
178 | | - if (this.bRep != null) |
---|
179 | | - assert(this.bRep.support == o.transientrep); |
---|
| 180 | + //if (this.bRep != null) |
---|
| 181 | + // assert(this.bRep.support == o.transientrep); |
---|
| 182 | + if (this.support != null) |
---|
| 183 | + assert(this.support.bRep == o.transientrep); |
---|
| 184 | + } |
---|
| 185 | + else |
---|
| 186 | + { |
---|
| 187 | + o = new Object3D("copy of " + this.name); |
---|
180 | 188 | |
---|
181 | | - return; |
---|
| 189 | + hashtable.put(GetUUID(), o); |
---|
182 | 190 | } |
---|
183 | 191 | |
---|
184 | | - Object3D o = new Object3D(); |
---|
185 | | - |
---|
186 | | - hashtable.put(GetUUID(), o); |
---|
187 | | - |
---|
188 | | - for (int i=0; i<Size(); i++) |
---|
| 192 | + if (!blockloop) |
---|
189 | 193 | { |
---|
190 | | - get(i).ExtractBigData(hashtable); |
---|
| 194 | + blockloop = true; |
---|
| 195 | + |
---|
| 196 | + for (int i=0; i<Size(); i++) |
---|
| 197 | + { |
---|
| 198 | + get(i).ExtractBigData(hashtable); |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + blockloop = false; |
---|
191 | 202 | } |
---|
192 | 203 | |
---|
193 | 204 | ExtractBigData(o); |
---|
.. | .. |
---|
195 | 206 | |
---|
196 | 207 | void ExtractBigData(Object3D o) |
---|
197 | 208 | { |
---|
| 209 | + if (o.bRep != null) |
---|
| 210 | + Grafreed.Assert(o.bRep == this.bRep); |
---|
| 211 | + |
---|
198 | 212 | o.bRep = this.bRep; |
---|
199 | | - if (this.bRep != null) |
---|
| 213 | +// July 2019 if (this.bRep != null) |
---|
| 214 | +// { |
---|
| 215 | +// o.transientrep = this.bRep.support; |
---|
| 216 | +// o.bRep.support = null; |
---|
| 217 | +// } |
---|
| 218 | + |
---|
| 219 | + if (this.support != null) |
---|
200 | 220 | { |
---|
201 | | - o.transientrep = this.bRep.support; |
---|
202 | | - o.bRep.support = null; |
---|
| 221 | + if (o.transientrep != null) |
---|
| 222 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 223 | + |
---|
| 224 | + o.transientrep = this.support.bRep; |
---|
| 225 | + this.support.bRep = null; |
---|
203 | 226 | } |
---|
204 | 227 | |
---|
205 | 228 | // o.support = this.support; |
---|
.. | .. |
---|
223 | 246 | |
---|
224 | 247 | RestoreBigData(o); |
---|
225 | 248 | |
---|
226 | | - hashtable.remove(GetUUID()); |
---|
| 249 | + if (blockloop) |
---|
| 250 | + return; |
---|
| 251 | + |
---|
| 252 | + blockloop = true; |
---|
| 253 | + |
---|
| 254 | + //hashtable.remove(GetUUID()); |
---|
227 | 255 | |
---|
228 | 256 | for (int i=0; i<Size(); i++) |
---|
229 | 257 | { |
---|
230 | 258 | get(i).RestoreBigData(hashtable); |
---|
231 | 259 | } |
---|
| 260 | + |
---|
| 261 | + blockloop = false; |
---|
232 | 262 | } |
---|
233 | 263 | |
---|
234 | 264 | void RestoreBigData(Object3D o) |
---|
235 | 265 | { |
---|
236 | 266 | this.bRep = o.bRep; |
---|
237 | | - if (this.bRep != null) |
---|
238 | | - this.bRep.support = o.transientrep; |
---|
| 267 | + if (this.support != null && o.transientrep != null) |
---|
| 268 | + { |
---|
| 269 | + this.support.bRep = o.transientrep; |
---|
| 270 | + } |
---|
| 271 | +// July 2019 if (this.bRep != null) |
---|
| 272 | +// this.bRep.support = o.transientrep; |
---|
239 | 273 | // this.support = o.support; |
---|
240 | 274 | // this.fileparent = o.fileparent; |
---|
241 | 275 | } |
---|
.. | .. |
---|
881 | 915 | |
---|
882 | 916 | if (marked && Globals.isLIVE() && live && |
---|
883 | 917 | //TEMP21aug2018 |
---|
884 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 918 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
885 | 919 | currentframe != Globals.framecount) |
---|
886 | 920 | { |
---|
887 | 921 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
966 | 1000 | if (material == null || material.multiply) |
---|
967 | 1001 | return true; |
---|
968 | 1002 | |
---|
| 1003 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
969 | 1004 | return material.opacity > 0.99; |
---|
970 | 1005 | } |
---|
971 | 1006 | |
---|
.. | .. |
---|
1366 | 1401 | toParent = LA.newMatrix(); |
---|
1367 | 1402 | fromParent = LA.newMatrix(); |
---|
1368 | 1403 | } |
---|
| 1404 | + |
---|
1369 | 1405 | LA.matCopy(other.toParent, toParent); |
---|
1370 | 1406 | LA.matCopy(other.fromParent, fromParent); |
---|
1371 | 1407 | |
---|
.. | .. |
---|
2432 | 2468 | { |
---|
2433 | 2469 | editWindow.refreshContents(); |
---|
2434 | 2470 | } |
---|
| 2471 | + else |
---|
| 2472 | + { |
---|
| 2473 | + if (manipWindow != null) |
---|
| 2474 | + { |
---|
| 2475 | + manipWindow.refreshContents(); |
---|
| 2476 | + } |
---|
| 2477 | + } |
---|
| 2478 | + |
---|
2435 | 2479 | //if (parent != null) |
---|
2436 | 2480 | //parent.refreshEditWindow(); |
---|
2437 | 2481 | } |
---|
.. | .. |
---|
4962 | 5006 | } |
---|
4963 | 5007 | } |
---|
4964 | 5008 | |
---|
| 5009 | + ObjEditor GetWindow() |
---|
| 5010 | + { |
---|
| 5011 | + if (editWindow != null) |
---|
| 5012 | + return editWindow; |
---|
| 5013 | + |
---|
| 5014 | + return manipWindow; |
---|
| 5015 | + } |
---|
| 5016 | + |
---|
4965 | 5017 | cTreePath Select(int indexcount, boolean deselect) |
---|
4966 | 5018 | { |
---|
4967 | 5019 | if (hide || dontselect) |
---|
.. | .. |
---|
4998 | 5050 | if (leaf != null) |
---|
4999 | 5051 | { |
---|
5000 | 5052 | cTreePath tp = new cTreePath(this, leaf); |
---|
5001 | | - if (editWindow != null) |
---|
| 5053 | + ObjEditor window = GetWindow(); |
---|
| 5054 | + if (window != null) |
---|
5002 | 5055 | { |
---|
5003 | 5056 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
5004 | | - editWindow.Select(tp, deselect, true); |
---|
| 5057 | + window.Select(tp, deselect, true); |
---|
5005 | 5058 | } |
---|
5006 | 5059 | |
---|
5007 | 5060 | return tp; |
---|
.. | .. |
---|
5018 | 5071 | |
---|
5019 | 5072 | if (child == null) |
---|
5020 | 5073 | continue; |
---|
| 5074 | + |
---|
5021 | 5075 | if (child.HasTransparency() && child.size() != 0) |
---|
5022 | 5076 | { |
---|
5023 | 5077 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
5027 | 5081 | if (leaf != null) |
---|
5028 | 5082 | { |
---|
5029 | 5083 | cTreePath tp = new cTreePath(this, leaf); |
---|
5030 | | - if (editWindow != null) |
---|
| 5084 | + ObjEditor window = GetWindow(); |
---|
| 5085 | + if (window != null) |
---|
5031 | 5086 | { |
---|
5032 | | - editWindow.Select(tp, deselect, true); |
---|
| 5087 | + window.Select(tp, deselect, true); |
---|
5033 | 5088 | } |
---|
5034 | 5089 | |
---|
5035 | 5090 | return tp; |
---|
.. | .. |
---|
5750 | 5805 | support = support; |
---|
5751 | 5806 | |
---|
5752 | 5807 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5753 | | - boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5808 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5754 | 5809 | |
---|
5755 | 5810 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5756 | 5811 | { |
---|
.. | .. |
---|
5771 | 5826 | |
---|
5772 | 5827 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5773 | 5828 | //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5774 | | - (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
| 5829 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5775 | 5830 | { |
---|
5776 | 5831 | Globals.lighttouched = true; |
---|
5777 | 5832 | } // all panes... |
---|
.. | .. |
---|
5903 | 5958 | if (GetBRep() != null) |
---|
5904 | 5959 | { |
---|
5905 | 5960 | display.NextIndex(); |
---|
| 5961 | + |
---|
5906 | 5962 | // vertex color conflict : gl.glCallList(list); |
---|
5907 | 5963 | DrawNode(display, root, selected); |
---|
5908 | 5964 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
7260 | 7316 | // { |
---|
7261 | 7317 | // CameraPane.Ymax = spoth; |
---|
7262 | 7318 | // } |
---|
7263 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7264 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7319 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7320 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
7265 | 7321 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7266 | 7322 | // if (CameraPane.Xmin > boundary.x) |
---|
7267 | 7323 | // { |
---|
.. | .. |
---|
7966 | 8022 | } |
---|
7967 | 8023 | |
---|
7968 | 8024 | transient ObjEditor editWindow; |
---|
| 8025 | + transient ObjEditor manipWindow; |
---|
| 8026 | + |
---|
| 8027 | + transient boolean pinned; |
---|
| 8028 | + |
---|
7969 | 8029 | transient ObjectUI objectUI; |
---|
7970 | 8030 | public static int povDepth = 0; |
---|
7971 | 8031 | private static cVector tbMin = new cVector(); |
---|