Table of Contents

Class Material

Namespace
Material

Methods

addUniformProperty

Add a shader uniform parameter to the given custom pattern

material.addUniformProperty(pattern, name, type)

Parameters

pattern CustomMaterialPattern

The custom pattern to edit

name String

Name of the new property

type ShaderUniformType

Type of the new uniform

clearAllMaterials

Remove and delete all the materials

material.clearAllMaterials()

configureFunctionLogger

material.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)

Parameters

functionName String
enableFunction Boolean
enableParameters Boolean
enableExecutionTime Boolean

convertFloat32To8BitsImage

Returns a new image from the given converter from 32bits float to a 8Bits (e.g. depth render map)

material.convertFloat32To8BitsImage(image32F, minValue, maxValue) -> material.Image

Parameters

image32F Image

Image to convert

minValue Double

Minimal value of the floats (will be 0 in 8bits)

maxValue Double

Minimal value of the floats (will be 255 in 8bits)

Returns

Image

The new 8bits image

convertHeightMapToNormalMap

Convert a height map to a normal map

material.convertHeightMapToNormalMap(hmap, height) -> material.Image

Parameters

hmap Image

Height map reference

height Double

Maximum height

Returns

Image

Normal map

copyMaterial

copies a material

material.copyMaterial(toCopy, addToMaterialLibrary) -> material.Material

Parameters

toCopy Material

Material to copy

addToMaterialLibrary Boolean

Add to material library

Returns

Material

The copied material

createCustomMaterialPattern

Create a new custom material pattern

material.createCustomMaterialPattern(name) -> material.CustomMaterialPattern

Parameters

name String

Name of the pattern

Returns

CustomMaterialPattern

The created material pattern

createImageFromDefinition

Import an image from its raw data

material.createImageFromDefinition(imageDefinition) -> material.Image

Parameters

imageDefinition ImageDefinition

The image definition

Returns

Image

The created image

createImagesFromDefinitions

Import images from their raw data

material.createImagesFromDefinitions(imageDefinitions) -> material.ImageList

Parameters

imageDefinitions ImageDefinitionList

The image definitions

Returns

ImageList

The created images

createMaterial

Create a new material from pattern

material.createMaterial(name, pattern, addToMaterialLibrary) -> material.Material

Parameters

name String

Name of the material

pattern String

Name of the pattern

addToMaterialLibrary Boolean

Name of the pattern

Returns

Material

The created material

createMaterialFromDefinition

Create PBR material from a material definition

material.createMaterialFromDefinition(materialDefinition) -> material.Material

Parameters

materialDefinition MaterialDefinition

The structure containing all the PBR material information

Returns

Material

The created material

createMaterialsFromDefinitions

Create PBR materials from material definitions

material.createMaterialsFromDefinitions(materialDefinitions) -> material.MaterialList

Parameters

materialDefinitions MaterialDefinitionList

Material definitions containing properties for each given material

Returns

MaterialList

The created materials

createMaterialsFromMaps

Automatically creates PBR materials when importing PBR texture maps from a folder

material.createMaterialsFromMaps(directory)

Parameters

directory DirectoryPath

Directory path

exportImage

Export an image

material.exportImage(image, filename)

Parameters

image Image

Identifier of the image to export

filename OutputFilePath

Filename of the file to export

fillUnusedPixels

Fill unused pixels by propagating and averaging used pixels

material.fillUnusedPixels(image, unusedColor) -> material.Image

Parameters

image Image

Image to process

unusedColor ColorAlpha

Color used to identify unused pixels

Returns

Image

Resulting image with filled pixels

filterAO

Filter an AO map using ATrous method

material.filterAO(aoMap, normalMap, sigmaPos, sigmaValue, sigmaNormal, levelCount, filterLowValues, lowValueThreshold) -> material.Image

Parameters

aoMap Image

Input AO Map (the alpha component must be set to 0 for unused pixels)

normalMap Image

Input Normal Map (preferable to use a World space normal map, but an Object space normal map can be used)

sigmaPos Double

ATrous Sigma pos

sigmaValue Double

ATrous Sigma value

sigmaNormal Double

ATrous Sigma normal

levelCount Int

Atrous #Levels

filterLowValues Boolean

Remove low values from the filtering (see: lowValuesThreshold parameter)

lowValueThreshold Double

Threshold used if filterLowValues is enabled

Returns

Image

The filtered AO Map

findCustomMaterialPatternByName

Returns the material pattern which has the given name

material.findCustomMaterialPatternByName(name) -> material.CustomMaterialPattern

Parameters

name String

The name of the material pattern

Returns

CustomMaterialPattern

The material pattern

findMaterialsByPattern

Returns all materials using the given pattern

material.findMaterialsByPattern(pattern) -> material.MaterialList

Parameters

pattern String

A material pattern

Returns

MaterialList

Materials using the pattern

findMaterialsByProperty

Returns all materials which match a given property value

material.findMaterialsByProperty(propertyName, propertyValue, caseInsensitive) -> material.MaterialList

Parameters

propertyName String

Name of the property to match

propertyValue Regex

Regular expression to match for the property value

caseInsensitive Bool

If True, the regex will be insensitive to upper and lower cases

Returns

MaterialList

Materials matching the property value

getAllImages

Returns all the images loaded in the current session or from a list of materials

material.getAllImages(materials) -> material.ImageList

Parameters

materials MaterialList

Materials to retrieve the images from (returns all images loaded in the current session if empty)

Returns

ImageList

A list containing all images identifiers

getAllMaterialPatterns

Returns all the material patterns in the current session

material.getAllMaterialPatterns() -> core.StringList

Returns

StringList

A list containing all material patterns

getAllMaterials

Retrieve the list of all the materials in the material library

material.getAllMaterials() -> material.MaterialList

Returns

MaterialList

List of materials in the material library

getColorMaterialInfos

Get color material properties

material.getColorMaterialInfos(material) -> material.ColorMaterialInfos

Parameters

material Material

The material to get properties

Returns

ColorMaterialInfos

The ColorMaterialInfos properties

getCustomMaterialPattern

Returns the custom material pattern associated to the custom material

material.getCustomMaterialPattern(material) -> material.CustomMaterialPattern

Parameters

material Material

Custom material to get the pattern from

Returns

CustomMaterialPattern

The custom material pattern

getImageDefinition

Returns the raw data of an image

material.getImageDefinition(image) -> material.ImageDefinition

Parameters

image Image

Image's definition

Returns

ImageDefinition

Definition of the image

getImageDefinitions

Returns the raw data of a set of images

material.getImageDefinitions(images) -> material.ImageDefinitionList

Parameters

images ImageList

The images

Returns

ImageDefinitionList

Images's definitions

getImageSize

Returns the size of an image

material.getImageSize(image) -> core.Int, core.Int

Parameters

image Image

The image to get the size from

Returns

Int

The width of the image in pixels

getImportImageFormats

Give all the image format name and their extensions that can be imported in Pixyz

material.getImportImageFormats() -> core.FormatList

Returns

FormatList

Image formats that can be imported in Pixyz

getImpostorMaterialInfos

Get impostor texture material properties

material.getImpostorMaterialInfos(material) -> material.ImpostorMaterialInfos

Parameters

material Material

The material to get properties

Returns

ImpostorMaterialInfos

The getImpostorMaterialInfos properties

getMaterialDefinition

Returns the properties of a PBR Material

material.getMaterialDefinition(material) -> material.MaterialDefinition

Parameters

material Material

The PBR Material

Returns

MaterialDefinition

The PBR material definition

getMaterialDefinitions

Returns the properties of a set of PBR Materials

material.getMaterialDefinitions(materials) -> material.MaterialDefinitionList

Parameters

materials MaterialList

The PBR Materials

Returns

MaterialDefinitionList

The PBR Material definitions

getMaterialMainColor

Get the main color on any material pattern type

material.getMaterialMainColor(material) -> core.ColorAlpha

Parameters

material Material

The material

Returns

ColorAlpha

The main color

getMaterialPattern

Gets the MaterialPattern name of the material

material.getMaterialPattern(material) -> core.String

Parameters

material Material

The material to find the pattern

Returns

String

The pattern of the material

getMaterialPatternType

Returns the MaterialPatternType name of the material

material.getMaterialPatternType(material) -> material.MaterialPatternType

Parameters

material Material

The material to find the pattern

Returns

MaterialPatternType

The pattern type of the material

getPBRMaterialInfos

Get PBR material properties

material.getPBRMaterialInfos(material) -> material.PBRMaterialInfos

Parameters

material Material

The material to get properties

Returns

PBRMaterialInfos

The PBRMaterialInfos properties

getPointsAndMaterialFromText

Returns list of 3D Points and a material from a string and fontname

material.getPointsAndMaterialFromText(text, fontName, fontSize, matrix, colorInput, offset, height3D) -> geom.Point3List, geom.Point2List, geom.Vector3, material.Material, core.Double

Parameters

text String

Input text

fontName String

Fontname

fontSize Int

FontSize

matrix Matrix4

Input matrix for the text

colorInput Color

Color of the font needed

offset Double

Input offset for the text

height3D Double

Input height in 3D which will be a ratio from the textSize

Returns

Point3List

getStandardMaterialInfos

Get standard material properties

material.getStandardMaterialInfos(material) -> material.StandardMaterialInfos

Parameters

material Material

The material to get properties

Returns

StandardMaterialInfos

The StandardMaterialInfos properties

getUniformPropertyType

Get a shader uniform shader property type

material.getUniformPropertyType(pattern, name) -> material.ShaderUniformType

Parameters

pattern CustomMaterialPattern

The custom pattern

name String

Name of the property to get the type from

Returns

ShaderUniformType

Type of the uniform property

getUnlitTextureMaterialInfos

Get unlit texture material properties

material.getUnlitTextureMaterialInfos(material) -> material.UnlitTextureMaterialInfos

Parameters

material Material

The material to get properties

Returns

UnlitTextureMaterialInfos

The UnlitTextureMaterialInfos properties

importImage

Import an image

material.importImage(filename) -> material.Image

Parameters

filename FilePath

Filename of the image to import

Returns

Image

Identifier of the imported image

isOpaque

Check if material is opaque

material.isOpaque(material) -> core.Boolean

Parameters

material Material

Material to check opacity

Returns

Boolean

Returns True if opaque or False if transparent

makeMaterialNamesUnique

Rename materials to have a unique name for each one

material.makeMaterialNamesUnique(materials=[])

Parameters

materials MaterialList

Materials to rename (rename all materials if empty)

remapIndexMap

create remapped versions of index maps

material.remapIndexMap(maps, maxIndices) -> material.ImageList, core.IntListList

Parameters

maps ImageList

Input Images

maxIndices Int

Number max of indices remapped

Returns

ImageList

Output maps remapped

resizeImage

Resize an image

material.resizeImage(image, width, height)

Parameters

image Image

Image to be resize

width Int

New image width

height Int

New image height

setFragmentShader

Set the fragment shader of a custom pattern

material.setFragmentShader(pattern, code)

Parameters

pattern CustomMaterialPattern

The custom pattern to edit

code String

The GLSL code of the fragment shader

setMaterialMainColor

Set the main color on any material pattern type

material.setMaterialMainColor(material, color)

Parameters

material Material

The material to apply the color on

color ColorAlpha

The color to apply

setMaterialPattern

Sets the MaterialPattern name of the material

material.setMaterialPattern(material, pattern)

Parameters

material Material

The material to find the pattern

pattern String

The pattern of the material

setPBRMaterialInfos

Set PBR material properties

material.setPBRMaterialInfos(material, infos)

Parameters

material Material

The material to set properties

infos PBRMaterialInfos

The PBRMaterialInfos properties

setVertexShader

Set the vertex shader of a custom pattern

material.setVertexShader(pattern, code)

Parameters

pattern CustomMaterialPattern

The custom pattern to edit

code String

The GLSL code of the vertex shader

updateImageFromDefinition

Update an image from its raw data

material.updateImageFromDefinition(image, imageDefinition)

Parameters

image Image

The image to update

imageDefinition ImageDefinition

The new data to apply

updateImagesFromDefinitions

Update images from their raw data

material.updateImagesFromDefinitions(image, imageDefinitions)

Parameters

image ImageList

The image to update

imageDefinitions ImageDefinitionList

The new data to apply

getMaterialUserData

material.getMaterialUserData(userDataId, material) -> core.Ptr

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

material Material

Material that store the user data

Returns

Ptr

User data stored in the given material

getMultipleMaterialUserData

material.getMultipleMaterialUserData(userDataId, materials) -> core.PtrList

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

materials MaterialList

Materials that store the user data

Returns

PtrList

User data stored for each given material

hasMaterialUserData

material.hasMaterialUserData(userDataId, material) -> core.Bool

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

material Material

Material that potentially store the user data

Returns

Bool

Returns true if a userdata is stored on this material for the given userDataId

hasMultipleMaterialUserData

material.hasMultipleMaterialUserData(userDataId, materials) -> core.BoolList

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

materials MaterialList

Materials that potentially store the user data

Returns

BoolList

Returns an array of bool that are true if a userdata is stored on the material at the same index for the given userDataId

setMaterialUserData

material.setMaterialUserData(userDataId, material, userData)

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

material Material

Material that will store the user data

userData Ptr

User data to store in the given material

setMultipleMaterialUserData

material.setMultipleMaterialUserData(userDataId, materials, userDataList)

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

materials MaterialList

Materials that will store the user data

userDataList PtrList

User data to store on each material

subscribeToMaterialUserData

material.subscribeToMaterialUserData() -> material.MaterialUserData

Returns

MaterialUserData

UserData identifier to pass to setUserData/getUserData functions

unsetMaterialUserData

material.unsetMaterialUserData(userDataId, material)

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

material Material

Material that will store the user data

unsetMultipleMaterialUserData

material.unsetMultipleMaterialUserData(userDataId, materials)

Parameters

userDataId MaterialUserData

UserData identifier provided by subscribeToMaterialUserData

materials MaterialList

Materials that will store the user data

unsubscribeFromMaterialUserData

material.unsubscribeFromMaterialUserData(userDataId)

Parameters

userDataId MaterialUserData

UserData identifier to unsubscribe

ImageChanged

def onImageChanged(type, image):
    pass

id = material.addImageChangedCallback(onImageChanged)

...

material.removeImageChangedCallback(id)

Parameters

type ImageChangeType

Type of image change

image Image

Image changed

MaterialChanged

def onMaterialChanged(type, material):
    pass

id = material.addMaterialChangedCallback(onMaterialChanged)

...

material.removeMaterialChangedCallback(id)

Parameters

type MaterialChangeType

Type of material change

material Material

Material changed