Normand Briere
2019-07-23 0f4fa9dc4191aaee9661c1e6d73725436ae64ac2
Object3D.java
....@@ -29,6 +29,9 @@
2929 Object3D saveskeleton;
3030 //
3131
32
+ byte[] versions[];
33
+ int versionindex = -1;
34
+
3235 ScriptNode scriptnode;
3336
3437 void InitOthers()
....@@ -215,6 +218,9 @@
215218 // o.transientrep = this.bRep.support;
216219 // o.bRep.support = null;
217220 // }
221
+ o.selection = this.selection;
222
+ o.versions = this.versions;
223
+ o.versionindex = this.versionindex;
218224
219225 if (this.support != null)
220226 {
....@@ -268,6 +274,11 @@
268274 {
269275 this.support.bRep = o.transientrep;
270276 }
277
+
278
+ this.selection = o.selection;
279
+
280
+ this.versions = o.versions;
281
+ this.versionindex = o.versionindex;
271282 // July 2019 if (this.bRep != null)
272283 // this.bRep.support = o.transientrep;
273284 // this.support = o.support;
....@@ -415,6 +426,7 @@
415426 }
416427
417428 boolean live = false;
429
+ transient boolean keepdontselect;
418430 boolean dontselect = false;
419431 boolean hide = false;
420432 boolean link2master = false; // performs reset support/master at each frame
....@@ -3106,7 +3118,7 @@
31063118 {
31073119 if (bRep != null)
31083120 {
3109
- bRep.GenerateNormalsMINE();
3121
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31103122 Touch();
31113123 }
31123124 }
....@@ -5409,6 +5421,51 @@
54095421 blockloop = false;
54105422 }
54115423
5424
+ void ResetSelectable()
5425
+ {
5426
+ if (blockloop)
5427
+ return;
5428
+
5429
+ blockloop = true;
5430
+
5431
+ keepdontselect = dontselect;
5432
+ dontselect = true;
5433
+
5434
+ Object3D child;
5435
+ int nb = Size();
5436
+ for (int i = 0; i < nb; i++)
5437
+ {
5438
+ child = (Object3D) get(i);
5439
+ if (child == null)
5440
+ continue;
5441
+ child.ResetSelectable();
5442
+ }
5443
+
5444
+ blockloop = false;
5445
+ }
5446
+
5447
+ void RestoreSelectable()
5448
+ {
5449
+ if (blockloop)
5450
+ return;
5451
+
5452
+ blockloop = true;
5453
+
5454
+ dontselect = keepdontselect;
5455
+
5456
+ Object3D child;
5457
+ int nb = Size();
5458
+ for (int i = 0; i < nb; i++)
5459
+ {
5460
+ child = (Object3D) get(i);
5461
+ if (child == null)
5462
+ continue;
5463
+ child.RestoreSelectable();
5464
+ }
5465
+
5466
+ blockloop = false;
5467
+ }
5468
+
54125469 boolean IsSelected()
54135470 {
54145471 if (parent == null)
....@@ -5718,6 +5775,38 @@
57185775 }
57195776 }
57205777
5778
+ void EmbedTextures(boolean embed)
5779
+ {
5780
+ if (blockloop)
5781
+ return;
5782
+
5783
+ //if (GetTextures() != null)
5784
+ if (embed)
5785
+ CameraPane.EmbedTextures(GetTextures());
5786
+ else
5787
+ {
5788
+ GetTextures().pigmentdata = null;
5789
+ GetTextures().bumpdata = null;
5790
+ GetTextures().pw = 0;
5791
+ GetTextures().ph = 0;
5792
+ GetTextures().bw = 0;
5793
+ GetTextures().bh = 0;
5794
+ }
5795
+
5796
+ int nb = Size();
5797
+ for (int i = 0; i < nb; i++)
5798
+ {
5799
+ Object3D child = (Object3D) get(i);
5800
+
5801
+ if (child == null)
5802
+ continue;
5803
+
5804
+ blockloop = true;
5805
+ child.EmbedTextures(embed);
5806
+ blockloop = false;
5807
+ }
5808
+ }
5809
+
57215810 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57225811 {
57235812 Draw(display, root, selected, blocked);