Open omega09 opened 7 years ago
A fix would be to add this type of interpolator to the method:
// ...
} else if (interpolator instanceof NumberTangentInterpolator) {
NumberTangentInterpolator ti = (NumberTangentInterpolator)interpolator;
return "Interpolator.TANGENT(Duration.millis("+ TickCalculation.toMillis((long)ti.getInTicks())+"d),"+ti.getInValue()
+"d,Duration.millis("+TickCalculation.toMillis((long)ti.getInTicks())+"d),"+ti.getOutValue()+"d)";
} else if (interpolator instanceof com.sun.scenario.animation.NumberTangentInterpolator) {
com.sun.scenario.animation.NumberTangentInterpolator ti = (com.sun.scenario.animation.NumberTangentInterpolator)interpolator;
return "Interpolator.TANGENT(Duration.millis("+ TickCalculation.toMillis((long)ti.getInTicks())+"d),"+ti.getInValue()
+"d,Duration.millis("+TickCalculation.toMillis((long)ti.getInTicks())+"d),"+ti.getOutValue()+"d)";
} else {
throw new UnsupportedOperationException("Unknown Interpolator type: "+interpolator.getClass());
}
In the 3DViewer sample, exporting a .ma model as .java fails due to a bad cast attempt.
In the file
JavaSourceExporter
, in the methodprivate String toString(Interpolator interpolator)
, there is a checkif (interpolator instanceof NumberTangentInterpolator)
. However, the right side of the instanceof iscom.javafx.experiments.utils3d.animation.NumberTangentInterpolator
. The argument for the method iscom.sun.scenario.animation.NumberTangentInterpolator
. This causes the method to throw anUnsupportedOperationException
even though the code for the classes is the same.