Normand Briere
2019-06-17 e36047725ce3217618d4e5807ac7c8769b9e3598
Object3D.java
....@@ -4351,6 +4351,55 @@
43514351 }
43524352 }
43534353
4354
+ void RepairSOV()
4355
+ {
4356
+ if (blockloop)
4357
+ return;
4358
+
4359
+ String texname = this.GetPigmentTexture();
4360
+
4361
+ if (texname.startsWith("sov"))
4362
+ {
4363
+ String[] s = texname.split("/");
4364
+
4365
+ String[] sname = s[1].split("Color.pn");
4366
+
4367
+ texname = sname[0];
4368
+
4369
+ if (sname.length > 1)
4370
+ {
4371
+ texname += "Color.jpg";
4372
+ }
4373
+
4374
+ this.SetPigmentTexture("sov/" + texname);
4375
+ }
4376
+
4377
+ texname = this.GetBumpTexture();
4378
+
4379
+ if (texname.startsWith("sov"))
4380
+ {
4381
+ String[] s = texname.split("/");
4382
+
4383
+ String[] sname = s[1].split("Bump.pn");
4384
+
4385
+ texname = sname[0];
4386
+
4387
+ if (sname.length > 1)
4388
+ {
4389
+ texname += "Bump.jpg";
4390
+ }
4391
+
4392
+ this.SetBumpTexture("sov/" + texname);
4393
+ }
4394
+
4395
+ for (int i=0; i<Size(); i++)
4396
+ {
4397
+ blockloop = true;
4398
+ get(i).RepairSOV();
4399
+ blockloop = false;
4400
+ }
4401
+ }
4402
+
43544403 void RepairTexture()
43554404 {
43564405 if (this instanceof FileObject || blockloop)
....@@ -5846,16 +5895,27 @@
58465895 tex = GetTextures();
58475896 }
58485897
5849
- boolean failed = false;
5898
+ boolean failedPigment = false;
5899
+ boolean failedBump = false;
58505900
58515901 try
58525902 {
5853
- display.BindTextures(tex, texres);
5903
+ display.BindPigmentTexture(tex, texres);
58545904 }
58555905 catch (Exception e)
58565906 {
58575907 System.err.println("FAILED: " + this);
5858
- failed = true;
5908
+ failedPigment = true;
5909
+ }
5910
+
5911
+ try
5912
+ {
5913
+ display.BindBumpTexture(tex, texres);
5914
+ }
5915
+ catch (Exception e)
5916
+ {
5917
+ //System.err.println("FAILED: " + this);
5918
+ failedBump = true;
58595919 }
58605920
58615921 if (!compiled)
....@@ -5878,8 +5938,11 @@
58785938 }
58795939 }
58805940
5881
- if (!failed)
5882
- display.ReleaseTextures(tex);
5941
+ if (!failedBump)
5942
+ display.ReleaseBumpTexture(tex);
5943
+
5944
+ if (!failedPigment)
5945
+ display.ReleasePigmentTexture(tex);
58835946
58845947 display.PopMaterial(this, selected);
58855948 }