Normand Briere
2019-07-07 46dbce888e7c3eff8969f1ddbe22e144410b67f4
CameraPane.java
....@@ -335,14 +335,28 @@
335335 display.options1[2] = material.shadowbias;
336336 display.options1[3] = material.aniso;
337337 display.options1[4] = material.anisoV;
338
+// System.out.println("display.options1[0] " + display.options1[0]);
339
+// System.out.println("display.options1[1] " + display.options1[1]);
340
+// System.out.println("display.options1[2] " + display.options1[2]);
341
+// System.out.println("display.options1[3] " + display.options1[3]);
342
+// System.out.println("display.options1[4] " + display.options1[4]);
338343 display.options2[0] = material.opacity;
339344 display.options2[1] = material.diffuse;
340345 display.options2[2] = material.factor;
346
+// System.out.println("display.options2[0] " + display.options2[0]);
347
+// System.out.println("display.options2[1] " + display.options2[1]);
348
+// System.out.println("display.options2[2] " + display.options2[2]);
341349
342350 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
351
+// System.out.println("display.options3[0] " + display.options3[0]);
352
+// System.out.println("display.options3[1] " + display.options3[1]);
353
+// System.out.println("display.options3[2] " + display.options3[2]);
343354 display.options4[0] = material.cameralight/0.2f;
344355 display.options4[1] = material.subsurface;
345356 display.options4[2] = material.sheen;
357
+// System.out.println("display.options4[0] " + display.options4[0]);
358
+// System.out.println("display.options4[1] " + display.options4[1]);
359
+// System.out.println("display.options4[2] " + display.options4[2]);
346360
347361 // if (display.CURRENTANTIALIAS > 0)
348362 // display.options3[3] /= 4;
....@@ -2051,7 +2065,7 @@
20512065 //System.err.println("Oeil on");
20522066 OEIL = true;
20532067 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
2054
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
2068
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
20552069 //pingthread.StepToTarget(true);
20562070 }
20572071
....@@ -9366,11 +9380,35 @@
93669380 jy8[3] = 0.5f;
93679381 }
93689382
9369
- float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
9383
+ float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
93709384 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
93719385 float[] options3 = new float[]{1, 1, 1, 0}; // fog color
93729386 float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
93739387
9388
+ void ResetOptions()
9389
+ {
9390
+ options1[0] = 100;
9391
+ options1[1] = 0.025f;
9392
+ options1[2] = 0.01f;
9393
+ options1[3] = 0;
9394
+ options1[4] = 0;
9395
+
9396
+ options2[0] = 0;
9397
+ options2[1] = 0.75f;
9398
+ options2[2] = 0;
9399
+ options2[3] = 0;
9400
+
9401
+ options3[0] = 1;
9402
+ options3[1] = 1;
9403
+ options3[2] = 1;
9404
+ options3[3] = 0;
9405
+
9406
+ options4[0] = 1;
9407
+ options4[1] = 0;
9408
+ options4[2] = 1;
9409
+ options4[3] = 0;
9410
+ }
9411
+
93749412 static int imagecount = 0; // movie generation
93759413
93769414 static int jitter = 0;
....@@ -10481,6 +10519,7 @@
1048110519 ANTIALIAS = 0;
1048210520 //System.out.println("RESTART");
1048310521 AAtimer.restart();
10522
+ Globals.TIMERRUNNING = true;
1048410523 }
1048510524 }
1048610525 }
....@@ -11479,13 +11518,16 @@
1147911518
1148011519 void DrawObject(GL gl, boolean draw)
1148111520 {
11521
+ // To clear camera values
11522
+ ResetOptions();
11523
+
1148211524 //System.out.println("DRAW OBJECT " + mouseDown);
1148311525 // DrawMode() = SELECTION;
1148411526 //GL gl = getGL();
1148511527 if ((TRACK || SHADOWTRACK) || zoomonce)
1148611528 {
1148711529 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
11488
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11530
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1148911531 pingthread.StepToTarget(true); // true);
1149011532 // zoomonce = false;
1149111533 }
....@@ -12046,7 +12088,7 @@
1204612088 for (int i = tp.size(); --i >= 0;)
1204712089 {
1204812090 //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
12049
- LA.xformPos(light, tp.get(i).GlobalTransform(), light);
12091
+ LA.xformPos(light, tp.get(i).GlobalTransformInv(), light);
1205012092 }
1205112093
1205212094
....@@ -13333,9 +13375,10 @@
1333313375 "DP3 " + dest + ".z," + "normals," + "eye;" +
1333413376 "MAX " + dest + ".w," + dest + ".z," + "eps.x;" +
1333513377 //"MOV " + dest + ".w," + "normal.z;" +
13336
- "MUL " + dest + ".z," + "params2.w," + dest + ".x;" +
13337
- "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13338
- //"MOV " + dest + ".z," + "params2.w;" +
13378
+// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET
13379
+// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13380
+
13381
+ "MOV " + dest + ".z," + "params2.w;" + // EXACT
1333913382 "POW " + dest + ".w," + dest + ".w," + dest + ".z;" +
1334013383 "RCP " + dest + ".w," + dest + ".w;" +
1334113384 //"RSQ " + dest + ".w," + dest + ".w;" +
....@@ -13840,6 +13883,7 @@
1384013883 else
1384113884 if (evt.getSource() == AAtimer)
1384213885 {
13886
+ Globals.TIMERRUNNING = false;
1384313887 if (mouseDown)
1384413888 {
1384513889 //new Exception().printStackTrace();
....@@ -13899,7 +13943,7 @@
1389913943
1390013944 // fev 2014???
1390113945 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
13902
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
13946
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1390313947 pingthread.StepToTarget(true); // true);
1390413948 }
1390513949 // if (!LIVE)
....@@ -13914,6 +13958,7 @@
1391413958 return;
1391513959
1391613960 AAtimer.restart(); //
13961
+ Globals.TIMERRUNNING = true;
1391713962
1391813963 // waslive = LIVE;
1391913964 // LIVE = false;
....@@ -14377,7 +14422,7 @@
1437714422 info.camera = renderCamera;
1437814423 info.x = x;
1437914424 info.y = y;
14380
- object.manipWindow.copy
14425
+ object.GetWindow().copy
1438114426 .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1438214427 } else
1438314428 {
....@@ -14559,7 +14604,8 @@
1455914604 Globals.MOUSEDRAGGED = false;
1456014605
1456114606 movingcamera = false;
14562
- X = Y = 0;
14607
+ X = 0; // getBounds().width/2;
14608
+ Y = 0; // getBounds().height/2;
1456314609 //System.out.println("mouseReleased: " + e);
1456414610 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1456514611 }
....@@ -15075,9 +15121,9 @@
1507515121 case '_':
1507615122 kompactbit = 5;
1507715123 break;
15078
- case '+':
15079
- kompactbit = 6;
15080
- break;
15124
+// case '+':
15125
+// kompactbit = 6;
15126
+// break;
1508115127 case ' ':
1508215128 ObjEditor.theFrame.ToggleFullScreen();
1508315129 repaint();
....@@ -15126,8 +15172,9 @@
1512615172 case DELETE:
1512715173 ClearSelection();
1512815174 break;
15129
- /*
1513015175 case '+':
15176
+
15177
+ /*
1513115178 //fontsize += 1;
1513215179 bbzoom *= 2;
1513315180 repaint();
....@@ -15144,17 +15191,17 @@
1514415191 case '=':
1514515192 IncDepth();
1514615193 //fontsize += 1;
15147
- object.editWindow.refreshContents(true);
15194
+ object.GetWindow().refreshContents(true);
1514815195 maskbit = 6;
1514915196 break;
1515015197 case '-': //if (PixelThreshold>1) PixelThreshold /= 2;
1515115198 DecDepth();
1515215199 maskbit = 5;
1515315200 //if(fontsize > 1) fontsize -= 1;
15154
- if (object.editWindow == null)
15155
- new Exception().printStackTrace();
15156
- else
15157
- object.editWindow.refreshContents(true);
15201
+// if (object.editWindow == null)
15202
+// new Exception().printStackTrace();
15203
+// else
15204
+ object.GetWindow().refreshContents(true);
1515815205 break;
1515915206 case '{':
1516015207 manipCamera.shaper_fovy /= 1.1;
....@@ -15378,7 +15425,7 @@
1537815425 }
1537915426 */
1538015427
15381
- object.editWindow.EditSelection();
15428
+ object.GetWindow().EditSelection(false);
1538215429 }
1538315430
1538415431 void SelectParent()
....@@ -15395,10 +15442,10 @@
1539515442 {
1539615443 //selectees.remove(i);
1539715444 System.out.println("select parent of " + elem);
15398
- group.editWindow.Select(elem.parent.GetTreePath(), first, true);
15445
+ group.GetWindow().Select(elem.parent.GetTreePath(), first, true);
1539915446 } else
1540015447 {
15401
- group.editWindow.Select(elem.GetTreePath(), first, true);
15448
+ group.GetWindow().Select(elem.GetTreePath(), first, true);
1540215449 }
1540315450
1540415451 first = false;
....@@ -15440,12 +15487,12 @@
1544015487 for (int j = 0; j < group.children.size(); j++)
1544115488 {
1544215489 elem = (Object3D) group.children.elementAt(j);
15443
- object.editWindow.Select(elem.GetTreePath(), first, true);
15490
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1544415491 first = false;
1544515492 }
1544615493 } else
1544715494 {
15448
- object.editWindow.Select(elem.GetTreePath(), first, true);
15495
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1544915496 }
1545015497
1545115498 first = false;
....@@ -15456,21 +15503,21 @@
1545615503 {
1545715504 //Composite group = (Composite) object;
1545815505 Object3D group = object;
15459
- group.editWindow.loadClipboard(true); // ClearSelection(false);
15506
+ group.GetWindow().loadClipboard(true); // ClearSelection(false);
1546015507 }
1546115508
1546215509 void ResetTransform(int mask)
1546315510 {
1546415511 //Composite group = (Composite) object;
1546515512 Object3D group = object;
15466
- group.editWindow.ResetTransform(mask);
15513
+ group.GetWindow().ResetTransform(mask);
1546715514 }
1546815515
1546915516 void FlipTransform()
1547015517 {
1547115518 //Composite group = (Composite) object;
1547215519 Object3D group = object;
15473
- group.editWindow.FlipTransform();
15520
+ group.GetWindow().FlipTransform();
1547415521 // group.editWindow.ReduceMesh(true);
1547515522 }
1547615523
....@@ -15478,7 +15525,7 @@
1547815525 {
1547915526 //Composite group = (Composite) object;
1548015527 Object3D group = object;
15481
- group.editWindow.PrintMemory();
15528
+ group.GetWindow().PrintMemory();
1548215529 // group.editWindow.ReduceMesh(true);
1548315530 }
1548415531
....@@ -15486,7 +15533,7 @@
1548615533 {
1548715534 //Composite group = (Composite) object;
1548815535 Object3D group = object;
15489
- group.editWindow.ResetCentroid();
15536
+ group.GetWindow().ResetCentroid();
1549015537 }
1549115538
1549215539 void IncDepth()
....@@ -15671,23 +15718,42 @@
1567115718 */
1567215719 if (!isRenderer)
1567315720 {
15674
- object.drawEditHandles(info, 0);
15675
-
15676
- if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15721
+ if (object.selection.Size() > 0)
1567715722 {
15678
- switch (object.selection.get(0).hitSomething)
15723
+ int hitSomething = object.selection.get(0).hitSomething;
15724
+
15725
+ info.DX = 0;
15726
+ info.DY = 0;
15727
+ info.W = 1;
15728
+ if (hitSomething == Object3D.hitCenter)
1567915729 {
15680
- case Object3D.hitCenter: gr.setColor(Color.pink);
15681
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15682
- break;
15683
- case Object3D.hitRotate: gr.setColor(Color.yellow);
15684
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15685
- break;
15686
- case Object3D.hitScale: gr.setColor(Color.cyan);
15687
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15688
- break;
15730
+ info.DX = X;
15731
+ if (X != 0)
15732
+ info.DX -= info.bounds.width/2;
15733
+
15734
+ info.DY = Y;
15735
+ if (Y != 0)
15736
+ info.DY -= info.bounds.height/2;
1568915737 }
15690
-
15738
+
15739
+ object.drawEditHandles(info, 0);
15740
+
15741
+ if (drag && (X != 0 || Y != 0))
15742
+ {
15743
+ switch (hitSomething)
15744
+ {
15745
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15746
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15747
+ break;
15748
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15749
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15750
+ break;
15751
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15752
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15753
+ break;
15754
+ }
15755
+
15756
+ }
1569115757 }
1569215758 }
1569315759 }
....@@ -16678,7 +16744,7 @@
1667816744 }
1667916745
1668016746 if (!movingcamera && !PAINTMODE)
16681
- object.editWindow.ScreenFitPoint(); // fev 2014
16747
+ object.GetWindow().ScreenFitPoint(); // fev 2014
1668216748
1668316749 if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1668416750 {
....@@ -16690,17 +16756,17 @@
1669016756
1669116757 group.add(paintobj); // link
1669216758
16693
- object.editWindow.SnapObject(group);
16759
+ object.GetWindow().SnapObject(group);
1669416760
16695
- Object3D folder = object.editWindow.copy;
16761
+ Object3D folder = object.GetWindow().copy;
1669616762
16697
- if (object.editWindow.copy.selection.Size() > 0)
16698
- folder = object.editWindow.copy.selection.elementAt(0);
16763
+ if (object.GetWindow().copy.selection.Size() > 0)
16764
+ folder = object.GetWindow().copy.selection.elementAt(0);
1669916765
1670016766 folder.add(group);
1670116767
16702
- object.editWindow.ResetModel();
16703
- object.editWindow.refreshContents();
16768
+ object.GetWindow().ResetModel();
16769
+ object.GetWindow().refreshContents();
1670416770 }
1670516771 else
1670616772 paintcount = 0;
....@@ -16739,6 +16805,11 @@
1673916805 //System.out.println("objects[color] = " + objects[color]);
1674016806 //objects[color].Select();
1674116807 indexcount = 0;
16808
+ ObjEditor window = object.GetWindow();
16809
+ if (window != null && deselect)
16810
+ {
16811
+ window.Select(null, deselect, true);
16812
+ }
1674216813 object.Select(color, deselect);
1674316814 }
1674416815