Normand Briere
2019-05-01 20c1a07b76c39462594aedfedfe6e6adb17cd552
Fix animation and fast mode.
6 files modified
51 ■■■■ changed files
CameraPane.java 18 ●●●●● patch | view | raw | blame | history
GroupEditor.java 22 ●●●●● patch | view | raw | blame | history
Mocap.java 5 ●●●●● patch | view | raw | blame | history
ObjEditor.java 2 ●●● patch | view | raw | blame | history
ParticleNode.java 2 ●●●●● patch | view | raw | blame | history
Wav.java 2 ●●● patch | view | raw | blame | history
CameraPane.java
....@@ -56,8 +56,6 @@
5656 static int CURRENTANTIALIAS = 0; // 1;
5757 /*static*/ boolean RENDERSHADOW = true;
5858 /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal
59
- static boolean ANIMATION = false;
60
- static String filename;
6159
6260 boolean DISPLAYTEXT = false;
6361 //boolean REDUCETEXTURE = true;
....@@ -86,7 +84,7 @@
8684 static boolean FULLSCREEN = false;
8785 static boolean SUPPORT = true;
8886 static boolean INERTIA = true;
89
-static boolean FAST = true; // false;
87
+static boolean FAST = false;
9088 static boolean SLOWPOSE = false;
9189 static boolean FOOTCONTACT = true;
9290
....@@ -9395,7 +9393,7 @@
93959393 //gl.glFlush();
93969394 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
93979395
9398
- if (ANIMATION && ABORTED)
9396
+ if (Globals.ANIMATION && ABORTED)
93999397 {
94009398 System.err.println(" ABORTED FRAME");
94019399 break;
....@@ -9425,7 +9423,7 @@
94259423 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
94269424
94279425 // save image
9428
- if (ANIMATION && !ABORTED)
9426
+ if (Globals.ANIMATION && !ABORTED)
94299427 {
94309428 VPwidth = viewport[2];
94319429 VPheight = viewport[3];
....@@ -9536,7 +9534,7 @@
95369534
95379535 // imagecount++;
95389536
9539
- String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
9537
+ String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
95409538
95419539 if (!BOXMODE)
95429540 {
....@@ -11260,8 +11258,14 @@
1126011258 {
1126111259 renderpass++;
1126211260 // System.out.println("Draw object... ");
11261
+ STEP = 1;
1126311262 if (FAST) // in case there is no script
11264
- STEP = 16;
11263
+ STEP = 8;
11264
+
11265
+ if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
11266
+ {
11267
+ STEP *= 4;
11268
+ }
1126511269
1126611270 //object.FullInvariants();
1126711271
GroupEditor.java
....@@ -440,6 +440,10 @@
440440 liveCB.setToolTipText("Enabled animation");
441441 liveCB.addItemListener(this);
442442
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
445
+ fastCB.addItemListener(this);
446
+
443447 oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444448 trackCB.setToolTipText("Enable tracking");
445449 trackCB.addItemListener(this);
....@@ -587,39 +591,29 @@
587591
588592 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589593 {
590
- //constraints.gridx = 0;
591
- //constraints.gridy = 0;
592
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
- fastCB.setToolTipText("Fast mode");
594
- fastCB.addItemListener(this);
595
- //constraints.gridy += 1;
596594 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597595 supportCB.setToolTipText("Enabled rigging");
598596 supportCB.addItemListener(this);
599597
600
- // constraints.gridy += 1;
601598 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602599 // localCB.addItemListener(this);
603600
604
- //constraints.gridy += 1;
605601 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606602 crowdCB.setToolTipText("Used for crowds");
607603 crowdCB.addItemListener(this);
608604
609
- //constraints.gridy += 1;
610605 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611606 smoothCB.setToolTipText("Snapping delay");
612607 smoothCB.addItemListener(this);
613608
614
- //constraints.gridy += 1;
615609 panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616610 slowCB.setToolTipText("Smooth interpolation");
617611 slowCB.addItemListener(this);
618
- //constraints.gridy += 1;
612
+
619613 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620614 boxCB.setToolTipText("Display bounding boxes");
621615 boxCB.addItemListener(this);
622
- //constraints.gridy += 1;
616
+
623617 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624618 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625619 zoomBoxCB.addItemListener(this);
....@@ -648,11 +642,9 @@
648642 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649643 // debugCB.addItemListener(this);
650644
651
- //constraints.gridy += 1;
652645 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653646 oeilCB.addItemListener(this);
654647
655
- //constraints.gridy += 1;
656648 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657649 lookAtCB.setToolTipText("Look-at target");
658650 lookAtCB.addItemListener(this);
....@@ -1110,7 +1102,7 @@
11101102 {
11111103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11121104 animationItem.addItemListener(this);
1113
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
11141106
11151107 menu.add("-");
11161108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
Mocap.java
....@@ -2267,7 +2267,7 @@
22672267 }
22682268
22692269 if (!smoothed)
2270
- for (int i=1; --i>=0;)
2270
+ for (int i=10; --i>=0;)
22712271 SmoothAnimData(); // much reduces shakiness
22722272
22732273 smoothed = true;
....@@ -3252,12 +3252,13 @@
32523252
32533253 int step = 1;
32543254
3255
+ // patch for running hare
32553256 if (speedup) // fev 2014
32563257 step *= 2; // 4;
32573258 if (rewind) // mars 2014
32583259 step *= 4;
32593260
3260
- if (CameraPane.FAST) // && !CameraPane.HOLD)
3261
+ //if (CameraPane.FAST) // && !CameraPane.HOLD)
32613262 step *= CameraPane.STEP;
32623263
32633264 //System.err.println("Step Mocap frame # " + frame);
ObjEditor.java
....@@ -3205,7 +3205,7 @@
32053205 if (!Globals.ANIMATION)
32063206 {
32073207 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3208
- browser.show();
3208
+ browser.setVisible(true);
32093209 String filename = browser.getFile();
32103210 if (filename != null && filename.length() > 0)
32113211 {
ParticleNode.java
....@@ -327,7 +327,9 @@
327327
328328 int step = 1;
329329 if (CameraPane.FAST)
330
+ {
330331 step *= CameraPane.STEP;
332
+ }
331333
332334 getParticleController().update(step);
333335 for (int i = 0; i < particles.length; i++)
Wav.java
....@@ -220,7 +220,7 @@
220220 // write out the wav file
221221 public Wav save()
222222 {
223
- if (loop == 0 || !CameraPane.ANIMATION)
223
+ if (loop == 0 || !Globals.ANIMATION)
224224 return this;
225225
226226 Object[] options = {"Yes",