Class Material
Inheritance
Namespace:
Syntax
Methods
addUniformProperty
Add a shader uniform parameter to the given custom pattern
Declaration
material.addUniformProperty(pattern, name, type)Parameters
| Type | Name | Description | 
|---|---|---|
| CustomMaterialPattern | pattern | The custom pattern to edit | 
| String | name | Name of the new property | 
| ShaderUniformType | type | Type 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
Declaration
material.areOpaques(materials) -> core.BoolListParameters
| Type | Name | Description | 
|---|---|---|
| MaterialList | materials | Materials to check opacity | 
Returns
| Type | Description | 
|---|---|
| BoolList | For each given material, returns True if opaque or False if transparent | 
clearAllMaterials
Remove and delete all the materials
Declaration
material.clearAllMaterials()configureFunctionLogger
Declaration
material.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)Parameters
| Type | Name | Description | 
|---|---|---|
| String | functionName | |
| Boolean | enableFunction | |
| Boolean | enableParameters | |
| Boolean | enableExecutionTime | 
convertFloat32To8BitsImage
Returns a new image from the given converter from 32bits float to a 8Bits (e.g. depth render map)
Declaration
material.convertFloat32To8BitsImage(image32F, minValue=-1, maxValue=1, inPlace=False) -> material.ImageParameters
| Type | Name | Description | 
|---|---|---|
| Image | image32F | Image to convert | 
| Double | minValue | Minimal value of the floats (will be 0 in 8bits) | 
| Double | maxValue | Minimal value of the floats (will be 255 in 8bits) | 
| Boolean | inPlace | If true, the given image is modified instead of creating a new one | 
Returns
| Type | Description | 
|---|---|
| Image | The new 8bits image | 
convertHeightMapToNormalMap
Convert a height map to a normal map
Declaration
material.convertHeightMapToNormalMap(hmap, height=0.5) -> material.ImageParameters
| Type | Name | Description | 
|---|---|---|
| Image | hmap | Height map reference | 
| Double | height | Maximum height | 
Returns
| Type | Description | 
|---|---|
| Image | Normal map | 
copyMaterial
copies a material
Declaration
material.copyMaterial(toCopy, addToMaterialLibrary) -> material.MaterialParameters
| Type | Name | Description | 
|---|---|---|
| Material | toCopy | Material to copy | 
| Boolean | addToMaterialLibrary | Add to material library | 
Returns
| Type | Description | 
|---|---|
| Material | The copied material | 
createCustomMaterialPattern
Create a new custom material pattern
Declaration
material.createCustomMaterialPattern(name) -> material.CustomMaterialPatternParameters
| Type | Name | Description | 
|---|---|---|
| String | name | Name of the pattern | 
Returns
| Type | Description | 
|---|---|
| CustomMaterialPattern | The created material pattern | 
createImageFromData
Import an Image from only its data
Declaration
material.createImageFromData(data, name="img") -> material.ImageParameters
| Type | Name | Description | 
|---|---|---|
| ByteList | data | The raw data as input | 
| String | name | If need of a name | 
Returns
| Type | Description | 
|---|---|
| Image | The created Image | 
createImageFromDefinition
Import an image from its raw data
Declaration
material.createImageFromDefinition(imageDefinition) -> material.ImageParameters
| Type | Name | Description | 
|---|---|---|
| ImageDefinition | imageDefinition | The image definition | 
Returns
| Type | Description | 
|---|---|
| Image | The created image | 
createImagesFromDefinitions
Import images from their raw data
Declaration
material.createImagesFromDefinitions(imageDefinitions) -> material.ImageListParameters
| Type | Name | Description | 
|---|---|---|
| ImageDefinitionList | imageDefinitions | The image definitions | 
Returns
| Type | Description | 
|---|---|
| ImageList | The created images | 
createMaterial
Create a new material from pattern
Declaration
material.createMaterial(name, pattern, addToMaterialLibrary=True) -> material.MaterialParameters
| Type | Name | Description | 
|---|---|---|
| String | name | Name of the material | 
| String | pattern | Name of the pattern | 
| Boolean | addToMaterialLibrary | Name of the pattern | 
Returns
| Type | Description | 
|---|---|
| Material | The created material | 
createMaterialFromDefinition
Create PBR material from a material definition
Declaration
material.createMaterialFromDefinition(materialDefinition) -> material.MaterialParameters
| Type | Name | Description | 
|---|---|---|
| MaterialDefinition | materialDefinition | The structure containing all the PBR material information | 
Returns
| Type | Description | 
|---|---|
| Material | The created material | 
createMaterialsFromDefinitions
Create PBR materials from material definitions
Declaration
material.createMaterialsFromDefinitions(materialDefinitions) -> material.MaterialListParameters
| Type | Name | Description | 
|---|---|---|
| MaterialDefinitionList | materialDefinitions | Material definitions containing properties for each given material | 
Returns
| Type | Description | 
|---|---|
| MaterialList | The created materials | 
createMaterialsFromMaps
Automatically creates PBR materials when importing PBR texture maps from a folder
Declaration
material.createMaterialsFromMaps(directory) -> material.MaterialFromMapsReturnParameters
| Type | Name | Description | 
|---|---|---|
| DirectoryPath | directory | Directory path | 
Returns
| Type | Description | 
|---|---|
| MaterialFromMapsReturn | Results of the createMaterialsFromMaps function | 
exportImage
Export an image
Declaration
material.exportImage(image, filename)Parameters
| Type | Name | Description | 
|---|---|---|
| Image | image | Identifier of the image to export | 
| OutputFilePath | filename | Filename of the file to export | 
fillUnusedPixels
Fill unused pixels by propagating and averaging used pixels
Declaration
material.fillUnusedPixels(image, unusedColor=core.ColorAlpha(0., 0., 0., 0.), size=-1, validityMask=0, inPlace=False) -> material.ImageParameters
| Type | Name | Description | 
|---|---|---|
| Image | image | Image to process | 
| ColorAlpha | unusedColor | Color used to identify unused pixels | 
| Int | size | Dilation size in pixels | 
| Image | validityMask | Image 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. | 
| Boolean | inPlace | If True, the source image is modified. Otherwise, a new one is created | 
Returns
| Type | Description | 
|---|---|
| Image | Resulting image with filled pixels | 
filterAO
Filter an AO map using ATrous method
Declaration
material.filterAO(aoMaps, normalMaps, sigmaPos=2.0, sigmaValue=0.2, sigmaNormal=0.2, levelCount=4, filterLowValues=True, lowValueThreshold=0.01) -> material.ImageListParameters
| Type | Name | Description | 
|---|---|---|
| ImageList | aoMaps | Input AO Maps (the alpha component must be set to 0 for unused pixels) | 
| ImageList | normalMaps | Input Normal Maps (preferable to use World space normal maps, but Object space normal maps can be used too) | 
| Double | sigmaPos | ATrous Sigma pos | 
| Double | sigmaValue | ATrous Sigma value | 
| Double | sigmaNormal | ATrous Sigma normal | 
| Int | levelCount | Atrous #Levels | 
| Boolean | filterLowValues | Remove low values from the filtering (see: lowValuesThreshold parameter) | 
| Double | lowValueThreshold | Threshold used if filterLowValues is enabled | 
Returns
| Type | Description | 
|---|---|
| ImageList | The filtered AO Maps | 
findCustomMaterialPatternByName
Returns the material pattern which has the given name
Declaration
material.findCustomMaterialPatternByName(name) -> material.CustomMaterialPatternParameters
| Type | Name | Description | 
|---|---|---|
| String | name | The name of the material pattern | 
Returns
| Type | Description | 
|---|---|
| CustomMaterialPattern | The material pattern | 
findMaterialsByPattern
Returns all materials using the given pattern
Declaration
material.findMaterialsByPattern(pattern) -> material.MaterialListParameters
| Type | Name | Description | 
|---|---|---|
| String | pattern | A material pattern | 
Returns
| Type | Description | 
|---|---|
| MaterialList | Materials using the pattern | 
findMaterialsByProperty
Returns all materials which match a given property value
Declaration
material.findMaterialsByProperty(propertyName, propertyValue, caseInsensitive=False) -> material.MaterialListParameters
| Type | Name | Description | 
|---|---|---|
| String | propertyName | Name of the property to match | 
| Regex | propertyValue | Regular expression to match for the property value | 
| Bool | caseInsensitive | If True, the regex will be insensitive to upper and lower cases | 
Returns
| Type | Description | 
|---|---|
| MaterialList | Materials 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)
Declaration
material.generateColorFromIndex(index) -> core.ColorParameters
| Type | Name | Description | 
|---|---|---|
| Int | index | Index | 
Returns
| Type | Description | 
|---|---|
| Color | Color | 
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)
Declaration
material.generateUniqueColors(count) -> core.ColorListParameters
| Type | Name | Description | 
|---|---|---|
| Int | count | Number of unique colors to generate | 
Returns
| Type | Description | 
|---|---|
| ColorList | Count unique colors | 
getAllImages
Returns all the images loaded in the current session or from a list of materials
Declaration
material.getAllImages(materials=[]) -> material.ImageListParameters
| Type | Name | Description | 
|---|---|---|
| MaterialList | materials | Materials to retrieve the images from (returns all images loaded in the current session if empty) | 
Returns
| Type | Description | 
|---|---|
| ImageList | A list containing all images identifiers | 
getAllMaterialPatterns
Returns all the material patterns in the current session
Declaration
material.getAllMaterialPatterns() -> core.StringListReturns
| Type | Description | 
|---|---|
| StringList | A list containing all material patterns | 
getAllMaterials
Retrieve the list of all the materials in the material library
Declaration
material.getAllMaterials() -> material.MaterialListReturns
| Type | Description | 
|---|---|
| MaterialList | List of materials in the material library | 
getColorMaterialInfos
Get color material properties
Declaration
material.getColorMaterialInfos(material) -> material.ColorMaterialInfosParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to get properties | 
Returns
| Type | Description | 
|---|---|
| ColorMaterialInfos | The ColorMaterialInfos properties | 
getCustomMaterialPattern
Returns the custom material pattern associated to the custom material
Declaration
material.getCustomMaterialPattern(material) -> material.CustomMaterialPatternParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | Custom material to get the pattern from | 
Returns
| Type | Description | 
|---|---|
| CustomMaterialPattern | The custom material pattern | 
getExportImageFormats
Returns image format names and extensions which can be exported in Pixyz
Declaration
material.getExportImageFormats() -> core.FormatListReturns
| Type | Description | 
|---|---|
| FormatList | Image formats that can be exported | 
getImageDefinition
Returns the raw data of an image
Declaration
material.getImageDefinition(image) -> material.ImageDefinitionParameters
| Type | Name | Description | 
|---|---|---|
| Image | image | Image's definition | 
Returns
| Type | Description | 
|---|---|
| ImageDefinition | Definition of the image | 
getImageDefinitions
Returns the raw data of a set of images
Declaration
material.getImageDefinitions(images) -> material.ImageDefinitionListParameters
| Type | Name | Description | 
|---|---|---|
| ImageList | images | The images | 
Returns
| Type | Description | 
|---|---|
| ImageDefinitionList | Images's definitions | 
getImagePixelColor
Returns the color of a given pixel in an image
Declaration
material.getImagePixelColor(image, x, y) -> core.ColorAlphaParameters
| Type | Name | Description | 
|---|---|---|
| Image | image | The image to get the pixel from | 
| Int | x | The x pixel coordinates | 
| Int | y | The y pixel coordinates | 
Returns
| Type | Description | 
|---|---|
| ColorAlpha | The color of the pixel at the x,y position | 
getImageSize
Returns the size of an image
Declaration
material.getImageSize(image) -> core.Int, core.IntParameters
| Type | Name | Description | 
|---|---|---|
| Image | image | The image to get the size from | 
Returns
| Type | Description | 
|---|---|
| Int | The width of the image in pixels | 
getImagesSizes
Returns the sizes of multiple images
Declaration
material.getImagesSizes(images) -> core.IntList, core.IntListParameters
| Type | Name | Description | 
|---|---|---|
| ImageList | images | The image to get the size from | 
Returns
| Type | Description | 
|---|---|
| IntList | The widths of the images in pixels | 
getImportImageFormats
Returns the image format names and extensions which can be imported in Pixyz
Declaration
material.getImportImageFormats() -> core.FormatListReturns
| Type | Description | 
|---|---|
| FormatList | Image formats that can be imported | 
getImpostorMaterialInfos
Get impostor texture material properties
Declaration
material.getImpostorMaterialInfos(material) -> material.ImpostorMaterialInfosParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to get properties | 
Returns
| Type | Description | 
|---|---|
| ImpostorMaterialInfos | The getImpostorMaterialInfos properties | 
getMaterialDefinition
Returns the properties of a PBR Material
Declaration
material.getMaterialDefinition(material) -> material.MaterialDefinitionParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The PBR Material | 
Returns
| Type | Description | 
|---|---|
| MaterialDefinition | The PBR material definition | 
getMaterialDefinitions
Returns the properties of a set of PBR Materials
Declaration
material.getMaterialDefinitions(materials) -> material.MaterialDefinitionListParameters
| Type | Name | Description | 
|---|---|---|
| MaterialList | materials | The PBR Materials | 
Returns
| Type | Description | 
|---|---|
| MaterialDefinitionList | The PBR Material definitions | 
getMaterialMainColor
Get the main color on any material pattern type
Declaration
material.getMaterialMainColor(material) -> core.ColorAlphaParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material | 
Returns
| Type | Description | 
|---|---|
| ColorAlpha | The main color | 
getMaterialPattern
Gets the MaterialPattern name of the material
Declaration
material.getMaterialPattern(material) -> core.StringParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to find the pattern | 
Returns
| Type | Description | 
|---|---|
| String | The pattern of the material | 
getMaterialPatternType
Returns the MaterialPatternType name of the material
Declaration
material.getMaterialPatternType(material) -> material.MaterialPatternTypeParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to find the pattern | 
Returns
| Type | Description | 
|---|---|
| MaterialPatternType | The pattern type of the material | 
getPBRMaterialInfos
Get PBR material properties
Declaration
material.getPBRMaterialInfos(material) -> material.PBRMaterialInfosParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to get properties | 
Returns
| Type | Description | 
|---|---|
| PBRMaterialInfos | The PBRMaterialInfos properties | 
getPointsAndMaterialFromText
Returns a list of 3D Points and a material from a string and a fontname
Declaration
material.getPointsAndMaterialFromText(text, fontName, fontSize, matrix, colorInput, offset=0.0, height3D=0.0) -> geom.Point3List, geom.Point2List, geom.Vector3, material.Material, core.DoubleParameters
| Type | Name | Description | 
|---|---|---|
| String | text | Input text | 
| String | fontName | Fontname | 
| Int | fontSize | FontSize | 
| Matrix4 | matrix | Input matrix for the text | 
| Color | colorInput | Color of the font needed | 
| Double | offset | Input offset for the text | 
| Double | height3D | Input height in 3D which will be a ratio from the textSize | 
Returns
| Type | Description | 
|---|---|
| Point3List | 
getStandardMaterialInfos
Get standard material properties
Declaration
material.getStandardMaterialInfos(material) -> material.StandardMaterialInfosParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to get properties | 
Returns
| Type | Description | 
|---|---|
| StandardMaterialInfos | The StandardMaterialInfos properties | 
getUniformPropertyType
Get a shader uniform shader property type
Declaration
material.getUniformPropertyType(pattern, name) -> material.ShaderUniformTypeParameters
| Type | Name | Description | 
|---|---|---|
| CustomMaterialPattern | pattern | The custom pattern | 
| String | name | Name of the property to get the type from | 
Returns
| Type | Description | 
|---|---|
| ShaderUniformType | Type of the uniform property | 
getUnlitTextureMaterialInfos
Get unlit texture material properties
Declaration
material.getUnlitTextureMaterialInfos(material) -> material.UnlitTextureMaterialInfosParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to get properties | 
Returns
| Type | Description | 
|---|---|
| UnlitTextureMaterialInfos | The UnlitTextureMaterialInfos properties | 
importImage
Import an image
Declaration
material.importImage(filename) -> material.ImageParameters
| Type | Name | Description | 
|---|---|---|
| FilePath | filename | Filename of the image to import | 
Returns
| Type | Description | 
|---|---|
| Image | Identifier of the imported image | 
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
Declaration
material.isOpaque(material) -> core.BooleanParameters
| Type | Name | Description | 
|---|---|---|
| Material | material | Material to check opacity | 
Returns
| Type | Description | 
|---|---|
| Boolean | Returns True if opaque or False if transparent | 
makeMaterialNamesUnique
Rename materials to have a unique name for each one
Declaration
material.makeMaterialNamesUnique(materials=[])Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialList | materials | Materials to rename (rename all materials if empty) | 
remapIndexMap
create remapped versions of index maps
Declaration
material.remapIndexMap(maps, maxIndices=-1) -> material.ImageList, core.IntListListParameters
| Type | Name | Description | 
|---|---|---|
| ImageList | maps | Input Images | 
| Int | maxIndices | Number max of indices remapped | 
Returns
| Type | Description | 
|---|---|
| ImageList | Output maps remapped | 
resizeImage
Resize an image
Declaration
material.resizeImage(image, width, height, filteringMethod=0)Parameters
| Type | Name | Description | 
|---|---|---|
| Image | image | Image to be resize | 
| Int | width | New image width | 
| Int | height | New image height | 
| ResizeFilterMethod | filteringMethod | Filtering method for image resizing | 
setCoeffOrTextureProperty
Set a CoeffOrTexture property
Declaration
material.setCoeffOrTextureProperty(material, name, coeffOrTexture)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to apply the color on | 
| String | name | The property to set | 
| CoeffOrTexture | coeffOrTexture | The CoeffOrTexture to apply | 
setColorAlphaProperty
Set a ColorAlpha property
Declaration
material.setColorAlphaProperty(material, name, color)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to apply the color on | 
| String | name | The property to set | 
| ColorAlpha | color | The color to apply | 
setColorOrTextureProperty
Set a ColorOrTexture property
Declaration
material.setColorOrTextureProperty(material, name, colorOrTexture)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to apply the color on | 
| String | name | The property to set | 
| ColorOrTexture | colorOrTexture | The ColorOrTexture to apply | 
setFragmentShader
Set the fragment shader of a custom pattern
Declaration
material.setFragmentShader(pattern, code)Parameters
| Type | Name | Description | 
|---|---|---|
| CustomMaterialPattern | pattern | The custom pattern to edit | 
| String | code | The GLSL code of the fragment shader | 
setMaterialMainColor
Set the main color on any material pattern type
Declaration
material.setMaterialMainColor(material, color)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to apply the color on | 
| ColorAlpha | color | The color to apply | 
setMaterialPattern
Sets the MaterialPattern name of the material
Declaration
material.setMaterialPattern(material, pattern)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to find the pattern | 
| String | pattern | The pattern of the material | 
setPBRMaterialInfos
Set PBR material properties
Declaration
material.setPBRMaterialInfos(material, infos)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | material | The material to set properties | 
| PBRMaterialInfos | infos | The PBRMaterialInfos properties | 
setVertexShader
Set the vertex shader of a custom pattern
Declaration
material.setVertexShader(pattern, code)Parameters
| Type | Name | Description | 
|---|---|---|
| CustomMaterialPattern | pattern | The custom pattern to edit | 
| String | code | The GLSL code of the vertex shader | 
updateImageFromDefinition
Update an image from its raw data
Declaration
material.updateImageFromDefinition(image, imageDefinition)Parameters
| Type | Name | Description | 
|---|---|---|
| Image | image | The image to update | 
| ImageDefinition | imageDefinition | The new data to apply | 
updateImagesFromDefinitions
Update images from their raw data
Declaration
material.updateImagesFromDefinitions(image, imageDefinitions)Parameters
| Type | Name | Description | 
|---|---|---|
| ImageList | image | The image to update | 
| ImageDefinitionList | imageDefinitions | The new data to apply | 
getMaterialUserData
Set or replace a userdata stored on an material
See also:
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.getMaterialUserData(userDataId, material) -> core.PtrParameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| Material | material | Material that store the user data | 
Returns
| Type | Description | 
|---|---|
| Ptr | User data stored in the given material | 
getMultipleMaterialUserData
Batch version of getMaterialUserData
See also:
- material.getMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.getMultipleMaterialUserData(userDataId, materials) -> core.PtrListParameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| MaterialList | materials | Materials that store the user data | 
Returns
| Type | Description | 
|---|---|
| PtrList | User data stored for each given material | 
hasMaterialUserData
Set or replace a userdata stored on an material
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.hasMaterialUserData(userDataId, material) -> core.BoolParameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| Material | material | Material that potentially store the user data | 
Returns
| Type | Description | 
|---|---|
| Bool | Returns true if a userdata is stored on this material for the given userDataId | 
hasMultipleMaterialUserData
Batch version of hasMaterialUserData
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.hasMultipleMaterialUserData(userDataId, materials) -> core.BoolListParameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| MaterialList | materials | Materials that potentially store the user data | 
Returns
| Type | Description | 
|---|---|
| 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
Set or replace a userdata stored on an material
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.setMaterialUserData(userDataId, material, userData)Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| Material | material | Material that will store the user data | 
| Ptr | userData | User data to store in the given material | 
setMultipleMaterialUserData
Batch version of setMaterialUserData
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.setMultipleMaterialUserData(userDataId, materials, userDataList)Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| MaterialList | materials | Materials that will store the user data | 
| PtrList | userDataList | User data to store on each material | 
subscribeToMaterialUserData
subscribe to material user data. multiple different userdata can be stored on the same materials if subscribeToMaterialUserData is called multiple times
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.subscribeToMaterialUserData() -> material.MaterialUserDataReturns
| Type | Description | 
|---|---|
| MaterialUserData | UserData identifier to pass to setUserData/getUserData functions | 
unsetMaterialUserData
Unset the userdata stored on an material
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMultipleMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.unsetMaterialUserData(userDataId, material)Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| Material | material | Material that will store the user data | 
unsetMultipleMaterialUserData
Batch version of unsetMaterialUserData
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsubscribeFromMaterialUserData
Declaration
material.unsetMultipleMaterialUserData(userDataId, materials)Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier provided by subscribeToMaterialUserData | 
| MaterialList | materials | Materials that will store the user data | 
unsubscribeFromMaterialUserData
See also:
- material.getMaterialUserData
- material.getMultipleMaterialUserData
- material.hasMaterialUserData
- material.hasMultipleMaterialUserData
- material.setMaterialUserData
- material.setMultipleMaterialUserData
- material.subscribeToMaterialUserData
- material.unsetMaterialUserData
- material.unsetMultipleMaterialUserData
Declaration
material.unsubscribeFromMaterialUserData(userDataId)Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialUserData | userDataId | UserData identifier to unsubscribe | 
ImageChanged
Declaration
def onImageChanged(type, image):
    pass
id = material.addImageChangedCallback(onImageChanged)
...
material.removeImageChangedCallback(id)Parameters
| Type | Name | Description | 
|---|---|---|
| ImageChangeType | type | Type of image change | 
| Image | image | Image changed | 
MaterialChanged
Declaration
def onMaterialChanged(type, material):
    pass
id = material.addMaterialChangedCallback(onMaterialChanged)
...
material.removeMaterialChangedCallback(id)Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialChangeType | type | Type of material change | 
| Material | material | Material changed |