Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK


Material

Python API functions
Read time 57 minutesLast updated 22 days ago

addUniformProperty

Add a shader uniform parameter to the given custom pattern.
material.addUniformProperty(pattern, name, type)
Parameters

Type

Name

Description

CustomMaterialPatternpatternThe custom pattern to edit.
StringnameName of the new property.
ShaderUniformTypetypeType of the new uniform.

areOpaques

Check if some materials are opaques. Function will return 'False' for each material if:
  • The 'Opacity' Coeff is not 1.0
  • The 'Opacity' property is a Texture
  • The 'Albedo' property is a Texture and at least one pixel of the texture has an alpha value.
material.areOpaques(materials) -> core.BoolList
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to check opacity.
Returns

Type

Name

Description

BoolListopaquesFor each given material, returns True if opaque or False if transparent.

clearAllMaterials

Remove and delete all the materials.
material.clearAllMaterials()

configureFunctionLogger

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

Type

Name

Description

StringfunctionName
BooleanenableFunction
BooleanenableParameters
BooleanenableExecutionTime

convertHeightMapToNormalMap

Convert a height map to a normal map.
material.convertHeightMapToNormalMap(hmap, height=0.5) -> material.Image
Parameters

Type

Name

Description

ImagehmapHeight map reference.
DoubleheightMaximum height.
Returns

Type

Name

Description

ImagenmapNormal map.

copyMaterial

Copies a material.
material.copyMaterial(toCopy, addToMaterialLibrary) -> material.Material
Parameters

Type

Name

Description

MaterialtoCopyMaterial to copy.
BooleanaddToMaterialLibraryAdd to material library.
Returns

Type

Name

Description

MaterialmaterialThe copied material.

createCustomMaterialPattern

Create a new custom material pattern.
material.createCustomMaterialPattern(name) -> material.CustomMaterialPattern
Parameters

Type

Name

Description

StringnameName of the pattern.
Returns

Type

Name

Description

CustomMaterialPatternpatternThe created material pattern.

createMaterial

Create a new material from pattern.
material.createMaterial(name, pattern, addToMaterialLibrary=True) -> material.Material
Parameters

Type

Name

Description

StringnameName of the material.
StringpatternName of the pattern.
BooleanaddToMaterialLibraryName of the pattern.
Returns

Type

Name

Description

MaterialmaterialThe created material.

createMaterialFromDefinition

Create PBR material from a material definition.
material.createMaterialFromDefinition(materialDefinition) -> material.Material
Parameters

Type

Name

Description

MaterialDefinitionmaterialDefinitionThe structure containing all the PBR material information.
Returns

Type

Name

Description

MaterialmaterialThe created material.

createMaterialsFromDefinitions

Create PBR materials from material definitions.
material.createMaterialsFromDefinitions(materialDefinitions) -> material.MaterialList
Parameters

Type

Name

Description

MaterialDefinitionListmaterialDefinitionsMaterial definitions containing properties for each given material.
Returns

Type

Name

Description

MaterialListmaterialsThe created materials.

createMaterialsFromMaps

Automatically creates PBR materials when importing PBR texture maps from a folder.
material.createMaterialsFromMaps(directory) -> material.MaterialFromMapsReturn
Parameters

Type

Name

Description

DirectoryPathdirectoryDirectory path.
Returns

Type

Name

Description

MaterialFromMapsReturnresultResults of the createMaterialsFromMaps function.

filterAO

Filter an AO map using ATrous method.
material.filterAO(aoMaps, normalMaps, sigmaPos=2.0, sigmaValue=0.2, sigmaNormal=0.2, levelCount=4, filterLowValues=True, lowValueThreshold=0.01) -> material.ImageList
Parameters

Type

Name

Description

ImageListaoMapsInput AO Maps (the alpha component must be set to 0 for unused pixels).
ImageListnormalMapsInput Normal Maps (preferable to use World space normal maps, but Object space normal maps can be used too).
DoublesigmaPosATrous Sigma pos.
DoublesigmaValueATrous Sigma value.
DoublesigmaNormalATrous Sigma normal.
IntlevelCountAtrous #Levels.
BooleanfilterLowValuesRemove low values from the filtering (see: lowValuesThreshold parameter).
DoublelowValueThresholdThreshold used if filterLowValues is enabled.
Returns

Type

Name

Description

ImageListfilteredAOMapsThe filtered AO Maps.

findCustomMaterialPatternByName

Returns the material pattern which has the given name.
material.findCustomMaterialPatternByName(name) -> material.CustomMaterialPattern
Parameters

Type

Name

Description

StringnameThe name of the material pattern.
Returns

Type

Name

Description

CustomMaterialPatternpatternThe material pattern.

findMaterialsByPattern

Returns all materials using the given pattern.
material.findMaterialsByPattern(pattern) -> material.MaterialList
Parameters

Type

Name

Description

StringpatternA material pattern.
Returns

Type

Name

Description

MaterialListmaterialsMaterials using the pattern.

findMaterialsByProperty

Returns all materials which match a given property value.
material.findMaterialsByProperty(propertyName, propertyValue, caseInsensitive=False) -> material.MaterialList
Parameters

Type

Name

Description

StringpropertyNameName of the property to match.
RegexpropertyValueRegular expression to match for the property value.
BoolcaseInsensitiveIf True, the regex will be insensitive to upper and lower cases.
Returns

Type

Name

Description

MaterialListmaterialsMaterials matching the property value.

generateColorFromIndex

Generate a unique color from an index (only 16M differents color can be generated, if index is greater than 16777216, the color is not guaranted to be unique).
material.generateColorFromIndex(index) -> core.Color
Parameters

Type

Name

Description

IntindexIndex.
Returns

Type

Name

Description

ColorcolorColor.

generateUniqueColors

Generate a set of unique colors (max 16M differents color can be generated, if count is greater than 16777216, the colors are not guaranted to be unique).
material.generateUniqueColors(count) -> core.ColorList
Parameters

Type

Name

Description

IntcountNumber of unique colors to generate.
Returns

Type

Name

Description

ColorListcolorsCount unique colors.

getAllMaterialPatterns

Returns all the material patterns in the current session.
material.getAllMaterialPatterns() -> core.StringList
Returns

Type

Name

Description

StringListshadersA list containing all material patterns.

getAllMaterials

Retrieve the list of all the materials in the material library.
material.getAllMaterials() -> material.MaterialList
Returns

Type

Name

Description

MaterialListmaterialsList of materials in the material library.

getColorMaterialInfos

Get color material properties.
material.getColorMaterialInfos(material) -> material.ColorMaterialInfos
Parameters

Type

Name

Description

MaterialmaterialThe material to get properties.
Returns

Type

Name

Description

ColorMaterialInfosinfosThe ColorMaterialInfos properties.

getCustomMaterialPattern

Returns the custom material pattern associated to the custom material.
material.getCustomMaterialPattern(material) -> material.CustomMaterialPattern
Parameters

Type

Name

Description

MaterialmaterialCustom material to get the pattern from.
Returns

Type

Name

Description

CustomMaterialPatternpatternThe custom material pattern.

getImpostorMaterialInfos

Get impostor texture material properties.
material.getImpostorMaterialInfos(material) -> material.ImpostorMaterialInfos
Parameters

Type

Name

Description

MaterialmaterialThe material to get properties.
Returns

Type

Name

Description

ImpostorMaterialInfosinfosThe getImpostorMaterialInfos properties.

getMaterialDefinition

Returns the properties of a PBR Material.
material.getMaterialDefinition(material) -> material.MaterialDefinition
Parameters

Type

Name

Description

MaterialmaterialThe PBR Material.
Returns

Type

Name

Description

MaterialDefinitionmaterialDefinitionThe PBR material definition.

getMaterialDefinitions

Returns the properties of a set of PBR Materials.
material.getMaterialDefinitions(materials) -> material.MaterialDefinitionList
Parameters

Type

Name

Description

MaterialListmaterialsThe PBR Materials.
Returns

Type

Name

Description

MaterialDefinitionListmaterialDefinitionsThe PBR Material definitions.

getMaterialMainColor

Get the main color on any material pattern type.
material.getMaterialMainColor(material) -> core.ColorAlpha
Parameters

Type

Name

Description

MaterialmaterialThe material.
Returns

Type

Name

Description

ColorAlphacolorThe main color.

getMaterialPattern

Gets the MaterialPattern name of the material.
material.getMaterialPattern(material) -> core.String
Parameters

Type

Name

Description

MaterialmaterialThe material to find the pattern.
Returns

Type

Name

Description

StringpatternThe pattern of the material.

getMaterialPatternType

Returns the MaterialPatternType name of the material.
material.getMaterialPatternType(material) -> material.MaterialPatternType
Parameters

Type

Name

Description

MaterialmaterialThe material to find the pattern.
Returns

Type

Name

Description

MaterialPatternTypepatternTypeThe pattern type of the material.

getPBRMaterialInfos

Get PBR material properties.
material.getPBRMaterialInfos(material) -> material.PBRMaterialInfos
Parameters

Type

Name

Description

MaterialmaterialThe material to get properties.
Returns

Type

Name

Description

PBRMaterialInfosinfosThe PBRMaterialInfos properties.

getPointsAndMaterialFromText

Returns a list of 3D Points and a material from a string and a fontname.
material.getPointsAndMaterialFromText(text, fontName, fontSize, matrix, colorInput, offset=0.0, height3D=0.0) -> geom.Point3List, geom.Point2List, geom.Vector3, material.Material, core.Double
Parameters

Type

Name

Description

StringtextInput text.
StringfontNameFontname.
IntfontSizeFontSize.
Matrix4matrixInput matrix for the text.
ColorcolorInputColor of the font needed.
DoubleoffsetInput offset for the text.
Doubleheight3DInput height in 3D which will be a ratio from the textSize.
Returns

Type

Name

Description

Point3Listpoints
Point2Listuvs
Vector3normal
Materialmaterial
DoubleoffsetOffset given by the text.

getStandardMaterialInfos

Get standard material properties.
material.getStandardMaterialInfos(material) -> material.StandardMaterialInfos
Parameters

Type

Name

Description

MaterialmaterialThe material to get properties.
Returns

Type

Name

Description

StandardMaterialInfosinfosThe StandardMaterialInfos properties.

getUniformPropertyType

Get a shader uniform shader property type.
material.getUniformPropertyType(pattern, name) -> material.ShaderUniformType
Parameters

Type

Name

Description

CustomMaterialPatternpatternThe custom pattern.
StringnameName of the property to get the type from.
Returns

Type

Name

Description

ShaderUniformTypetypeType of the uniform property.

getUnlitTextureMaterialInfos

Get unlit texture material properties.
material.getUnlitTextureMaterialInfos(material) -> material.UnlitTextureMaterialInfos
Parameters

Type

Name

Description

MaterialmaterialThe material to get properties.
Returns

Type

Name

Description

UnlitTextureMaterialInfosinfosThe UnlitTextureMaterialInfos properties.

isOpaque

Check if material is opaque. Function will return 'False' if:
  • The 'Opacity' Coeff is not 1.0
  • The 'Opacity' property is a Texture
  • The 'Albedo' property is a Texture and at least one pixel of the texture has an alpha value.
material.isOpaque(material) -> core.Boolean
Parameters

Type

Name

Description

MaterialmaterialMaterial to check opacity.
Returns

Type

Name

Description

BooleanopaqueReturns True if opaque or False if transparent.

makeMaterialNamesUnique

Rename materials to have a unique name for each one.
material.makeMaterialNamesUnique(materials=[])
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to rename (rename all materials if empty).

remapIndexMap

Create remapped versions of index maps.
material.remapIndexMap(maps, maxIndices=-1) -> material.ImageList, core.IntListList
Parameters

Type

Name

Description

ImageListmapsInput Images.
IntmaxIndicesNumber max of indices remapped.
Returns

Type

Name

Description

ImageListmappedMapsOutput maps remapped.
IntListListnewToOldMapIndicesNew index to old index for each map.

setCoeffOrTextureProperty

Set a CoeffOrTexture property.
material.setCoeffOrTextureProperty(material, name, coeffOrTexture)
Parameters

Type

Name

Description

MaterialmaterialThe material to apply the color on.
StringnameThe property to set.
CoeffOrTexturecoeffOrTextureThe CoeffOrTexture to apply.

setColorAlphaProperty

Set a ColorAlpha property.
material.setColorAlphaProperty(material, name, color)
Parameters

Type

Name

Description

MaterialmaterialThe material to apply the color on.
StringnameThe property to set.
ColorAlphacolorThe color to apply.

setColorOrTextureProperty

Set a ColorOrTexture property.
material.setColorOrTextureProperty(material, name, colorOrTexture)
Parameters

Type

Name

Description

MaterialmaterialThe material to apply the color on.
StringnameThe property to set.
ColorOrTexturecolorOrTextureThe ColorOrTexture to apply.

setFragmentShader

Set the fragment shader of a custom pattern.
material.setFragmentShader(pattern, code)
Parameters

Type

Name

Description

CustomMaterialPatternpatternThe custom pattern to edit.
StringcodeThe GLSL code of the fragment shader.

setMaterialMainColor

Set the main color on any material pattern type.
material.setMaterialMainColor(material, color)
Parameters

Type

Name

Description

MaterialmaterialThe material to apply the color on.
ColorAlphacolorThe color to apply.

setMaterialPattern

Sets the MaterialPattern name of the material.
material.setMaterialPattern(material, pattern)
Parameters

Type

Name

Description

MaterialmaterialThe material to find the pattern.
StringpatternThe pattern of the material.

setPBRMaterialInfos

Set PBR material properties.
material.setPBRMaterialInfos(material, infos)
Parameters

Type

Name

Description

MaterialmaterialThe material to set properties.
PBRMaterialInfosinfosThe PBRMaterialInfos properties.

setVertexShader

Set the vertex shader of a custom pattern.
material.setVertexShader(pattern, code)
Parameters

Type

Name

Description

CustomMaterialPatternpatternThe custom pattern to edit.
StringcodeThe GLSL code of the vertex shader.

Images

applyFactorOnImage

Aplly a factor to an image.
material.applyFactorOnImage(image, imageIsLinear, factor)
Parameters

Type

Name

Description

ImageimageImage to be modified.
BoolimageIsLinearImage is linear or not.
ColorAlphafactorFactor to apply.
See also:

blurImage

Applies a blurring to the given image.
material.blurImage(image, radius, blurType, edgeFilter)
Parameters

Type

Name

Description

ImageimageImage to blur.
IntradiusRadius in pixels of the Gaussian kernel.
BlurFilterblurTypeKernel of the blur filter to apply.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
See also:

clearImageRoI

Removes the region of interest from an image.
material.clearImageRoI(image)
Parameters

Type

Name

Description

ImageimageImage to process.
See also:

convertFloat32To8BitsImage

Returns a new image from the given converter from 32bits float to a 8Bits (e.g. depth render map).
material.convertFloat32To8BitsImage(image32F, minValue=-1, maxValue=1, inPlace=False) -> material.Image
Parameters

Type

Name

Description

Imageimage32FImage to convert.
DoubleminValueMinimal value of the floats (will be 0 in 8bits).
DoublemaxValueMinimal value of the floats (will be 255 in 8bits).
BooleaninPlaceIf true, the given image is modified instead of creating a new one.
Returns

Type

Name

Description

Imageimage8UThe new 8bits image.
See also:

convertImage

Converts the given image to a new format.
material.convertImage(image, layout, type, inPlace=False) -> material.Image
Parameters

Type

Name

Description

ImageimageImage to convert.
ImageLayoutlayoutLayout (components definition) of the new image format. Accepted values are combinations of the following: 'R' (red), 'G' (green), 'B' (blue), 'A' (alpha), 'L' (luminance), 'S' (stencil index) and 'D' (depth component).
ImageComponentTypetypeComponent data type of the new image format.
BooleaninPlaceIf true, the given image is modified instead of creating a new one.
Returns

Type

Name

Description

ImageconvertedImageThe converted image.
See also:

convertImageToDefinition

Returns an image definition which contains data corresponding to the given image converted to a new format.
material.convertImageToDefinition(image, layout, type) -> material.ImageDefinition
Parameters

Type

Name

Description

ImageimageImage to convert.
ImageLayoutlayoutLayout (components definition) of the new image format. Accepted values are combinations of the following: 'R' (red), 'G' (green), 'B' (blue), 'A' (alpha), 'L' (luminance), 'S' (stencil index) and 'D' (depth component).
ImageComponentTypetypeComponent data type of the new image format.
Returns

Type

Name

Description

ImageDefinitionconvertedImageThe converted image definition.
See also:

createCheckerboardImage

Create an image consisting in a black and white checkerboard.
material.createCheckerboardImage(width=1024, height=1024, cellSize=32, color1=core.ColorAlpha(0, 0, 0, 0), color2=core.ColorAlpha(1, 1, 1, 1), layout=6, type=1) -> material.Image
Parameters

Type

Name

Description

IntwidthWidth desired for the created image.
IntheightHeight desired for the created image.
IntcellSizeSize of checkerboard cells (in pixels).
ColorAlphacolor1First checkerboard color.
ColorAlphacolor2Second checkerboard color.
ImageLayoutlayoutDesired image layout.
ImageComponentTypetypeDesired image component type.
Returns

Type

Name

Description

ImagecheckerboardThe resulting checkerboard image.
See also:

createImageFromData

Import an Image from only its data.
material.createImageFromData(data, name="img") -> material.Image
Parameters

Type

Name

Description

ByteListdataThe raw data as input.
StringnameIf need of a name.
Returns

Type

Name

Description

ImageimageThe created Image.
See also:

createImageFromDefinition

Import an image from its raw data.
material.createImageFromDefinition(imageDefinition) -> material.Image
Parameters

Type

Name

Description

ImageDefinitionimageDefinitionThe image definition.
Returns

Type

Name

Description

ImageimageThe created image.
See also:

createImagesFromDefinitions

Import images from their raw data.
material.createImagesFromDefinitions(imageDefinitions) -> material.ImageList
Parameters

Type

Name

Description

ImageDefinitionListimageDefinitionsThe image definitions.
Returns

Type

Name

Description

ImageListimagesThe created images.
See also:

exportImage

Export an image.
material.exportImage(image, filename)
Parameters

Type

Name

Description

ImageimageIdentifier of the image to export.
OutputFilePathfilenameFilename of the file to export.
See also:

extractImageChannels

Creates new images from individual channels of the given image.
material.extractImageChannels(image, channel=-1) -> material.ImageList
Parameters

Type

Name

Description

ImageimageImage to convert.
IntchannelNumber of the channel to extract. -1 extracts all channels.
Returns

Type

Name

Description

ImageListcomponentImagesSingle channel image.
See also:

extractImageComponents

Creates new images from individual components of the given image.
material.extractImageComponents(image, components) -> material.ImageList
Parameters

Type

Name

Description

ImageimageImage to convert.
ImageLayoutcomponentsName of the components to extract. Accepted values: 'R' (red), 'G' (green), 'B' (blue), 'A' (alpha), 'L' (luminance).
Returns

Type

Name

Description

ImageListcomponentImagesList of single component images.
See also:

fillImageWithColor

Fills an image (or a sub-part of it) with the provided color.
material.fillImageWithColor(image, color, x=0, y=0, w=-1, h=-1)
Parameters

Type

Name

Description

ImageimageImage from which type has to be fetched.
ColorAlphacolorFilling color.
IntxImage X coordinate of the sub-image to fill.
IntyImage Y coordinate of the sub-image to fill.
IntwWidth of the sub-image to fill (-1 means infinite width).
InthHeight of the sub-image to fill (-1 means infinite height).
See also:

fillUnusedPixels

Fill unused pixels by propagating and averaging used pixels.
material.fillUnusedPixels(image, unusedColor=core.ColorAlpha(0., 0., 0., 0.), size=-1, validityMask=0, inPlace=False) -> material.Image
Parameters

Type

Name

Description

ImageimageImage to process.
ColorAlphaunusedColorColor used to identify unused pixels.
IntsizeDilation size in pixels.
ImagevalidityMaskImage describing which texels are valid (color set to white) and which ones need to be filled (color set to black). If zero, unusedColor is used instead.
BooleaninPlaceIf True, the source image is modified. Otherwise, a new one is created.
Returns

Type

Name

Description

ImagefilledImageResulting image with filled pixels.
See also:

flipImageY

Applies a vertical flip to an image.
material.flipImageY(image)
Parameters

Type

Name

Description

ImageimageImage to flip.
See also:

getAllImages

Returns all the images loaded in the current session or from a list of materials.
material.getAllImages(materials=[]) -> material.ImageList
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to retrieve the images from (returns all images loaded in the current session if empty).
Returns

Type

Name

Description

ImageListimagesA list containing all images identifiers.
See also:

getExportImageFormats

Returns image format names and extensions which can be exported in Pixyz.
material.getExportImageFormats() -> core.FormatList
Returns

Type

Name

Description

FormatListformatsImage formats that can be exported.
See also:

getImageColorBilinear

Returns the color at a specific image point, in real coordinates, using bi-linear interpolation.
material.getImageColorBilinear(image, x, y, edgeFilter=0) -> core.ColorAlpha
Parameters

Type

Name

Description

ImageimageThe image to get the color from.
DoublexImage X coordinate (real).
DoubleyImage Y coordinate (real).
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
Returns

Type

Name

Description

ColorAlphacolorThe color of the pixel at the x,y position.
See also:

getImageColorRange

Gets the min and max bounds of each image color component.
material.getImageColorRange(image) -> core.ColorAlphaList
Parameters

Type

Name

Description

ImageimageSource image.
Returns

Type

Name

Description

ColorAlphaListcolorBoundsMin and max bounds of image color values.
See also:

getImageComponentType

Gets the component data type of the given image.
material.getImageComponentType(image) -> material.ImageComponentType
Parameters

Type

Name

Description

ImageimageImage from which type has to be fetched.
Returns

Type

Name

Description

ImageComponentTypetypeImage data type definition.
See also:

getImageComponentTypeName

Gets the name of a given component data type ID.
material.getImageComponentTypeName(type) -> core.String
Parameters

Type

Name

Description

ImageComponentTypetype
Returns

Type

Name

Description

Stringname
See also:

getImageDefinition

Returns the raw data of an image.
material.getImageDefinition(image) -> material.ImageDefinition
Parameters

Type

Name

Description

ImageimageSource image.
Returns

Type

Name

Description

ImageDefinitionimageDefinitionDefinition of the image.
See also:

getImageDefinitions

Returns the raw data of a set of images.
material.getImageDefinitions(images) -> material.ImageDefinitionList
Parameters

Type

Name

Description

ImageListimagesThe images.
Returns

Type

Name

Description

ImageDefinitionListimageDefinitionsImages's definitions.
See also:

getImageFormatName

Gets a comprenhensive name from an image format.
material.getImageFormatName(layout, type) -> core.String
Parameters

Type

Name

Description

ImageLayoutlayout
ImageComponentTypetype
Returns

Type

Name

Description

Stringname
See also:

getImageLayout

Gets the layout (component definitions) of the given image.
material.getImageLayout(image) -> material.ImageLayout
Parameters

Type

Name

Description

ImageimageImage from which layout has to be fetched.
Returns

Type

Name

Description

ImageLayoutlayoutImage component definition. Valid values are combinations of the following: 'R' (red), 'G' (green), 'B' (blue), 'A' (alpha), 'L' (luminance), 'S' (stencil index) and 'D' (depth component).
See also:

getImagePixelColor

Returns the color of a given pixel in an image.
material.getImagePixelColor(image, x, y) -> core.ColorAlpha
Parameters

Type

Name

Description

ImageimageThe image to get the pixel from.
IntxThe X pixel coordinate.
IntyThe Y pixel coordinate.
Returns

Type

Name

Description

ColorAlphacolorThe color of the pixel at the x,y position.
See also:

getImagePixelInfo

Returns info about the image pixel format.
material.getImagePixelInfo(image) -> material.PixelInfo
Parameters

Type

Name

Description

ImageimageSource image.
Returns

Type

Name

Description

PixelInfopixelInfoInformation about image pixels.
See also:

getImagePixelInfoFromDefinition

Returns info about the image pixel format.
material.getImagePixelInfoFromDefinition(imageDefinition) -> material.PixelInfo
Parameters

Type

Name

Description

ImageDefinitionimageDefinitionSource image.
Returns

Type

Name

Description

PixelInfopixelInfoInformation about image pixels.
See also:

getImagePixelInfoFromLayoutAndType

Returns info about the image pixel format for a given combination of image layout and component type.
material.getImagePixelInfoFromLayoutAndType(layout, type) -> material.PixelInfo
Parameters

Type

Name

Description

ImageLayoutlayoutImage layout (components definition).
ImageComponentTypetypeImage component data type.
Returns

Type

Name

Description

PixelInfopixelInfoInformation about image pixels.
See also:

getImageRoI

Returns the region of interest of an image.
material.getImageRoI(image) -> material.RoI
Parameters

Type

Name

Description

ImageimageImage to process.
Returns

Type

Name

Description

RoIroiImage RoI.
See also:

getImageSize

Returns the size of an image.
material.getImageSize(image) -> core.Int, core.Int
Parameters

Type

Name

Description

ImageimageThe image to get the size from.
Returns

Type

Name

Description

IntwidthThe width of the image in pixels.
IntheightThe height of the image in pixels.
See also:

getImagesSizes

Returns the sizes of multiple images.
material.getImagesSizes(images) -> core.IntList, core.IntList
Parameters

Type

Name

Description

ImageListimagesThe image to get the size from.
Returns

Type

Name

Description

IntListwidthsThe widths of the images in pixels.
IntListheightsThe heights of the images in pixels.
See also:

getImportImageFormats

Returns the image format names and extensions which can be imported in Pixyz.
material.getImportImageFormats() -> core.FormatList
Returns

Type

Name

Description

FormatListformatsImage formats that can be imported.
See also:

getSubImage

Extracts a sub-part of the given image.
material.getSubImage(image, x, y, w, h) -> material.Image
Parameters

Type

Name

Description

ImageimageSource image.
IntxImage X coordinate of the sub-image to extract.
IntyImage Y coordinate of the sub-image to extract.
IntwWidth of the sub-image to extract.
InthHeight of the sub-image to extract.
Returns

Type

Name

Description

ImagesubImageSub-image.
See also:

importImage

Import an image.
material.importImage(filename) -> material.Image
Parameters

Type

Name

Description

FilePathfilenameFilename of the image to import.
Returns

Type

Name

Description

ImageimageIdentifier of the imported image.
See also:

invertImageColor

Inverts the color of all image pixels.
material.invertImageColor(image)
Parameters

Type

Name

Description

ImageimageImage to invert.
See also:

overrideImageFormat

Changes the way image channels are interpreted by assigning a new format without modifying the data. Note that the new format must be compatible with the previous one, which means that they have to have the same number of bytes per pixel.
material.overrideImageFormat(image, layout=0, type=0) -> core.Boolean
Parameters

Type

Name

Description

ImageimageImage for format must be overridden.
ImageLayoutlayoutNew layout (keep the original one if set to Undefined).
ImageComponentTypetypeNew component type (keep the original one if set to Undefined).
Returns

Type

Name

Description

BooleanhasSucceededTrue in case of success, False otherwise.
See also:

resizeImage

Resize an image.
material.resizeImage(image, width, height, filteringMethod=0)
Parameters

Type

Name

Description

ImageimageImage to be resize.
IntwidthNew image width.
IntheightNew image height.
ResizeFilterMethodfilteringMethodFiltering method for image resizing.
See also:

rotateImage

Applies a rotation to (the sub-part of) an image.
material.rotateImage(image, angle, cx, cy, edgeFilter=0, adjustSize=False)
Parameters

Type

Name

Description

ImageimageImage to process.
DoubleangleRotation angle (in degrees).
DoublecxX coordinate of the transformation center.
DoublecyY coordinate of the transformation center.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
BooleanadjustSizeAdjust the dimensions of the image to fit the transformation.
See also:

setImageRoI

Defines the region of interest of an image.
material.setImageRoI(image, x, y, w, h)
Parameters

Type

Name

Description

ImageimageImage to process.
IntxX coordinate of the RoI origin.
IntyY coordinate of the RoI origin.
IntwWidth of the RoI.
InthHeight of the RoI.
See also:

setSubImage

Replaces a part of a given image by another one.
material.setSubImage(destination, subImage, x, y, edgeFilter=0)
Parameters

Type

Name

Description

ImagedestinationDestination image.
ImagesubImageSource image.
IntxX coordinate where to copy sub-image.
IntyY coordinate where to copy sub-image.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
See also:

stretchImage

Applies a non-uniform scale to (the sub-part of) an image.
material.stretchImage(image, sx, sy, cx, cy, edgeFilter=0, adjustSize=False)
Parameters

Type

Name

Description

ImageimageImage to process.
DoublesxScale factor along X axis.
DoublesyScale factor along Y axis.
DoublecxX coordinate of the transformation center.
DoublecyY coordinate of the transformation center.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
BooleanadjustSizeAdjust the dimensions of the image to fit the transformation.
See also:

transformImage

Applies a transformation matrix to (the sub-part of) an image.
material.transformImage(image, matrix, edgeFilter=0, adjustSize=False)
Parameters

Type

Name

Description

ImageimageImage to process.
Matrix3matrixTransformation matrix.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
BooleanadjustSizeAdjust the dimensions of the image to fit the transformation.
See also:

translateImage

Applies a translation to (the sub-part of) an image.
material.translateImage(image, tx, ty, edgeFilter=0, adjustSize=False)
Parameters

Type

Name

Description

ImageimageImage to process.
DoubletxX translation.
DoubletyY translation.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
BooleanadjustSizeAdjust the dimensions of the image to fit the transformation.
See also:

updateImageFromDefinition

Update an image from its raw data.
material.updateImageFromDefinition(image, imageDefinition)
Parameters

Type

Name

Description

ImageimageThe image to update.
ImageDefinitionimageDefinitionThe new data to apply.
See also:

updateImagesFromDefinitions

Update images from their raw data.
material.updateImagesFromDefinitions(image, imageDefinitions)
Parameters

Type

Name

Description

ImageListimageThe image to update.
ImageDefinitionListimageDefinitionsThe new data to apply.
See also:

userData

getMaterialUserData

Set or replace a userdata stored on an material.
material.getMaterialUserData(userDataId, material) -> core.Ptr
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialmaterialMaterial that store the user data.
Returns

Type

Name

Description

PtruserDataUser data stored in the given material.
See also:

getMultipleMaterialUserData

Batch version of getMaterialUserData.
material.getMultipleMaterialUserData(userDataId, materials) -> core.PtrList
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that store the user data.
Returns

Type

Name

Description

PtrListuserDataListUser data stored for each given material.
See also:

hasMaterialUserData

Set or replace a userdata stored on an material.
material.hasMaterialUserData(userDataId, material) -> core.Bool
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialmaterialMaterial that potentially store the user data.
Returns

Type

Name

Description

BoolresultReturns true if a userdata is stored on this material for the given userDataId.
See also:

hasMultipleMaterialUserData

Batch version of hasMaterialUserData.
material.hasMultipleMaterialUserData(userDataId, materials) -> core.BoolList
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that potentially store the user data.
Returns

Type

Name

Description

BoolListresultsReturns an array of bool that are true if a userdata is stored on the material at the same index for the given userDataId.
See also:

setMaterialUserData

Set or replace a userdata stored on an material.
material.setMaterialUserData(userDataId, material, userData)
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialmaterialMaterial that will store the user data.
PtruserDataUser data to store in the given material.
See also:

setMultipleMaterialUserData

Batch version of setMaterialUserData.
material.setMultipleMaterialUserData(userDataId, materials, userDataList)
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that will store the user data.
PtrListuserDataListUser data to store on each material.
See also:

subscribeToMaterialUserData

Subscribe to material user data. multiple different userdata can be stored on the same materials if subscribeToMaterialUserData is called multiple times.
material.subscribeToMaterialUserData() -> material.MaterialUserData
Returns

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier to pass to setUserData/getUserData functions.
See also:

unsetMaterialUserData

Unset the userdata stored on an material.
material.unsetMaterialUserData(userDataId, material)
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialmaterialMaterial that will store the user data.
See also:

unsetMultipleMaterialUserData

Batch version of unsetMaterialUserData.
material.unsetMultipleMaterialUserData(userDataId, materials)
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that will store the user data.
See also:

unsubscribeFromMaterialUserData

material.unsubscribeFromMaterialUserData(userDataId)
Parameters

Type

Name

Description

MaterialUserDatauserDataIdUserData identifier to unsubscribe.
See also: