Divooka Reference

Material Export

6 nodes

On this page 6

Export Blender

Function

Writes the material for Blender: its maps, each in its own file named so Node Wrangler finds them, and a Python script that builds it as a Principled BSDF whose height drives real displacement, with a finely divided plane wearing it if asked. Open the script in Blender's Scripting workspace and run it, or run blender --python on it.

Signature
ExportBlender -> Text
    material: PBR Material
    folder: Text
    previewPlane: Truth
    textureSize: Integer
string ExportBlender(
    PbrMaterial material,
    string folder,
    bool previewPlane = true,
    int textureSize = 0)

Parameters

nametypedefaultdescription
materialPBR Material—The material.
folderText—The folder to write the script and its maps into.
previewPlaneTruthTrueWhether the script also adds a plane wearing the material.
textureSizeInteger0The maps' size in pixels; 0 keeps the material's.

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Material Export
Package
Image Processing

Export Glb

Function

Writes the material on a sample shape as one GLB file, its maps embedded, with the height turned into real geometry if asked. Opens in Blender, three.js, Unity, Unreal, Godot and every glTF viewer.

Signature
ExportGlb -> Text
    material: PBR Material
    path: Text
    shape: PreviewShape
    displaceGeometry: Truth
    textureSize: Integer
string ExportGlb(
    PbrMaterial material,
    string path,
    PreviewShape shape = PreviewShape.Plane,
    bool displaceGeometry = false,
    int textureSize = 0)

Parameters

nametypedefaultdescription
materialPBR Material—The material.
pathText—The file to write, ending .glb.
shapePreviewShapePlaneThe shape it is shown on.
displaceGeometryTruthFalseWhether the height moves the shape's surface in the file, rather than only shading it.
textureSizeInteger0The maps' size in pixels; 0 keeps the material's.

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Material Export
Package
Image Processing

Export Material X

Function

Writes the material as a MaterialX document - an OpenPBR surface reading the material's maps, with displacement from its height - for Houdini, Maya, Arnold, USD and any renderer reading MaterialX 1.39.

Signature
ExportMaterialX -> Text
    material: PBR Material
    folder: Text
    textureSize: Integer
string ExportMaterialX(
    PbrMaterial material,
    string folder,
    int textureSize = 0)

Parameters

nametypedefaultdescription
materialPBR Material—The material.
folderText—The folder to write the document and its maps into.
textureSizeInteger0The maps' size in pixels; 0 keeps the material's.

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Material Export
Package
Image Processing

Export Mesh Glb

Function

Writes a model with its material as one GLB file: for a model textured with a layer stack or a triplanar projection, whose maps are in its own texture coordinates.

Signature
ExportMeshGlb -> Text
    mesh: MaterialMesh
    material: PBR Material
    path: Text
    textureSize: Integer
string ExportMeshGlb(
    MaterialMesh mesh,
    PbrMaterial material,
    string path,
    int textureSize = 0)

Parameters

nametypedefaultdescription
meshMaterialMesh—The model.
materialPBR Material—The material.
pathText—The file to write, ending .glb.
textureSizeInteger0The maps' size in pixels; 0 keeps the material's.

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Material Export
Package
Image Processing

Export Texture Set

Function

Writes the material's maps as image files named and packed for an engine: glTF and Godot pack occlusion, roughness and metallic into one image; Unreal does too with DirectX normals; Unity's pipelines have their own mask maps. Height is written as a 16-bit image so it keeps its precision.

Signature
ExportTextureSet -> Text Array
    material: PBR Material
    folder: Text
    preset: Texture Set Preset
    textureSize: Integer
string[] ExportTextureSet(
    PbrMaterial material,
    string folder,
    TextureSetPreset preset = TextureSetPreset.Gltf,
    int textureSize = 0)

Parameters

nametypedefaultdescription
materialPBR Material—The material.
folderText—The folder to write into.
presetTexture Set PresetGltfThe engine.
textureSizeInteger0The maps' size in pixels; 0 keeps the material's.

Returns

resultText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Material Export
Package
Image Processing

Export Usd

Function

Writes the material as a USD stage: a UsdPreviewSurface reading its maps, its height as displacement in metres, on a sample shape. Opens in Blender, Houdini, Omniverse, usdview and any USD tool; a renderer that displaces shows the relief.

Signature
ExportUsd -> Text
    material: PBR Material
    folder: Text
    shape: PreviewShape
    textureSize: Integer
string ExportUsd(
    PbrMaterial material,
    string folder,
    PreviewShape shape = PreviewShape.Plane,
    int textureSize = 0)

Parameters

nametypedefaultdescription
materialPBR Material—The material.
folderText—The folder to write the stage and its maps into.
shapePreviewShapePlaneThe shape it is shown on.
textureSizeInteger0The maps' size in pixels; 0 keeps the material's.

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Material Export
Package
Image Processing