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 }
....@@ -1367,6 +1401,7 @@
13671401 toParent = LA.newMatrix();
13681402 fromParent = LA.newMatrix();
13691403 }
1404
+
13701405 LA.matCopy(other.toParent, toParent);
13711406 LA.matCopy(other.fromParent, fromParent);
13721407
....@@ -2433,6 +2468,14 @@
24332468 {
24342469 editWindow.refreshContents();
24352470 }
2471
+ else
2472
+ {
2473
+ if (manipWindow != null)
2474
+ {
2475
+ manipWindow.refreshContents();
2476
+ }
2477
+ }
2478
+
24362479 //if (parent != null)
24372480 //parent.refreshEditWindow();
24382481 }
....@@ -4963,6 +5006,14 @@
49635006 }
49645007 }
49655008
5009
+ ObjEditor GetWindow()
5010
+ {
5011
+ if (editWindow != null)
5012
+ return editWindow;
5013
+
5014
+ return manipWindow;
5015
+ }
5016
+
49665017 cTreePath Select(int indexcount, boolean deselect)
49675018 {
49685019 if (hide || dontselect)
....@@ -4999,10 +5050,11 @@
49995050 if (leaf != null)
50005051 {
50015052 cTreePath tp = new cTreePath(this, leaf);
5002
- if (editWindow != null)
5053
+ ObjEditor window = GetWindow();
5054
+ if (window != null)
50035055 {
50045056 //System.out.println("editWindow = " + editWindow + " vs " + this);
5005
- editWindow.Select(tp, deselect, true);
5057
+ window.Select(tp, deselect, true);
50065058 }
50075059
50085060 return tp;
....@@ -5019,6 +5071,7 @@
50195071
50205072 if (child == null)
50215073 continue;
5074
+
50225075 if (child.HasTransparency() && child.size() != 0)
50235076 {
50245077 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -5028,9 +5081,10 @@
50285081 if (leaf != null)
50295082 {
50305083 cTreePath tp = new cTreePath(this, leaf);
5031
- if (editWindow != null)
5084
+ ObjEditor window = GetWindow();
5085
+ if (window != null)
50325086 {
5033
- editWindow.Select(tp, deselect, true);
5087
+ window.Select(tp, deselect, true);
50345088 }
50355089
50365090 return tp;
....@@ -5772,7 +5826,7 @@
57725826
57735827 if (!selectmode && //display.DrawMode() != display.SELECTION &&
57745828 //(touched || (bRep != null && bRep.displaylist <= 0)))
5775
- (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0)))
5829
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
57765830 {
57775831 Globals.lighttouched = true;
57785832 } // all panes...
....@@ -5904,6 +5958,7 @@
59045958 if (GetBRep() != null)
59055959 {
59065960 display.NextIndex();
5961
+
59075962 // vertex color conflict : gl.glCallList(list);
59085963 DrawNode(display, root, selected);
59095964 if (this instanceof BezierPatch)
....@@ -7261,8 +7316,8 @@
72617316 // {
72627317 // CameraPane.Ymax = spoth;
72637318 // }
7264
- info.g.drawArc(boundary.x, boundary.y,
7265
- 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);
72667321 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
72677322 // if (CameraPane.Xmin > boundary.x)
72687323 // {
....@@ -7967,6 +8022,10 @@
79678022 }
79688023
79698024 transient ObjEditor editWindow;
8025
+ transient ObjEditor manipWindow;
8026
+
8027
+ transient boolean pinned;
8028
+
79708029 transient ObjectUI objectUI;
79718030 public static int povDepth = 0;
79728031 private static cVector tbMin = new cVector();