Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
Object3D.java
....@@ -24,11 +24,14 @@
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
32
+ byte[] versions[] = new byte[100][];
33
+ int versionindex = -1;
34
+
3235 ScriptNode scriptnode;
3336
3437 void InitOthers()
....@@ -170,24 +173,35 @@
170173
171174 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
172175 {
176
+ Object3D o;
177
+
173178 if (hashtable.containsKey(GetUUID()))
174179 {
175
- Object3D o = hashtable.get(GetUUID());
180
+ o = hashtable.get(GetUUID());
176181
177182 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);
180191
181
- return;
192
+ hashtable.put(GetUUID(), o);
182193 }
183194
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)
189196 {
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;
191205 }
192206
193207 ExtractBigData(o);
....@@ -195,11 +209,24 @@
195209
196210 void ExtractBigData(Object3D o)
197211 {
212
+ if (o.bRep != null)
213
+ Grafreed.Assert(o.bRep == this.bRep);
214
+
198215 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
+
223
+ if (this.support != null)
200224 {
201
- o.transientrep = this.bRep.support;
202
- o.bRep.support = null;
225
+ if (o.transientrep != null)
226
+ Grafreed.Assert(o.transientrep == this.support.bRep);
227
+
228
+ o.transientrep = this.support.bRep;
229
+ this.support.bRep = null;
203230 }
204231
205232 // o.support = this.support;
....@@ -219,14 +246,14 @@
219246 if (!hashtable.containsKey(GetUUID()))
220247 return;
221248
249
+ Object3D o = hashtable.get(GetUUID());
250
+
251
+ RestoreBigData(o);
252
+
222253 if (blockloop)
223254 return;
224255
225256 blockloop = true;
226
-
227
- Object3D o = hashtable.get(GetUUID());
228
-
229
- RestoreBigData(o);
230257
231258 //hashtable.remove(GetUUID());
232259
....@@ -241,8 +268,14 @@
241268 void RestoreBigData(Object3D o)
242269 {
243270 this.bRep = o.bRep;
244
- if (this.bRep != null)
245
- this.bRep.support = o.transientrep;
271
+ if (this.support != null && o.transientrep != null)
272
+ {
273
+ this.support.bRep = o.transientrep;
274
+ }
275
+
276
+ this.selection = o.selection;
277
+// July 2019 if (this.bRep != null)
278
+// this.bRep.support = o.transientrep;
246279 // this.support = o.support;
247280 // this.fileparent = o.fileparent;
248281 }
....@@ -1374,6 +1407,7 @@
13741407 toParent = LA.newMatrix();
13751408 fromParent = LA.newMatrix();
13761409 }
1410
+
13771411 LA.matCopy(other.toParent, toParent);
13781412 LA.matCopy(other.fromParent, fromParent);
13791413
....@@ -5043,6 +5077,7 @@
50435077
50445078 if (child == null)
50455079 continue;
5080
+
50465081 if (child.HasTransparency() && child.size() != 0)
50475082 {
50485083 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -5797,7 +5832,7 @@
57975832
57985833 if (!selectmode && //display.DrawMode() != display.SELECTION &&
57995834 //(touched || (bRep != null && bRep.displaylist <= 0)))
5800
- (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched || (bRep != null && bRep.displaylist <= 0)))
5835
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
58015836 {
58025837 Globals.lighttouched = true;
58035838 } // all panes...
....@@ -5929,6 +5964,7 @@
59295964 if (GetBRep() != null)
59305965 {
59315966 display.NextIndex();
5967
+
59325968 // vertex color conflict : gl.glCallList(list);
59335969 DrawNode(display, root, selected);
59345970 if (this instanceof BezierPatch)
....@@ -7286,8 +7322,8 @@
72867322 // {
72877323 // CameraPane.Ymax = spoth;
72887324 // }
7289
- info.g.drawArc(boundary.x, boundary.y,
7290
- boundary.width, boundary.height, 0, 360);
7325
+ info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7326
+ (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360);
72917327 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
72927328 // if (CameraPane.Xmin > boundary.x)
72937329 // {
....@@ -7994,6 +8030,8 @@
79948030 transient ObjEditor editWindow;
79958031 transient ObjEditor manipWindow;
79968032
8033
+ transient boolean pinned;
8034
+
79978035 transient ObjectUI objectUI;
79988036 public static int povDepth = 0;
79998037 private static cVector tbMin = new cVector();