Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
Object3D.java
....@@ -24,9 +24,9 @@
2424
2525 private UUID uuid = UUID.randomUUID();
2626
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;
3030 //
3131
3232 ScriptNode scriptnode;
....@@ -170,24 +170,35 @@
170170
171171 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
172172 {
173
+ Object3D o;
174
+
173175 if (hashtable.containsKey(GetUUID()))
174176 {
175
- Object3D o = hashtable.get(GetUUID());
177
+ o = hashtable.get(GetUUID());
176178
177179 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);
180188
181
- return;
189
+ hashtable.put(GetUUID(), o);
182190 }
183191
184
- Object3D o = new Object3D();
185
-
186
- hashtable.put(GetUUID(), o);
187
-
188
- for (int i=0; i<Size(); i++)
192
+ if (!blockloop)
189193 {
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;
191202 }
192203
193204 ExtractBigData(o);
....@@ -195,11 +206,23 @@
195206
196207 void ExtractBigData(Object3D o)
197208 {
209
+ if (o.bRep != null)
210
+ Grafreed.Assert(o.bRep == this.bRep);
211
+
198212 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)
200220 {
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;
203226 }
204227
205228 // o.support = this.support;
....@@ -223,19 +246,30 @@
223246
224247 RestoreBigData(o);
225248
226
- hashtable.remove(GetUUID());
249
+ if (blockloop)
250
+ return;
251
+
252
+ blockloop = true;
253
+
254
+ //hashtable.remove(GetUUID());
227255
228256 for (int i=0; i<Size(); i++)
229257 {
230258 get(i).RestoreBigData(hashtable);
231259 }
260
+
261
+ blockloop = false;
232262 }
233263
234264 void RestoreBigData(Object3D o)
235265 {
236266 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;
239273 // this.support = o.support;
240274 // this.fileparent = o.fileparent;
241275 }
....@@ -881,7 +915,7 @@
881915
882916 if (marked && Globals.isLIVE() && live &&
883917 //TEMP21aug2018
884
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
918
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
885919 currentframe != Globals.framecount)
886920 {
887921 currentframe = Globals.framecount;
....@@ -966,6 +1000,7 @@
9661000 if (material == null || material.multiply)
9671001 return true;
9681002
1003
+ // Transparent objects are dynamic because we have to sort the triangles.
9691004 return material.opacity > 0.99;
9701005 }
9711006
....@@ -1366,6 +1401,7 @@
13661401 toParent = LA.newMatrix();
13671402 fromParent = LA.newMatrix();
13681403 }
1404
+
13691405 LA.matCopy(other.toParent, toParent);
13701406 LA.matCopy(other.fromParent, fromParent);
13711407
....@@ -2432,6 +2468,14 @@
24322468 {
24332469 editWindow.refreshContents();
24342470 }
2471
+ else
2472
+ {
2473
+ if (manipWindow != null)
2474
+ {
2475
+ manipWindow.refreshContents();
2476
+ }
2477
+ }
2478
+
24352479 //if (parent != null)
24362480 //parent.refreshEditWindow();
24372481 }
....@@ -4962,6 +5006,14 @@
49625006 }
49635007 }
49645008
5009
+ ObjEditor GetWindow()
5010
+ {
5011
+ if (editWindow != null)
5012
+ return editWindow;
5013
+
5014
+ return manipWindow;
5015
+ }
5016
+
49655017 cTreePath Select(int indexcount, boolean deselect)
49665018 {
49675019 if (hide || dontselect)
....@@ -4998,10 +5050,11 @@
49985050 if (leaf != null)
49995051 {
50005052 cTreePath tp = new cTreePath(this, leaf);
5001
- if (editWindow != null)
5053
+ ObjEditor window = GetWindow();
5054
+ if (window != null)
50025055 {
50035056 //System.out.println("editWindow = " + editWindow + " vs " + this);
5004
- editWindow.Select(tp, deselect, true);
5057
+ window.Select(tp, deselect, true);
50055058 }
50065059
50075060 return tp;
....@@ -5018,6 +5071,7 @@
50185071
50195072 if (child == null)
50205073 continue;
5074
+
50215075 if (child.HasTransparency() && child.size() != 0)
50225076 {
50235077 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -5027,9 +5081,10 @@
50275081 if (leaf != null)
50285082 {
50295083 cTreePath tp = new cTreePath(this, leaf);
5030
- if (editWindow != null)
5084
+ ObjEditor window = GetWindow();
5085
+ if (window != null)
50315086 {
5032
- editWindow.Select(tp, deselect, true);
5087
+ window.Select(tp, deselect, true);
50335088 }
50345089
50355090 return tp;
....@@ -5750,7 +5805,7 @@
57505805 support = support;
57515806
57525807 //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);
57545809
57555810 if (!usecalllists && bRep != null && bRep.displaylist > 0)
57565811 {
....@@ -5771,7 +5826,7 @@
57715826
57725827 if (!selectmode && //display.DrawMode() != display.SELECTION &&
57735828 //(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)))
57755830 {
57765831 Globals.lighttouched = true;
57775832 } // all panes...
....@@ -5903,6 +5958,7 @@
59035958 if (GetBRep() != null)
59045959 {
59055960 display.NextIndex();
5961
+
59065962 // vertex color conflict : gl.glCallList(list);
59075963 DrawNode(display, root, selected);
59085964 if (this instanceof BezierPatch)
....@@ -7260,8 +7316,8 @@
72607316 // {
72617317 // CameraPane.Ymax = spoth;
72627318 // }
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);
72657321 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
72667322 // if (CameraPane.Xmin > boundary.x)
72677323 // {
....@@ -7966,6 +8022,10 @@
79668022 }
79678023
79688024 transient ObjEditor editWindow;
8025
+ transient ObjEditor manipWindow;
8026
+
8027
+ transient boolean pinned;
8028
+
79698029 transient ObjectUI objectUI;
79708030 public static int povDepth = 0;
79718031 private static cVector tbMin = new cVector();