Search in sources :

Example 1 with EditPlane

use of org.jwildfire.create.tina.base.EditPlane in project JWildfire by thargor6.

the class PostRotateMotionValueChangeHandler method processValueChange.

@Override
public void processValueChange(Object pTarget, String pPropertyName, double pValue) {
    EditPlane editPlane = getCurrEditPlane(pTarget);
    try {
        setEditPlaneByPropertyName(pTarget, pPropertyName);
        XFormTransformService.rotate((XForm) pTarget, pValue, true);
    } finally {
        setEditPlane(pTarget, editPlane);
    }
}
Also used : EditPlane(org.jwildfire.create.tina.base.EditPlane)

Example 2 with EditPlane

use of org.jwildfire.create.tina.base.EditPlane in project JWildfire by thargor6.

the class RotateMotionValueChangeHandler method processValueChange.

@Override
public void processValueChange(Object pTarget, String pPropertyName, double pValue) {
    EditPlane editPlane = getCurrEditPlane(pTarget);
    try {
        setEditPlaneByPropertyName(pTarget, pPropertyName);
        XFormTransformService.rotate((XForm) pTarget, pValue, false);
    } finally {
        setEditPlane(pTarget, editPlane);
    }
}
Also used : EditPlane(org.jwildfire.create.tina.base.EditPlane)

Example 3 with EditPlane

use of org.jwildfire.create.tina.base.EditPlane in project JWildfire by thargor6.

the class ScaleMotionValueChangeHandler method processValueChange.

@Override
public void processValueChange(Object pTarget, String pPropertyName, double pValue) {
    EditPlane editPlane = getCurrEditPlane(pTarget);
    try {
        setEditPlaneByPropertyName(pTarget, pPropertyName);
        XFormTransformService.scale((XForm) pTarget, pValue, true, true, false);
    } finally {
        setEditPlane(pTarget, editPlane);
    }
}
Also used : EditPlane(org.jwildfire.create.tina.base.EditPlane)

Example 4 with EditPlane

use of org.jwildfire.create.tina.base.EditPlane in project JWildfire by thargor6.

the class TinaController method refreshXFormUI.

private void refreshXFormUI(XForm pXForm) {
    boolean oldRefreshing = refreshing;
    boolean oldGridRefreshing = gridRefreshing;
    boolean oldCmbRefreshing = cmbRefreshing;
    boolean oldNoRefresh = noRefresh;
    gridRefreshing = cmbRefreshing = refreshing = noRefresh = true;
    try {
        EditPlane curEditPlane = getCurrFlame().getEditPlane();
        refreshEditPlaneToggleButtons(curEditPlane);
        if (pXForm != null) {
            switch(curEditPlane) {
                case XY:
                    data.affineC00Lbl.setText("X1");
                    data.affineC01Lbl.setText("X2");
                    data.affineC10Lbl.setText("Y1");
                    data.affineC11Lbl.setText("Y2");
                    break;
                case YZ:
                    data.affineC00Lbl.setText("Y1");
                    data.affineC01Lbl.setText("Y2");
                    data.affineC10Lbl.setText("Z1");
                    data.affineC11Lbl.setText("Z2");
                    break;
                default:
                    data.affineC00Lbl.setText("X1");
                    data.affineC01Lbl.setText("X2");
                    data.affineC10Lbl.setText("Z1");
                    data.affineC11Lbl.setText("Z2");
                    break;
            }
            if (data.affineEditPostTransformButton.isSelected()) {
                data.affineC00REd.setText(Tools.doubleToString(pXForm.getPostCoeff00()));
                data.affineC01REd.setText(Tools.doubleToString(pXForm.getPostCoeff01()));
                data.affineC10REd.setText(Tools.doubleToString(pXForm.getPostCoeff10()));
                data.affineC11REd.setText(Tools.doubleToString(pXForm.getPostCoeff11()));
                data.affineC20REd.setText(Tools.doubleToString(pXForm.getPostCoeff20()));
                data.affineC21REd.setText(Tools.doubleToString(pXForm.getPostCoeff21()));
            } else {
                data.affineC00REd.setText(Tools.doubleToString(pXForm.getCoeff00()));
                data.affineC01REd.setText(Tools.doubleToString(pXForm.getCoeff01()));
                data.affineC10REd.setText(Tools.doubleToString(pXForm.getCoeff10()));
                data.affineC11REd.setText(Tools.doubleToString(pXForm.getCoeff11()));
                data.affineC20REd.setText(Tools.doubleToString(pXForm.getCoeff20()));
                data.affineC21REd.setText(Tools.doubleToString(pXForm.getCoeff21()));
            }
            if (data.affineMirrorPrePostTranslationsButton != null) {
                data.affineMirrorPrePostTranslationsButton.setSelected(pXForm.getMirrorTranslations());
            }
            data.xFormColorREd.setText(Tools.doubleToString(pXForm.getColor()));
            data.xFormColorSlider.setValue(Tools.FTOI(pXForm.getColor() * SLIDER_SCALE_COLOR));
            data.xFormSymmetryREd.setText(Tools.doubleToString(pXForm.getColorSymmetry()));
            data.xFormSymmetrySlider.setValue(Tools.FTOI(pXForm.getColorSymmetry() * SLIDER_SCALE_COLOR));
            data.xFormMaterialREd.setText(Tools.doubleToString(pXForm.getMaterial()));
            data.xFormMaterialSlider.setValue(Tools.FTOI(pXForm.getMaterial() * SLIDER_SCALE_COLOR));
            data.xFormMaterialSpeedREd.setText(Tools.doubleToString(pXForm.getMaterialSpeed()));
            data.xFormMaterialSpeedSlider.setValue(Tools.FTOI(pXForm.getMaterialSpeed() * SLIDER_SCALE_COLOR));
            data.xFormModGammaREd.setText(Tools.doubleToString(pXForm.getModGamma()));
            data.xFormModGammaSlider.setValue(Tools.FTOI(pXForm.getModGamma() * SLIDER_SCALE_COLOR));
            data.xFormModGammaSpeedREd.setText(Tools.doubleToString(pXForm.getModGammaSpeed()));
            data.xFormModGammaSpeedSlider.setValue(Tools.FTOI(pXForm.getModGammaSpeed() * SLIDER_SCALE_COLOR));
            data.xFormModContrastREd.setText(Tools.doubleToString(pXForm.getModContrast()));
            data.xFormModContrastSlider.setValue(Tools.FTOI(pXForm.getModContrast() * SLIDER_SCALE_COLOR));
            data.xFormModContrastSpeedREd.setText(Tools.doubleToString(pXForm.getModContrastSpeed()));
            data.xFormModContrastSpeedSlider.setValue(Tools.FTOI(pXForm.getModContrastSpeed() * SLIDER_SCALE_COLOR));
            data.xFormModSaturationREd.setText(Tools.doubleToString(pXForm.getModSaturation()));
            data.xFormModSaturationSlider.setValue(Tools.FTOI(pXForm.getModSaturation() * SLIDER_SCALE_COLOR));
            data.xFormModSaturationSpeedREd.setText(Tools.doubleToString(pXForm.getModSaturationSpeed()));
            data.xFormModSaturationSpeedSlider.setValue(Tools.FTOI(pXForm.getModSaturationSpeed() * SLIDER_SCALE_COLOR));
            data.xFormModHueREd.setText(Tools.doubleToString(pXForm.getModHue()));
            data.xFormModHueSlider.setValue(Tools.FTOI(pXForm.getModHue() * SLIDER_SCALE_COLOR));
            data.xFormModHueSpeedREd.setText(Tools.doubleToString(pXForm.getModHueSpeed()));
            data.xFormModHueSpeedSlider.setValue(Tools.FTOI(pXForm.getModHueSpeed() * SLIDER_SCALE_COLOR));
            data.xFormOpacityREd.setText(Tools.doubleToString(pXForm.getOpacity()));
            data.xFormOpacitySlider.setValue(Tools.FTOI(pXForm.getOpacity() * SLIDER_SCALE_COLOR));
            data.xFormDrawModeCmb.setSelectedItem(pXForm.getDrawMode());
            data.transformationWeightREd.setText(Tools.doubleToString(pXForm.getWeight()));
        } else {
            data.affineC00REd.setText(null);
            data.affineC01REd.setText(null);
            data.affineC10REd.setText(null);
            data.affineC11REd.setText(null);
            data.affineC20REd.setText(null);
            data.affineC21REd.setText(null);
            data.xFormColorREd.setText(null);
            data.xFormColorSlider.setValue(0);
            data.xFormSymmetryREd.setText(null);
            data.xFormSymmetrySlider.setValue(0);
            data.xFormMaterialREd.setText(null);
            data.xFormMaterialSlider.setValue(0);
            data.xFormMaterialSpeedREd.setText(null);
            data.xFormMaterialSpeedSlider.setValue(0);
            data.xFormModGammaREd.setText(null);
            data.xFormModGammaSlider.setValue(0);
            data.xFormModGammaSpeedREd.setText(null);
            data.xFormModGammaSpeedSlider.setValue(0);
            data.xFormModContrastREd.setText(null);
            data.xFormModContrastSlider.setValue(0);
            data.xFormModContrastSpeedREd.setText(null);
            data.xFormModContrastSpeedSlider.setValue(0);
            data.xFormModSaturationREd.setText(null);
            data.xFormModSaturationSlider.setValue(0);
            data.xFormModSaturationSpeedREd.setText(null);
            data.xFormModSaturationSpeedSlider.setValue(0);
            data.xFormModHueREd.setText(null);
            data.xFormModHueSlider.setValue(0);
            data.xFormModHueSpeedREd.setText(null);
            data.xFormModHueSpeedSlider.setValue(0);
            data.xFormOpacityREd.setText(null);
            data.xFormOpacitySlider.setValue(0);
            data.transformationWeightREd.setText(null);
            data.xFormDrawModeCmb.setSelectedIndex(-1);
        }
        {
            int idx = 0;
            for (TinaNonlinearControlsRow row : data.TinaNonlinearControlsRows) {
                if (pXForm == null || idx >= pXForm.getVariationCount()) {
                    refreshParamControls(row, null, null, true);
                } else {
                    Variation var = pXForm.getVariation(idx);
                    refreshParamControls(row, pXForm, var, true);
                }
                idx++;
            }
        }
        refreshRelWeightsTable();
    } finally {
        gridRefreshing = oldGridRefreshing;
        refreshing = oldRefreshing;
        cmbRefreshing = oldCmbRefreshing;
        noRefresh = oldNoRefresh;
    }
}
Also used : EditPlane(org.jwildfire.create.tina.base.EditPlane) Variation(org.jwildfire.create.tina.variation.Variation)

Example 5 with EditPlane

use of org.jwildfire.create.tina.base.EditPlane in project JWildfire by thargor6.

the class PostScaleMotionValueChangeHandler method processValueChange.

@Override
public void processValueChange(Object pTarget, String pPropertyName, double pValue) {
    EditPlane editPlane = getCurrEditPlane(pTarget);
    try {
        setEditPlaneByPropertyName(pTarget, pPropertyName);
        XFormTransformService.scale((XForm) pTarget, pValue, true, true, true);
    } finally {
        setEditPlane(pTarget, editPlane);
    }
}
Also used : EditPlane(org.jwildfire.create.tina.base.EditPlane)

Aggregations

EditPlane (org.jwildfire.create.tina.base.EditPlane)6 Flame (org.jwildfire.create.tina.base.Flame)1 Variation (org.jwildfire.create.tina.variation.Variation)1