Introduction

Blender is often used to create applications or games assets. But when the number of these assets grows, we need to improve and automate these tasks.

This project rely on the Gradle build automation system to make asset creation from Blender easier. It allows to automate the following tasks:

Install

To enable the gradle-blender Gradle tasks, please add one of the following snippets to your build.gradle file:

plugins {
    id 'com.eowise.blender' version '0.5.1'
}
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.eowise:blender:0.5.1'
    }
}

Getting started

This project is compound of three Gradle tasks classes. Depending of your need described below, create a task of the corresponding type.

Task Description
RenderImage Render a Blender scene to an image file.
RenderAnimation Render a Blender animation to images files.
FbxConv Convert FBX files to G3DJ or G3DB formats.

The links in the table above point to the corresponding task reference. There is also a simple example for each task below:

task renderImage(type: com.eowise.blender.render.RenderImage) {
    scene 'Hero'
    from '3d/actors.blend'
    into 'assets/actors/hero.png'
}
task renderAnimation(type: com.eowise.blender.render.RenderAnimation) {
    scene 'HeroRun'
    from '3d/actors.blend'
    into 'assets/actors/'
    start 1
    end 100
}
task convertFbx(type: com.eowise.blender.fbxconv.FbxConv) {
    from 'resources'
    include '*.fbx'
    into 'assets/3d'
    g3db()
}