AssetDefinition

public class AssetDefinition

Defines a single Sceneform asset, including the model source file, the material to embed, the asset definition file (sfa), and the asset bundle file (sfb).

Instances of this class are placed inside of the SceneformAssets instance in a gradle build.

Each asset definition generates two tasks, a createAsset task and a compileAsset task, using the task suffix to distinguish asset builds from one another. The createAsset task generates the .sfa file when it does not exist, and the compileAsset task, depends on the createAsset task, and generates the .sfb file when any of the .sfb file's inputs have changed.

All paths are relative to the gradle build in which this definition resides.

Public Constructors

Public Methods

void
materialPath(String materialPath)
Sets the input material.
void
modelPath(String modelPath)
Sets the path to the input .obj, .fbx, or .gltf file.
void
sfaPath(String sfaPath)
Sets the path to the .sfa defining the details of how this asset will be built.
void
sfbPath(String sfbPath)
Sets the path where the asset build will place the .sfb output file.

Inherited Methods

Public Constructors

public AssetDefinition ()

Public Methods

public void materialPath (String materialPath)

Sets the input material.

Parameters
materialPath Only accepted value: 'default'.

public void modelPath (String modelPath)

Sets the path to the input .obj, .fbx, or .gltf file.

Parameters
modelPath The relative path to the model file.

public void sfaPath (String sfaPath)

Sets the path to the .sfa defining the details of how this asset will be built. Note that when the .sfa does not exist, building this asset results in a default .sfa file being generated. When the .sfa does exist it is used as input, defining the parameters used to build the .sfb.

Parameters
sfaPath The relative path to the .sfa file.

public void sfbPath (String sfbPath)

Sets the path where the asset build will place the .sfb output file.

Parameters
sfbPath The relative path where the .sfb file should be placed.

Send feedback about...