MaterialInterface
Class
阅读时间17 分钟最后更新于 8 个月前
Inheritance
Inherited Members
Namespace: UnityEngine.Pixyz.Material
public class MaterialInterface : Interface
Methods
GetLastError
public static string GetLastError()
Returns
Type | Description |
|---|---|
| string |
AddUniformProperty
Add a shader uniform parameter to the given custom pattern.
[HandleProcessCorruptedStateExceptions]public void AddUniformProperty(uint pattern, string name, ShaderUniformType type)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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.
[HandleProcessCorruptedStateExceptions]public BoolList AreOpaques(MaterialList materials)
Parameters
Type | Name | Description |
|---|---|---|
| MaterialList | materials | Materials to check opacity. |
Returns
Type | Description |
|---|---|
| BoolList |
ClearAllMaterials
Remove and delete all the materials.
[HandleProcessCorruptedStateExceptions]public void ClearAllMaterials()
ConfigureFunctionLogger
[HandleProcessCorruptedStateExceptions]public void ConfigureFunctionLogger(string functionName, bool enableFunction, bool enableParameters, bool enableExecutionTime)
Parameters
ConvertFloat32To8BitsImage
Returns a new image from the given converter from 32bits float to a 8Bits (e.g. depth render map).
[HandleProcessCorruptedStateExceptions]public uint ConvertFloat32To8BitsImage(uint image32F, double minValue = -1, double maxValue = 1, bool inPlace = false)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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). |
| bool | inPlace | If true, the given image is modified instead of creating a new one. |
Returns
Type | Description |
|---|---|
| uint |
ConvertHeightMapToNormalMap
Convert a height map to a normal map.
[HandleProcessCorruptedStateExceptions]public uint ConvertHeightMapToNormalMap(uint hmap, double height = 0.5)
Parameters
Returns
Type | Description |
|---|---|
| uint |
CopyMaterial
Copies a material.
[HandleProcessCorruptedStateExceptions]public uint CopyMaterial(uint toCopy, bool addToMaterialLibrary)
Parameters
Returns
Type | Description |
|---|---|
| uint |
CreateCustomMaterialPattern
Create a new custom material pattern.
[HandleProcessCorruptedStateExceptions]public uint CreateCustomMaterialPattern(string name)
Parameters
Type | Name | Description |
|---|---|---|
| string | name | Name of the pattern. |
Returns
Type | Description |
|---|---|
| uint |
CreateImageFromData
Import an Image from only its data.
[HandleProcessCorruptedStateExceptions]public uint CreateImageFromData(ByteList data, string name = "img")
Parameters
Returns
Type | Description |
|---|---|
| uint |
CreateImageFromDefinition
Import an image from its raw data.
[HandleProcessCorruptedStateExceptions]public uint CreateImageFromDefinition(ImageDefinition imageDefinition)
Parameters
Type | Name | Description |
|---|---|---|
| ImageDefinition | imageDefinition | The image definition. |
Returns
Type | Description |
|---|---|
| uint |
CreateImagesFromDefinitions
Import images from their raw data.
[HandleProcessCorruptedStateExceptions]public ImageList CreateImagesFromDefinitions(ImageDefinitionList imageDefinitions)
Parameters
Type | Name | Description |
|---|---|---|
| ImageDefinitionList | imageDefinitions | The image definitions. |
Returns
Type | Description |
|---|---|
| ImageList |
CreateMaterial
Create a new material from pattern.
[HandleProcessCorruptedStateExceptions]public uint CreateMaterial(string name, string pattern, bool addToMaterialLibrary = true)
Parameters
Type | Name | Description |
|---|---|---|
| string | name | Name of the material. |
| string | pattern | Name of the pattern. |
| bool | addToMaterialLibrary | Name of the pattern. |
Returns
Type | Description |
|---|---|
| uint |
CreateMaterialFromDefinition
Create PBR material from a material definition.
[HandleProcessCorruptedStateExceptions]public uint CreateMaterialFromDefinition(MaterialDefinition materialDefinition)
Parameters
Type | Name | Description |
|---|---|---|
| MaterialDefinition | materialDefinition | The structure containing all the PBR material information. |
Returns
Type | Description |
|---|---|
| uint |
CreateMaterialsFromDefinitions
Create PBR materials from material definitions.
[HandleProcessCorruptedStateExceptions]public MaterialList CreateMaterialsFromDefinitions(MaterialDefinitionList materialDefinitions)
Parameters
Type | Name | Description |
|---|---|---|
| MaterialDefinitionList | materialDefinitions | Material definitions containing properties for each given material. |
Returns
Type | Description |
|---|---|
| MaterialList |
CreateMaterialsFromMaps
Automatically creates PBR materials when importing PBR texture maps from a folder.
[HandleProcessCorruptedStateExceptions]public MaterialFromMapsReturn CreateMaterialsFromMaps(string directory)
Parameters
Type | Name | Description |
|---|---|---|
| string | directory | Directory path. |
Returns
Type | Description |
|---|---|
| MaterialFromMapsReturn |
ExportImage
Export an image.
[HandleProcessCorruptedStateExceptions]public void ExportImage(uint image, string filename)
Parameters
Type | Name | Description |
|---|---|---|
| uint | image | Identifier of the image to export. |
| string | filename | Filename of the file to export. |
FillUnusedPixels
Fill unused pixels by propagating and averaging used pixels.
[HandleProcessCorruptedStateExceptions]public uint FillUnusedPixels(uint image, ColorAlpha? unusedColor = null, int size = -1, uint validityMask = 0, bool inPlace = false)
Parameters
Type | Name | Description |
|---|---|---|
| uint | image | Image to process. |
| ColorAlpha | unusedColor | Color used to identify unused pixels. |
| int | size | Dilation size in pixels. |
| uint | 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. |
| bool | inPlace | If True, the source image is modified. Otherwise, a new one is created. |
Returns
Type | Description |
|---|---|
| uint |
FilterAO
Filter an AO map using ATrous method.
[HandleProcessCorruptedStateExceptions]public ImageList FilterAO(ImageList aoMaps, ImageList normalMaps, double sigmaPos = 2, double sigmaValue = 0.2, double sigmaNormal = 0.2, int levelCount = 4, bool filterLowValues = true, double lowValueThreshold = 0.01)
Parameters
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. |
| bool | filterLowValues | Remove low values from the filtering (see: lowValuesThreshold parameter). |
| double | lowValueThreshold | Threshold used if filterLowValues is enabled. |
Returns
Type | Description |
|---|---|
| ImageList |
FindCustomMaterialPatternByName
Returns the material pattern which has the given name.
[HandleProcessCorruptedStateExceptions]public uint FindCustomMaterialPatternByName(string name)
Parameters
Type | Name | Description |
|---|---|---|
| string | name | The name of the material pattern. |
Returns
Type | Description |
|---|---|
| uint |
FindMaterialsByPattern
Returns all materials using the given pattern.
[HandleProcessCorruptedStateExceptions]public MaterialList FindMaterialsByPattern(string pattern)
Parameters
Type | Name | Description |
|---|---|---|
| string | pattern | A material pattern. |
Returns
Type | Description |
|---|---|
| MaterialList |
FindMaterialsByProperty
Returns all materials which match a given property value.
[HandleProcessCorruptedStateExceptions]public MaterialList FindMaterialsByProperty(string propertyName, string propertyValue, bool caseInsensitive = false)
Parameters
Type | Name | Description |
|---|---|---|
| string | propertyName | Name of the property to match. |
| string | 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 |
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).
[HandleProcessCorruptedStateExceptions]public Color GenerateColorFromIndex(int index)
Parameters
Type | Name | Description |
|---|---|---|
| int | index | Index. |
Returns
Type | Description |
|---|---|
| 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).
[HandleProcessCorruptedStateExceptions]public ColorList GenerateUniqueColors(int count)
Parameters
Type | Name | Description |
|---|---|---|
| int | count | Number of unique colors to generate. |
Returns
Type | Description |
|---|---|
| ColorList |
GetAllImages
Returns all the images loaded in the current session or from a list of materials.
[HandleProcessCorruptedStateExceptions]public ImageList GetAllImages(MaterialList materials = null)
Parameters
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 |
GetAllMaterialPatterns
Returns all the material patterns in the current session.
[HandleProcessCorruptedStateExceptions]public StringList GetAllMaterialPatterns()
Returns
Type | Description |
|---|---|
| StringList |
GetAllMaterials
Retrieve the list of all the materials in the material library.
[HandleProcessCorruptedStateExceptions]public MaterialList GetAllMaterials()
Returns
Type | Description |
|---|---|
| MaterialList |
GetColorMaterialInfos
Get color material properties.
[HandleProcessCorruptedStateExceptions]public ColorMaterialInfos GetColorMaterialInfos(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to get properties. |
Returns
Type | Description |
|---|---|
| ColorMaterialInfos |
GetCustomMaterialPattern
Returns the custom material pattern associated to the custom material.
[HandleProcessCorruptedStateExceptions]public uint GetCustomMaterialPattern(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | Custom material to get the pattern from. |
Returns
Type | Description |
|---|---|
| uint |
GetExportImageFormats
Returns image format names and extensions which can be exported in Pixyz.
[HandleProcessCorruptedStateExceptions]public FormatList GetExportImageFormats()
Returns
Type | Description |
|---|---|
| FormatList |
GetImageDefinition
Returns the raw data of an image.
[HandleProcessCorruptedStateExceptions]public ImageDefinition GetImageDefinition(uint image)
Parameters
Type | Name | Description |
|---|---|---|
| uint | image | Image's definition. |
Returns
Type | Description |
|---|---|
| ImageDefinition |
GetImageDefinitions
Returns the raw data of a set of images.
[HandleProcessCorruptedStateExceptions]public ImageDefinitionList GetImageDefinitions(ImageList images)
Parameters
Type | Name | Description |
|---|---|---|
| ImageList | images | The images. |
Returns
Type | Description |
|---|---|
| ImageDefinitionList |
GetImagePixelColor
Returns the color of a given pixel in an image.
[HandleProcessCorruptedStateExceptions]public ColorAlpha GetImagePixelColor(uint image, int x, int y)
Parameters
Type | Name | Description |
|---|---|---|
| uint | image | The image to get the pixel from. |
| int | x | The x pixel coordinates. |
| int | y | The y pixel coordinates. |
Returns
Type | Description |
|---|---|
| ColorAlpha |
GetImageSize
Returns the size of an image.
[HandleProcessCorruptedStateExceptions]public GetImageSizeReturn GetImageSize(uint image)
Parameters
Type | Name | Description |
|---|---|---|
| uint | image | The image to get the size from. |
Returns
Type | Description |
|---|---|
| GetImageSizeReturn |
GetImagesSizes
Returns the sizes of multiple images.
[HandleProcessCorruptedStateExceptions]public GetImagesSizesReturn GetImagesSizes(ImageList images)
Parameters
Type | Name | Description |
|---|---|---|
| ImageList | images | The image to get the size from. |
Returns
Type | Description |
|---|---|
| GetImagesSizesReturn |
GetImportImageFormats
Returns the image format names and extensions which can be imported in Pixyz.
[HandleProcessCorruptedStateExceptions]public FormatList GetImportImageFormats()
Returns
Type | Description |
|---|---|
| FormatList |
GetImpostorMaterialInfos
Get impostor texture material properties.
[HandleProcessCorruptedStateExceptions]public ImpostorMaterialInfos GetImpostorMaterialInfos(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to get properties. |
Returns
Type | Description |
|---|---|
| ImpostorMaterialInfos |
GetMaterialDefinition
Returns the properties of a PBR Material.
[HandleProcessCorruptedStateExceptions]public MaterialDefinition GetMaterialDefinition(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The PBR Material. |
Returns
Type | Description |
|---|---|
| MaterialDefinition |
GetMaterialDefinitions
Returns the properties of a set of PBR Materials.
[HandleProcessCorruptedStateExceptions]public MaterialDefinitionList GetMaterialDefinitions(MaterialList materials)
Parameters
Type | Name | Description |
|---|---|---|
| MaterialList | materials | The PBR Materials. |
Returns
Type | Description |
|---|---|
| MaterialDefinitionList |
GetMaterialMainColor
Get the main color on any material pattern type.
[HandleProcessCorruptedStateExceptions]public ColorAlpha GetMaterialMainColor(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material. |
Returns
Type | Description |
|---|---|
| ColorAlpha |
GetMaterialPattern
Gets the MaterialPattern name of the material.
[HandleProcessCorruptedStateExceptions]public string GetMaterialPattern(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to find the pattern. |
Returns
Type | Description |
|---|---|
| string |
GetMaterialPatternType
Returns the MaterialPatternType name of the material.
[HandleProcessCorruptedStateExceptions]public MaterialPatternType GetMaterialPatternType(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to find the pattern. |
Returns
Type | Description |
|---|---|
| MaterialPatternType |
GetPBRMaterialInfos
Get PBR material properties.
[HandleProcessCorruptedStateExceptions]public PBRMaterialInfos GetPBRMaterialInfos(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to get properties. |
Returns
Type | Description |
|---|---|
| PBRMaterialInfos |
GetPointsAndMaterialFromText
Returns a list of 3D Points and a material from a string and a fontname.
[HandleProcessCorruptedStateExceptions]public GetPointsAndMaterialFromTextReturn GetPointsAndMaterialFromText(string text, string fontName, int fontSize, Matrix4 matrix, Color colorInput, double offset = 0, double height3D = 0)
Parameters
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 |
|---|---|
| GetPointsAndMaterialFromTextReturn |
GetStandardMaterialInfos
Get standard material properties.
[HandleProcessCorruptedStateExceptions]public StandardMaterialInfos GetStandardMaterialInfos(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to get properties. |
Returns
Type | Description |
|---|---|
| StandardMaterialInfos |
GetUniformPropertyType
Get a shader uniform shader property type.
[HandleProcessCorruptedStateExceptions]public ShaderUniformType GetUniformPropertyType(uint pattern, string name)
Parameters
Type | Name | Description |
|---|---|---|
| uint | pattern | The custom pattern. |
| string | name | Name of the property to get the type from. |
Returns
Type | Description |
|---|---|
| ShaderUniformType |
GetUnlitTextureMaterialInfos
Get unlit texture material properties.
[HandleProcessCorruptedStateExceptions]public UnlitTextureMaterialInfos GetUnlitTextureMaterialInfos(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to get properties. |
Returns
Type | Description |
|---|---|
| UnlitTextureMaterialInfos |
ImportImage
Import an image.
[HandleProcessCorruptedStateExceptions]public uint ImportImage(string filename)
Parameters
Type | Name | Description |
|---|---|---|
| string | filename | Filename of the image to import. |
Returns
Type | Description |
|---|---|
| uint |
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.
[HandleProcessCorruptedStateExceptions]public bool IsOpaque(uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | Material to check opacity. |
Returns
Type | Description |
|---|---|
| bool |
MakeMaterialNamesUnique
Rename materials to have a unique name for each one.
[HandleProcessCorruptedStateExceptions]public void MakeMaterialNamesUnique(MaterialList materials = null)
Parameters
Type | Name | Description |
|---|---|---|
| MaterialList | materials | Materials to rename (rename all materials if empty). |
RemapIndexMap
Create remapped versions of index maps.
[HandleProcessCorruptedStateExceptions]public RemapIndexMapReturn RemapIndexMap(ImageList maps, int maxIndices)
Parameters
Returns
Type | Description |
|---|---|
| RemapIndexMapReturn |
ResizeImage
Resize an image.
[HandleProcessCorruptedStateExceptions]public void ResizeImage(uint image, int width, int height, ResizeFilterMethod filteringMethod = ResizeFilterMethod.DEFAULT)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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.
[HandleProcessCorruptedStateExceptions]public void SetCoeffOrTextureProperty(uint material, string name, CoeffOrTexture coeffOrTexture)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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.
[HandleProcessCorruptedStateExceptions]public void SetColorAlphaProperty(uint material, string name, ColorAlpha color)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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.
[HandleProcessCorruptedStateExceptions]public void SetColorOrTextureProperty(uint material, string name, ColorOrTexture colorOrTexture)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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.
[HandleProcessCorruptedStateExceptions]public void SetFragmentShader(uint pattern, string code)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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.
[HandleProcessCorruptedStateExceptions]public void SetMaterialMainColor(uint material, ColorAlpha color)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to apply the color on. |
| ColorAlpha | color | The color to apply. |
SetMaterialPattern
Sets the MaterialPattern name of the material.
[HandleProcessCorruptedStateExceptions]public void SetMaterialPattern(uint material, string pattern)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to find the pattern. |
| string | pattern | The pattern of the material. |
SetPBRMaterialInfos
Set PBR material properties.
[HandleProcessCorruptedStateExceptions]public void SetPBRMaterialInfos(uint material, PBRMaterialInfos infos)
Parameters
Type | Name | Description |
|---|---|---|
| uint | material | The material to set properties. |
| PBRMaterialInfos | infos | The PBRMaterialInfos properties. |
SetVertexShader
Set the vertex shader of a custom pattern.
[HandleProcessCorruptedStateExceptions]public void SetVertexShader(uint pattern, string code)
Parameters
Type | Name | Description |
|---|---|---|
| uint | pattern | The custom pattern to edit. |
| string | code | The GLSL code of the vertex shader. |
UpdateImageFromDefinition
Update an image from its raw data.
[HandleProcessCorruptedStateExceptions]public void UpdateImageFromDefinition(uint image, ImageDefinition imageDefinition)
Parameters
Type | Name | Description |
|---|---|---|
| uint | image | The image to update. |
| ImageDefinition | imageDefinition | The new data to apply. |
UpdateImagesFromDefinitions
Update images from their raw data.
[HandleProcessCorruptedStateExceptions]public void UpdateImagesFromDefinitions(ImageList image, ImageDefinitionList imageDefinitions)
Parameters
Type | Name | Description |
|---|---|---|
| ImageList | image | The image to update. |
| ImageDefinitionList | imageDefinitions | The new data to apply. |
AddImageChangedCallback
public uint AddImageChangedCallback(MaterialInterface.ImageChangedDelegate callback, IntPtr userData)
Parameters
Type | Name | Description |
|---|---|---|
| MaterialInterface.ImageChangedDelegate | callback | |
| IntPtr | userData |
Returns
Type | Description |
|---|---|
| uint |
RemoveImageChangedCallback
public void RemoveImageChangedCallback(uint id)
Parameters
Type | Name | Description |
|---|---|---|
| uint | id |
AddMaterialChangedCallback
public uint AddMaterialChangedCallback(MaterialInterface.MaterialChangedDelegate callback, IntPtr userData)
Parameters
Type | Name | Description |
|---|---|---|
| MaterialInterface.MaterialChangedDelegate | callback | |
| IntPtr | userData |
Returns
Type | Description |
|---|---|
| uint |
RemoveMaterialChangedCallback
public void RemoveMaterialChangedCallback(uint id)
Parameters
Type | Name | Description |
|---|---|---|
| uint | id |
GetMaterialUserData
Set or replace a userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public IntPtr GetMaterialUserData(uint userDataId, uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier provided by subscribeToMaterialUserData. |
| uint | material | Material that store the user data. |
Returns
Type | Description |
|---|---|
| IntPtr |
GetMultipleMaterialUserData
Batch version of getMaterialUserData.
[HandleProcessCorruptedStateExceptions]public PtrList GetMultipleMaterialUserData(uint userDataId, MaterialList materials)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier provided by subscribeToMaterialUserData. |
| MaterialList | materials | Materials that store the user data. |
Returns
Type | Description |
|---|---|
| PtrList |
HasMaterialUserData
Set or replace a userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public bool HasMaterialUserData(uint userDataId, uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier provided by subscribeToMaterialUserData. |
| uint | material | Material that potentially store the user data. |
Returns
Type | Description |
|---|---|
| bool |
HasMultipleMaterialUserData
Batch version of hasMaterialUserData.
[HandleProcessCorruptedStateExceptions]public BoolList HasMultipleMaterialUserData(uint userDataId, MaterialList materials)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier provided by subscribeToMaterialUserData. |
| MaterialList | materials | Materials that potentially store the user data. |
Returns
Type | Description |
|---|---|
| BoolList |
SetMaterialUserData
Set or replace a userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public void SetMaterialUserData(uint userDataId, uint material, IntPtr userData)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier provided by subscribeToMaterialUserData. |
| uint | material | Material that will store the user data. |
| IntPtr | userData | User data to store in the given material. |
SetMultipleMaterialUserData
Batch version of setMaterialUserData.
[HandleProcessCorruptedStateExceptions]public void SetMultipleMaterialUserData(uint userDataId, MaterialList materials, PtrList userDataList)
Parameters
Type | Name | Description |
|---|---|---|
| uint | 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.
[HandleProcessCorruptedStateExceptions]public uint SubscribeToMaterialUserData()
Returns
Type | Description |
|---|---|
| uint |
UnsetMaterialUserData
Unset the userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public void UnsetMaterialUserData(uint userDataId, uint material)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier provided by subscribeToMaterialUserData. |
| uint | material | Material that will store the user data. |
UnsetMultipleMaterialUserData
Batch version of unsetMaterialUserData.
[HandleProcessCorruptedStateExceptions]public void UnsetMultipleMaterialUserData(uint userDataId, MaterialList materials)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier provided by subscribeToMaterialUserData. |
| MaterialList | materials | Materials that will store the user data. |
UnsubscribeFromMaterialUserData
[HandleProcessCorruptedStateExceptions]public void UnsubscribeFromMaterialUserData(uint userDataId)
Parameters
Type | Name | Description |
|---|---|---|
| uint | userDataId | UserData identifier to unsubscribe. |