use of org.jwildfire.create.tina.base.motion.MotionCurve in project JWildfire by thargor6.
the class TinaController method nonlinearParamsEditMotionCurve.
public void nonlinearParamsEditMotionCurve(int pIdx) {
String propertyname = (String) data.TinaNonlinearControlsRows[pIdx].getNonlinearParamsCmb().getSelectedItem();
XForm xForm = getCurrXForm();
if (xForm != null && propertyname != null && propertyname.length() > 0) {
if (pIdx < xForm.getVariationCount()) {
Variation var = xForm.getVariation(pIdx);
if (var.getFunc().getParameterIndex(propertyname) >= 0) {
double initialValue;
try {
String valStr = data.TinaNonlinearControlsRows[pIdx].getNonlinearParamsREd().getText();
if (valStr == null || valStr.length() == 0) {
valStr = "0";
}
initialValue = Double.parseDouble(valStr);
} catch (Exception ex) {
initialValue = 0.0;
}
MotionCurve curve = var.getMotionCurve(propertyname);
if (curve == null) {
curve = var.createMotionCurve(propertyname);
}
variationControlsDelegates[pIdx].editMotionCurve(curve, initialValue, propertyname, "variation property \"" + propertyname + "\"");
// Doesnt work after changing parameter -> now enable it always
// variationControlsDelegates[pIdx].enableControl(data.TinaNonlinearControlsRows[pIdx].getNonlinearParamsREd(), curve, false);
refreshFlameImage(true, false, 1, true, false);
}
}
}
}
Aggregations