RenderAnimation task

This task call the Blender command line in order to render an animation.

task renderAnimation(type: com.eowise.blender.render.RenderAnimation) {
    scene 'HeroRun'
    from '3d/actors.blend'
    into 'assets/actors/'
    start 1
    end 100
}

Methods

scene(String sceneName)
required

Set the scene you want to render.

from(Object file)
required

Set the .blend file that contains the scene you want to render. The given file is evaluated as per Gradle Project.file().

into(Object path)
required

Set the path where the rendered animation files will be writen. Just like the from method, the given path is evaluated as per Gradle Project.file().

The rendered images files names will be compound of the scene name and the frame number using 4 padded zeros. For instance HeroRun-0001.png to HeroRun-0100.png.

If you want to customize the names of output files, see the rename method below.

start(int value)
required

Set the start frame.

end(int value)
required

Set the end frame.

rename(Closure c)

Set the closure that will be used to compute each rendered frame file name. The closure take as a parameter the frame file name as described in the into method above.

See an example of a RenderAnimation task with a rename closure.

Use cases

Rename output files

task renderAnimation(type: com.eowise.blender.render.RenderAnimation) {
    scene 'HeroRun'
    from '3d/actors.blend'
    into 'assets/actors/'
    start 1
    end 100
    rename { 
        filename ->
            (filename =~ /[\w ]+-(\d{4})\.png/).group(1) + '.png'
    }
}

Batch render multiple animations

Work in progress