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("copy of " + this.name);
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;
....@@ -219,14 +242,14 @@
219242 if (!hashtable.containsKey(GetUUID()))
220243 return;
221244
245
+ Object3D o = hashtable.get(GetUUID());
246
+
247
+ RestoreBigData(o);
248
+
222249 if (blockloop)
223250 return;
224251
225252 blockloop = true;
226
-
227
- Object3D o = hashtable.get(GetUUID());
228
-
229
- RestoreBigData(o);
230253
231254 //hashtable.remove(GetUUID());
232255
....@@ -241,8 +264,12 @@
241264 void RestoreBigData(Object3D o)
242265 {
243266 this.bRep = o.bRep;
244
- if (this.bRep != null)
245
- 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;
246273 // this.support = o.support;
247274 // this.fileparent = o.fileparent;
248275 }
....@@ -1374,6 +1401,7 @@
13741401 toParent = LA.newMatrix();
13751402 fromParent = LA.newMatrix();
13761403 }
1404
+
13771405 LA.matCopy(other.toParent, toParent);
13781406 LA.matCopy(other.fromParent, fromParent);
13791407