Search in sources :

Example 1 with FlameMovie

use of org.jwildfire.create.tina.animate.FlameMovie in project JWildfire by thargor6.

the class AllRandomMovieGenerator method prepareMovie.

@Override
protected FlameMovie prepareMovie(Prefs pPrefs) {
    RandomMovieGenerator generator = createRandGen();
    FlameMovie movie = generator.createMovie(pPrefs);
    movie.setName(generator.getName() + " - " + movie.hashCode());
    return movie;
}
Also used : FlameMovie(org.jwildfire.create.tina.animate.FlameMovie)

Example 2 with FlameMovie

use of org.jwildfire.create.tina.animate.FlameMovie in project JWildfire by thargor6.

the class RotatingMandelbrotRandomMovieGenerator method prepareMovie.

@Override
protected FlameMovie prepareMovie(Prefs pPrefs) {
    FlameMovie movie = new FlameMovie(pPrefs);
    Flame flame = genRandomFlame(new MandelbrotRandomFlameGenerator(), pPrefs);
    flame.setCamPerspective(0.1 + 0.2 * Math.random());
    if (Math.random() < 0.5) {
        flame.setCamDOF(0.05 + 0.1 * Math.random());
    }
    FlameMoviePart part = new FlameMoviePart();
    part.setFlame(flame);
    part.setFrameCount(320);
    part.setFrameMorphCount(0);
    movie.addPart(part);
    {
        double amplitude = -0.75 * Math.random() * 1.5;
        movie.getGlobalScripts()[0] = (new GlobalScript(GlobalScriptType.ROTATE_YAW, amplitude));
    }
    {
        double amplitude = -0.25 * Math.random() * 0.5;
        movie.getGlobalScripts()[1] = new GlobalScript(GlobalScriptType.ROTATE_ROLL, amplitude);
    }
    {
        double amplitude = -0.125 * Math.random() * 0.25;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.ROTATE_PITCH, amplitude);
    }
    {
        double amplitude = 0.2 + Math.random() * 0.6;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.MOVE_CAM_Z, amplitude);
    }
    {
        double amplitude = 0.2 + Math.random() * 1.4;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.MOVE_CAM_Y, amplitude);
    }
    return movie;
}
Also used : GlobalScript(org.jwildfire.create.tina.animate.GlobalScript) FlameMovie(org.jwildfire.create.tina.animate.FlameMovie) FlameMoviePart(org.jwildfire.create.tina.animate.FlameMoviePart) Flame(org.jwildfire.create.tina.base.Flame) MandelbrotRandomFlameGenerator(org.jwildfire.create.tina.randomflame.MandelbrotRandomFlameGenerator)

Example 3 with FlameMovie

use of org.jwildfire.create.tina.animate.FlameMovie in project JWildfire by thargor6.

the class TransformingDuckiesRandomMovieGenerator method prepareMovie.

@Override
protected FlameMovie prepareMovie(Prefs pPrefs) {
    FlameMovie movie = new FlameMovie(pPrefs);
    Flame flame = genRandomFlame(new DuckiesRandomFlameGenerator(), pPrefs);
    FlameMoviePart part = new FlameMoviePart();
    part.setFlame(flame);
    part.setFrameCount(320);
    part.setFrameMorphCount(0);
    movie.addPart(part);
    {
        double amplitude = -1.25 * Math.random() * 2.5;
        movie.getGlobalScripts()[0] = new GlobalScript(GlobalScriptType.ROTATE_ROLL, amplitude);
    }
    {
        double amplitude = Math.random() * 2.0 + 0.2;
        movie.getGlobalScripts()[1] = new GlobalScript(GlobalScriptType.MOVE_CAM_X, amplitude);
    }
    if (Math.random() < 0.5) {
        double amplitude = Math.random() * 0.25;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.MOVE_CAM_Z, amplitude);
    }
    {
        double amplitude = -0.5 * Math.random() * 1.0;
        movie.getxFormScripts()[0] = new XFormScript(XFormScriptType.ROTATE_2ND_XFORM, amplitude);
    }
    return movie;
}
Also used : XFormScript(org.jwildfire.create.tina.animate.XFormScript) GlobalScript(org.jwildfire.create.tina.animate.GlobalScript) FlameMovie(org.jwildfire.create.tina.animate.FlameMovie) DuckiesRandomFlameGenerator(org.jwildfire.create.tina.randomflame.DuckiesRandomFlameGenerator) FlameMoviePart(org.jwildfire.create.tina.animate.FlameMoviePart) Flame(org.jwildfire.create.tina.base.Flame)

Example 4 with FlameMovie

use of org.jwildfire.create.tina.animate.FlameMovie in project JWildfire by thargor6.

the class TinaSWFAnimatorController method removeThumbnail.

protected void removeThumbnail(int pIdx) {
    try {
        int currMovieIdx = -1;
        for (int i = 0; i < randomBatch.size(); i++) {
            FlameMovie bMovie = randomBatch.get(i).getMovie();
            if (bMovie == currMovie) {
                currMovieIdx = i;
                break;
            }
        }
        if (pIdx == currMovieIdx) {
            throw new Exception("Sorry, the currently selected movie can't be deleted from the movie-ribbon");
        }
        randomBatch.remove(pIdx);
        updateThumbnails();
    } catch (Exception ex) {
        errorHandler.handleError(ex);
    }
}
Also used : FlameMovie(org.jwildfire.create.tina.animate.FlameMovie)

Example 5 with FlameMovie

use of org.jwildfire.create.tina.animate.FlameMovie in project JWildfire by thargor6.

the class TinaSWFAnimatorController method movieFromDiscButton_clicked.

public void movieFromDiscButton_clicked() {
    try {
        JFileChooser chooser = new JWFMovieFileChooser(prefs);
        if (prefs.getInputJWFMoviePath() != null) {
            try {
                chooser.setCurrentDirectory(new File(prefs.getInputJWFMoviePath()));
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
        if (chooser.showOpenDialog(swfAnimatorFlamesPanel) == JFileChooser.APPROVE_OPTION) {
            File file = chooser.getSelectedFile();
            FlameMovie movie = new FlameMovieReader(prefs).readMovie(file.getAbsolutePath());
            if (movie != null) {
                randomBatch.add(0, new MovieThumbnail(movie, null));
                currMovie = movie;
                updateThumbnails();
            }
            refreshControls();
            previewFlameImage();
        }
    } catch (Throwable ex) {
        errorHandler.handleError(ex);
    }
}
Also used : JFileChooser(javax.swing.JFileChooser) FlameMovieReader(org.jwildfire.create.tina.io.FlameMovieReader) FlameMovie(org.jwildfire.create.tina.animate.FlameMovie) File(java.io.File)

Aggregations

FlameMovie (org.jwildfire.create.tina.animate.FlameMovie)10 FlameMoviePart (org.jwildfire.create.tina.animate.FlameMoviePart)5 Flame (org.jwildfire.create.tina.base.Flame)5 GlobalScript (org.jwildfire.create.tina.animate.GlobalScript)3 FlameMovieReader (org.jwildfire.create.tina.io.FlameMovieReader)3 XFormScript (org.jwildfire.create.tina.animate.XFormScript)2 Clipboard (java.awt.datatransfer.Clipboard)1 Transferable (java.awt.datatransfer.Transferable)1 File (java.io.File)1 ImageIcon (javax.swing.ImageIcon)1 JFileChooser (javax.swing.JFileChooser)1 BubblesRandomFlameGenerator (org.jwildfire.create.tina.randomflame.BubblesRandomFlameGenerator)1 DuckiesRandomFlameGenerator (org.jwildfire.create.tina.randomflame.DuckiesRandomFlameGenerator)1 MandelbrotRandomFlameGenerator (org.jwildfire.create.tina.randomflame.MandelbrotRandomFlameGenerator)1 FlameRenderer (org.jwildfire.create.tina.render.FlameRenderer)1 RenderInfo (org.jwildfire.create.tina.render.RenderInfo)1 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)1 ImagePanel (org.jwildfire.swing.ImagePanel)1