Difference between revisions of "IC Python API:RLPy RIMaterialComponent"
Chuck (RL) (Talk | contribs) m |
Chuck (RL) (Talk | contribs) m |
||
Line 6: | Line 6: | ||
This class is used to manipulate material surface properties. The main material properties are Ambient color, Diffuse color, Specular color, Glossiness value, Self-illumination value, Opacity value, textures, and more. A material is affiliated with an object, therefore, member functions of this class must specify a mesh and material name. | This class is used to manipulate material surface properties. The main material properties are Ambient color, Diffuse color, Specular color, Glossiness value, Self-illumination value, Opacity value, textures, and more. A material is affiliated with an object, therefore, member functions of this class must specify a mesh and material name. | ||
+ | |||
+ | === Inheritance === | ||
+ | |||
+ | [[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIMaterialComponent|RIMaterialComponent]] | ||
== Member Functions == | == Member Functions == | ||
Line 18: | Line 22: | ||
[[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | [[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | ||
[[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | [[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | [[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | ||
Line 33: | Line 37: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 58: | Line 62: | ||
[[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | [[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | ||
[[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | [[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | [[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | ||
Line 73: | Line 77: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 98: | Line 102: | ||
[[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | [[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | ||
[[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | [[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | [[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | ||
Line 113: | Line 117: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 129: | Line 133: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | === AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor ) === |
Add a Specular key for the material according to the time and Transition Type of '''kKey'''. | Add a Specular key for the material according to the time and Transition Type of '''kKey'''. | ||
Line 153: | Line 157: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 178: | Line 182: | ||
[[#AddGlossinessKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddGlossinessKey]], | [[#AddGlossinessKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddGlossinessKey]], | ||
[[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | [[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | [[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | ||
Line 193: | Line 197: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 218: | Line 222: | ||
[[#AddGlossinessKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddGlossinessKey]], | [[#AddGlossinessKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddGlossinessKey]], | ||
[[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | [[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | [[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | ||
Line 233: | Line 237: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 259: | Line 263: | ||
[[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | [[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | ||
[[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | [[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | [[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]], | ||
Line 289: | Line 293: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 318: | Line 322: | ||
[[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | [[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | ||
[[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | [[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddVideoVolumeKey ( self, kKey, strMeshName, strMaterialName, eChannel, fVol, bMute )|AddVideoVolumeKey]] | [[#AddVideoVolumeKey ( self, kKey, strMeshName, strMaterialName, eChannel, fVol, bMute )|AddVideoVolumeKey]] | ||
Line 349: | Line 353: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 380: | Line 384: | ||
[[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | [[#AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )|AddOpacityKey]], | ||
[[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | [[#AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSelfIlluminationKey]], | ||
− | [[# | + | [[#AddSpecula[[IC_Python_API:RLPy_RKey|RKey]] ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], |
[[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | [[#AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )|AddTextureWeightKey]], | ||
[[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]] | [[#AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )|AddUvDataKey]] | ||
Line 410: | Line 414: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 443: | Line 447: | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
Line 456: | Line 460: | ||
:ambient color - [[IC_Python_API:RLPy_RRgb|RRgb]] | :ambient color - [[IC_Python_API:RLPy_RRgb|RRgb]] | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 479: | Line 483: | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
Line 492: | Line 496: | ||
:diffuse color - [[IC_Python_API:RLPy_RRgb|RRgb]] | :diffuse color - [[IC_Python_API:RLPy_RRgb|RRgb]] | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 518: | Line 522: | ||
:weight of specular - float | :weight of specular - float | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 541: | Line 545: | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
Line 553: | Line 557: | ||
:material names - string list. | :material names - string list. | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get Object mesh and material | # Get Object mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 574: | Line 578: | ||
[[#GetMaterialNames ( self, strMeshName )|GetMaterialNames]], | [[#GetMaterialNames ( self, strMeshName )|GetMaterialNames]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
Line 587: | Line 591: | ||
:weight of opacity - float | :weight of opacity - float | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 610: | Line 614: | ||
[[#GetMaterialNames ( self, strMeshName )|GetMaterialNames]], | [[#GetMaterialNames ( self, strMeshName )|GetMaterialNames]], | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
Line 623: | Line 627: | ||
:weight of self-illumination - float | :weight of self-illumination - float | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
( Experimental API ) | ( Experimental API ) | ||
# Get object, mesh and material | # Get object, mesh and material | ||
Line 637: | Line 641: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | === GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName ) === |
Get the material's Specular color. | Get the material's Specular color. | ||
Line 660: | Line 664: | ||
:Specular color - [[IC_Python_API:RLPy_RRgb|RRgb]] | :Specular color - [[IC_Python_API:RLPy_RRgb|RRgb]] | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 684: | Line 688: | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
[[#GetUvData ( self, strMeshName, strMaterialName, eChannel, kUvOffest, kUvTile, fUvRotate )|GetUvData]], | [[#GetUvData ( self, strMeshName, strMaterialName, eChannel, kUvOffest, kUvTile, fUvRotate )|GetUvData]], | ||
Line 696: | Line 700: | ||
:Specular weight - float | :Specular weight - float | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 720: | Line 724: | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetUvData ( self, strMeshName, strMaterialName, eChannel, kUvOffest, kUvTile, fUvRotate )|GetUvData]], | [[#GetUvData ( self, strMeshName, strMaterialName, eChannel, kUvOffest, kUvTile, fUvRotate )|GetUvData]], | ||
Line 732: | Line 736: | ||
:Ordered list of all texture channel weights - float list | :Ordered list of all texture channel weights - float list | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 757: | Line 761: | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
Line 788: | Line 792: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 816: | Line 820: | ||
[[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | [[#GetOpacity ( self, strMeshName, strMaterialName )|GetOpacity]], | ||
[[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | [[#GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )|GetSelfIlluminationWeight]], | ||
− | [[# | + | [[#GetSpecula[[IC_Python_API:RLPy_RColor|RColor]] ( self, strMeshName, strMaterialName )|GetSpecularColor]], |
[[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | [[#GetSpecularWeight ( self, strMeshName, strMaterialName )|GetSpecularWeight]], | ||
[[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | [[#GetTextureWeights ( self, strMeshName, strMaterialName )|GetTextureWeights]], | ||
Line 843: | Line 847: | ||
:video volume - float | :video volume - float | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 887: | Line 891: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 933: | Line 937: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
Line 981: | Line 985: | ||
:Failure - RLPy.RStatus.Failure | :Failure - RLPy.RStatus.Failure | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python"> |
# Get object, mesh and material | # Get object, mesh and material | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() |
Revision as of 00:53, 9 April 2020
Contents
- 1 Description
- 2 Member Functions
- 2.1 AddAmbientKey ( self, kKey, strMeshName, strMaterialName, kColor )
- 2.2 AddDiffuseKey ( self, kKey, strMeshName, strMaterialName, kColor )
- 2.3 AddGlossinessKey ( self, kKey, strMeshName, strMaterialName, fWeight )
- 2.4 AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )
- 2.5 AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )
- 2.6 AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )
- 2.7 AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )
- 2.8 AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )
- 2.9 AddVideoVolumeKey ( self, kKey, strMeshName, strMaterialName, eChannel, fVol, bMute )
- 2.10 GetAmbientColor ( self, strMeshName, strMaterialName )
- 2.11 GetDiffuseColor ( self, strMeshName, strMaterialName)
- 2.12 GetGlossinessWeight ( self, strMeshName, strMaterialName)
- 2.13 GetMaterialNames ( self, strMeshName )
- 2.14 GetOpacity ( self, strMeshName, strMaterialName )
- 2.15 GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )
- 2.16 GetSpeculaRColor ( self, strMeshName, strMaterialName )
- 2.17 GetSpecularWeight ( self, strMeshName, strMaterialName )
- 2.18 GetTextureWeights ( self, strMeshName, strMaterialName )
- 2.19 GetUvData ( self, strMeshName, strMaterialName, eChannel, kUvOffest, kUvTile, fUvRotate )
- 2.20 GetVideoVolume ( self, strMeshName, strMaterialName, eChannel )
- 2.21 LoadImageToTexture ( self, strMeshName, strMaterialName, eChannel, strImagePath )
- 2.22 LoadVideoToTexture ( self, strMeshName, strMaterialName, eChannel, strVideoPath )
- 2.23 RemoveUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel )
- Main article: Modules.
- Last modified: 04/9/2020
Description
This class is used to manipulate material surface properties. The main material properties are Ambient color, Diffuse color, Specular color, Glossiness value, Self-illumination value, Opacity value, textures, and more. A material is affiliated with an object, therefore, member functions of this class must specify a mesh and material name.
Inheritance
RIBase > RIMaterialComponent
Member Functions
AddAmbientKey ( self, kKey, strMeshName, strMaterialName, kColor )
Add an Ambient key for the material according to the time and Transition Type of kKey.
See Also: AddDiffuseKey, AddGlossinessKey, AddOpacityKey, AddSelfIlluminationKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddUvDataKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- kColor [IN] The color of a material’s ambient component - RRgb
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Add an ambient key value
material_component.AddAmbientKey(key, mesh_name, material_name, RLPy.RRgb.RED)
AddDiffuseKey ( self, kKey, strMeshName, strMaterialName, kColor )
Add a Diffuse key for the material according to the time and Transition Type of kKey.
See Also: AddAmbientKey, AddGlossinessKey, AddOpacityKey, AddSelfIlluminationKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddUvDataKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key to add a diffuse key value - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- kColor [IN] The color for diffuse - RRgb
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Add a diffuse key value
material_component.AddDiffuseKey(key, mesh_name, material_name, RLPy.RRgb.RED)
AddGlossinessKey ( self, kKey, strMeshName, strMaterialName, fWeight )
Add a Glossiness key for the material according to the time and Transition Type of kKey.
See Also: AddAmbientKey, AddDiffuseKey, AddOpacityKey, AddSelfIlluminationKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddUvDataKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- fWeight [IN] The weight for glossiness - float [0~100]
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Add a glossiness key value
material_component.AddGlossinessKey(key, mesh_name, material_name, 0.5)
AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )
Add a Specular key for the material according to the time and Transition Type of kKey.
See Also: AddAmbientKey, AddDiffuseKey, AddGlossinessKey, AddOpacityKey, AddSelfIlluminationKey, AddTextureWeightKey, AddUvDataKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- kColor [IN] The color for specular - RRgb
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Add a specular key value
material_component.AddSpecularKey(key, mesh_name, material_name, RLPy.RRgb.RED)
AddSelfIlluminationKey ( self, kKey, strMeshName, strMaterialName, kColor )
Add a Self-illumination key for the material according to the time and Transition Type of kKey.
See Also: AddAmbientKey, AddDiffuseKey, AddGlossinessKey, AddOpacityKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddUvDataKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key for time and transition control - RKey
strMeshName [IN] Name of the mesh - string strMaterialName [IN] Name of a mesh material - string fWeight [IN] The weight for self-illumination - float [0~100]
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Add a self-illumination key value
material_component.AddSelfIlluminationKey(key, mesh_name, material_name, 0.5)
AddOpacityKey ( self, kKey, strMeshName, strMaterialName, fWeight )
Add an Opacity key for the material according to the time and Transition Type of kKey.
See Also: AddAmbientKey, AddDiffuseKey, AddGlossinessKey, AddSelfIlluminationKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddUvDataKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- fWeight [IN] The weight for opacity - float [0~100]
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Add a opacity key value
material_component.AddOpacityKey(key, mesh_name, material_name, 0.5)
AddTextureWeightKey ( self, kKey, strMeshName, strMaterialName, eChannel, fWeight )
Add a Texture Channel Weight key for the material according to the time and Transition Type of kKey.
See Also: AddAmbientKey, AddDiffuseKey, AddGlossinessKey, AddOpacityKey, AddSelfIlluminationKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddUvDataKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
- fWeight [IN] The weight for channel - float [0~100] ui 上是 0~100, 傳到核心沒乘 0.01
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Modify texture weight
texture_channel = RLPy.EMaterialTextureChannel_Diffuse
diffuse_weight = 0.1
material_component.AddTextureWeightKey(key, mesh_name, material_name,
texture_channel, diffuse_weight)
AddUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate )
Add an UV Texture Coordinates key for the material according to the time and Transition Type of kKey. This key can be used to set the texture channel's UV offset, tile, and rotate values.
See Also: AddAmbientKey, AddDiffuseKey, AddGlossinessKey, AddOpacityKey, AddSelfIlluminationKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddVideoVolumeKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
- kUvOffset [IN] The uv's offset for channel - RLPy.RVector2f
- kUvTile [IN] The uv's tile for channel - RLPy.RVector2f
- fUvRotate [IN] The uv's rotate for channel ( radians) - float
Return
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Modify uv data
texture_channel = RLPy.EMaterialTextureChannel_Bump
uv_offset = RLPy.RVector2(0.1, 0)
uv_tile = RLPy.RVector2(1, 1)
uv_rotate = 3.14
material_component.AddUvDataKey(key, mesh_name, material_name,
texture_channel, uv_offset, uv_tile, uv_rotate)
AddVideoVolumeKey ( self, kKey, strMeshName, strMaterialName, eChannel, fVol, bMute )
Add a Video Volume key for the material according to the time and Transition Type of kKey. This key can be used to set the video material's channel video volume.
See Also: AddAmbientKey, AddDiffuseKey, AddGlossinessKey, AddOpacityKey, AddSelfIlluminationKey, [[#AddSpeculaRKey ( self, kKey, strMeshName, strMaterialName, kColor )|AddSpecularKey]], AddTextureWeightKey, AddUvDataKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
- fVol [IN] The volume of video ( 0-100 ) - float
- bMute [IN] mute - bool
Return
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Load video to material channel
texture_channel = RLPy.EMaterialTextureChannel_Bump
video_file = "C://MaterialVideoTest.mp4"
video_volume = 50
is_mute = False
material_component.LoadVideoToTexture(key, mesh_name, material_name,
texture_channel, video_file)
material_component.AddVideoVolumeKey(key, mesh_name, material_name,
texture_channel, video_volume, is_mute)
GetAmbientColor ( self, strMeshName, strMaterialName )
Get the material's Ambient color.
See Also: GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetTextureWeights, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
Returns
- ambient color - RRgb
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get ambient color
print(material_component.GetAmbientColor(mesh_name, material_name))
GetDiffuseColor ( self, strMeshName, strMaterialName)
Get the material's Diffuse color.
See Also: GetAmbientColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetTextureWeights, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
Returns
- diffuse color - RRgb
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get diffuse color
print(material_component.GetDiffuseColor(mesh_name, material_name))
GetGlossinessWeight ( self, strMeshName, strMaterialName)
Get the material's Glossiness weight.
See Also: GetMaterialNameParameters
Parameters
- strMeshName [IN] Name for the mesh - string
- strMaterialName [IN] Name of the material on the mesh - string
Returns
- weight of specular - float
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get glossiness weight
print(material_component.GetGlossinessWeight(mesh_name, material_name))
GetMaterialNames ( self, strMeshName )
Get all the material names for the mesh.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetOpacity, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetTextureWeights, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
Returns
- material names - string list.
# Get Object mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
GetOpacity ( self, strMeshName, strMaterialName )
Get the material opacity value.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetTextureWeights, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
Returns
- weight of opacity - float
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get opacity
print(material_component.GetOpacity(mesh_name, material_name))
GetSelfIlluminationWeight ( self, strMeshName, strMaterialName )
Get the material's self-illumination weight.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetTextureWeights, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
Returns
- weight of self-illumination - float
( Experimental API )
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get self-illumination weight
print(material_component.GetSelfIlluminationWeight(mesh_name, material_name))
GetSpeculaRColor ( self, strMeshName, strMaterialName )
Get the material's Specular color.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, GetSelfIlluminationWeight, GetSpecularWeight, GetTextureWeights, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
Returns
- Specular color - RRgb
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get specular color
print(material_component.GetSpecularColor(mesh_name, material_name))
GetSpecularWeight ( self, strMeshName, strMaterialName )
Get the material's Specular weight.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetTextureWeights, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
Returns
- Specular weight - float
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get specular weight
print(material_component.GetSpecularWeight(mesh_name, material_name))
GetTextureWeights ( self, strMeshName, strMaterialName )
Get all texture channel weights for the material.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetUvData, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
Returns
- Ordered list of all texture channel weights - float list
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get all texture weights
temp_texture_weight_list = material_component.GetTextureWeights(mesh_name, material_name)
print(temp_texture_weight_list)
GetUvData ( self, strMeshName, strMaterialName, eChannel, kUvOffest, kUvTile, fUvRotate )
Get all texture channel UV coordinates (offset, tiling, rotation) for the material.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetTextureWeights, GetVideoVolume
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
- kUvOffset [OUT] UV offset - RVector2
- kUvTile [OUT] UV tiling - RVector2
- fUvRotate [OUT] UV rotation in radians- float
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get UV data
uv_offset = RLPy.RVector2()
uv_tile = RLPy.RVector2()
uv_rotate = 0.0
uv_data = material_component.GetUvData(mesh_name, material_name, texture_channel, uv_offset, uv_tile, uv_rotate)
print(uv_data[0])
GetVideoVolume ( self, strMeshName, strMaterialName, eChannel )
Get the video volume for all the video channels of the material.
See Also: GetAmbientColor, GetDiffuseColor, GetGlossinessWeight, GetMaterialNames, GetOpacity, GetSelfIlluminationWeight, [[#GetSpeculaRColor ( self, strMeshName, strMaterialName )|GetSpecularColor]], GetSpecularWeight, GetTextureWeights, GetUvData
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
Returns
- video volume - float
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Get video volume
texture_channel = RLPy.EMaterialTextureChannel_Bump
print(material_component.GetVideoVolume(mesh_name, material_name, texture_channel))
LoadImageToTexture ( self, strMeshName, strMaterialName, eChannel, strImagePath )
Import an image into a material texture channel.
See Also: LoadVideoToTexture
Parameters
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
- strImagePath [IN] Image file path - string
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
#Load image to material channel
texture_channel = RLPy.EMaterialTextureChannel_Diffuse
image_file = "C://diffuse.png"
result = material_component.LoadImageToTexture(mesh_name, material_name, texture_channel, image_file)
LoadVideoToTexture ( self, strMeshName, strMaterialName, eChannel, strVideoPath )
Import a video into a material texture channel.
See Also: LoadImageToTexture
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
- strVideoPath [IN] Video file path - string
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Load video to material channel
texture_channel = RLPy.EMaterialTextureChannel_Bump
video_file = "C://MaterialVideoTest.mp4"
material_component.LoadVideoToTexture(key, mesh_name, material_name, texture_channel, video_file)
RemoveUvDataKey ( self, kKey, strMeshName, strMaterialName, eChannel )
Remove an UV data key from a material texture channel.
See Also: AddUvDataKey
Parameters
- kKey [IN] The key for time and transition control - RKey
- strMeshName [IN] Name of the mesh - string
- strMaterialName [IN] Name of a mesh material - string
- eChannel [IN] A material texture channel - RLPy.EMaterialTextureChannel
- RLPy.EMaterialTextureChannel_Metallic
- RLPy.EMaterialTextureChannel_Diffuse
- RLPy.EMaterialTextureChannel_Specular
- RLPy.EMaterialTextureChannel_Shininess
- RLPy.EMaterialTextureChannel_Glow
- RLPy.EMaterialTextureChannel_Displacement
- RLPy.EMaterialTextureChannel_Opacity
- RLPy.EMaterialTextureChannel_DiffuseBlend
- RLPy.EMaterialTextureChannel_Bump
- RLPy.EMaterialTextureChannel_Reflection
- RLPy.EMaterialTextureChannel_Refraction
- RLPy.EMaterialTextureChannel_Cube
- RLPy.EMaterialTextureChannel_AmbientOcclusion
- RLPy.EMaterialTextureChannel_Quantity
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get object, mesh and material
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
material_component = avatar.GetMaterialComponent()
mesh_list = avatar.GetMeshNames()
mesh_name = mesh_list[0]
material_list = material_component.GetMaterialNames(mesh_name)
material_name = material_list[0]
# Create a key
key = RLPy.RKey()
key.SetTime(RLPy.RTime(1200))
# Remove UV data key
texture_channel = RLPy.EMaterialTextureChannel_Bump test other channel
material_component.RemoveUvDataKey(key, mesh_name, material_name, texture_channel)