RLPy.RIMaterialComponent
+ Inheritance diagram for RLPy.RIMaterialComponent:

Public Member Functions

def __init__ (self, args, kwargs)
 
def AddAmbientKey (self, kTime, strMeshName, strMaterialName, kColor)
 Add an ambient color key. More...
 
def AddDiffuseKey (self, kTime, strMeshName, strMaterialName, kColor)
 Add a diffuse color key. More...
 
def AddGlossinessKey (self, kTime, strMeshName, strMaterialName, fWeight)
 Add a glossiness weight key. More...
 
def AddSpecularKey (self, args)
 Add a specular weight key. More...
 
def AddSelfIlluminationKey (self, kTime, strMeshName, strMaterialName, fWeight)
 Add a self-illumination weight key. More...
 
def AddOpacityKey (self, kTime, strMeshName, strMaterialName, fWeight)
 Add an opacity key. More...
 
def AddTextureWeightKey (self, kTime, strMeshName, strMaterialName, eChannel, fWeight)
 Add a texture weight key. More...
 
def AddUvDataKey (self, kTime, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate)
 Add an uv data key. More...
 
def RemoveUvDataKey (self, kTime, strMeshName, strMaterialName, eChannel)
 Remove an uv data key. More...
 
def LoadVideoToTexture (self, kTime, strMeshName, strMaterialName, eChannel, strVideoPath)
 Remove an uv key. More...
 
def AddVideoVolumeKey (self, kTime, strMeshName, strMaterialName, eChannel, fVol, bMute)
 Remove an uv key. More...
 
def GetMaterialNames (self, strMeshName)
 Get material names. More...
 
def GetAmbientColor (self, strMeshName, strMaterialName)
 Get ambient color. More...
 
def GetDiffuseColor (self, strMeshName, strMaterialName)
 Get diffuse color. More...
 
def GetSpecularColor (self, strMeshName, strMaterialName)
 Get specular color. More...
 
def GetGlossinessWeight (self, strMeshName, strMaterialName)
 Get glossiness wight. More...
 
def GetSpecularWeight (self, strMeshName, strMaterialName)
 Get specular weight. More...
 
def GetSelfIlluminationWeight (self, strMeshName, strMaterialName)
 Get self-illumination weight. More...
 
def GetOpacity (self, strMeshName, strMaterialName)
 Get opacity. More...
 
def GetTextureWeights (self, strMeshName, strMaterialName)
 Get all channels weight of texture. More...
 
def GetUvData (self, strMeshName, strMaterialName, eChannel, kUvOffset, kUvTile, fUvRotate)
 Get all channels weight of texture. More...
 
def GetVideoVolume (self, strMeshName, strMaterialName, eChannel)
 Get volume of video. More...
 
- Public Member Functions inherited from RLPy.RIBase
def __init__ (self, args, kwargs)
 
def IsValid (self)
 Is valid or not. More...
 

Detailed Description

RIMaterialComponent.

( Experimental Class )

# 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]
# Modify material light
ambient_color = RLPy.RRgb.RED
diffuse_color = RLPy.RRgb.GREEN
specular_color = RLPy.RRgb.BLUE
material_component.AddAmbientKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, ambient_color)
print(material_component.GetAmbientColor(mesh_name, material_name))
material_component.AddDiffuseKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, diffuse_color)
print(material_component.GetDiffuseColor(mesh_name, material_name))
material_component.AddSpecularKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, specular_color)
print(material_component.GetSpecularColor(mesh_name, material_name))
glossiness = 70
specular = 300
self_illumination = 60
opacity = 45
material_component.AddGlossinessKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, glossiness)
print(material_component.GetGlossinessWeight(mesh_name, material_name))
material_component.AddSpecularKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, specular)
print(material_component.GetSpecularWeight(mesh_name, material_name))
material_component.AddSelfIlluminationKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, self_illumination)
print(material_component.GetSelfIlluminationWeight(mesh_name, material_name))
material_component.AddOpacityKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, opacity)
print(material_component.GetOpacity(mesh_name, material_name))
# Modify texture weight
texture_channel = RLPy.EMaterialTextureChannel_Diffuse
diffuse_weight = 0.0
material_component.AddTextureWeightKey(RLPy.RGlobal.GetTime(), mesh_name, material_name,
texture_channel, diffuse_weight)
temp_texture_weight_list = material_component.GetTextureWeights(mesh_name, material_name)
print(temp_texture_weight_list[int(texture_channel)])
# 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(RLPy.RGlobal.GetTime(), mesh_name, material_name,
texture_channel, uv_offset, uv_tile, uv_rotate)
temp_uv_offset = RLPy.RVector2()
temp_uv_tile = RLPy.RVector2()
temp_uv_data = material_component.GetUvData(mesh_name, material_name, texture_channel,
temp_uv_offset, temp_uv_tile, uv_rotate)
print(temp_uv_data[1]) # uv rotate
print(temp_uv_offset) # uv offset
print(temp_uv_tile) # uv tile
material_component.RemoveUvDataKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, texture_channel)
# Load video to material channel
texture_channel = RLPy.EMaterialTextureChannel_Bump
video_file = "C://MaterialVideoTest.mp4"
video_volume = 50
is_mute = False
material_component.LoadVideoToTexture(RLPy.RGlobal.GetTime(), mesh_name, material_name,
texture_channel, video_file)
material_component.AddVideoVolumeKey(RLPy.RGlobal.GetTime(), mesh_name, material_name,
texture_channel, video_volume, is_mute)
print(material_component.GetVideoVolume(mesh_name, material_name, texture_channel))

Member Function Documentation

§ AddAmbientKey()

def RLPy.RIMaterialComponent.AddAmbientKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  kColor 
)

Add an ambient color key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
kColor[IN] The color for ambient - RLPy.RRgb
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddDiffuseKey()

def RLPy.RIMaterialComponent.AddDiffuseKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  kColor 
)

Add a diffuse color key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
kColor[IN] The color for diffuse - RLPy.RRgb
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddGlossinessKey()

def RLPy.RIMaterialComponent.AddGlossinessKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  fWeight 
)

Add a glossiness weight key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
fWeight[IN] The weight for glossiness - float
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddOpacityKey()

def RLPy.RIMaterialComponent.AddOpacityKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  fWeight 
)

Add an opacity key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
fWeight[IN] The weight for opacity - float
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddSelfIlluminationKey()

def RLPy.RIMaterialComponent.AddSelfIlluminationKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  fWeight 
)

Add a self-illumination weight key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
fWeight[IN] The weight for self-illumination - float
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddSpecularKey()

def RLPy.RIMaterialComponent.AddSpecularKey (   self,
  args 
)

Add a specular weight key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
fWeight[IN] The weight for specular - float
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddTextureWeightKey()

def RLPy.RIMaterialComponent.AddTextureWeightKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  eChannel,
  fWeight 
)

Add a texture weight key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
eChannel[IN] The channel of texture - 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
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddUvDataKey()

def RLPy.RIMaterialComponent.AddUvDataKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  eChannel,
  kUvOffset,
  kUvTile,
  fUvRotate 
)

Add an uv data key.

( Experimental API )

Parameters
kTime[IN] The time at which to add the key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
eChannel[IN] The channel of texture - 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 ( -3.14 ~ 3.14 ) - float
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ AddVideoVolumeKey()

def RLPy.RIMaterialComponent.AddVideoVolumeKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  eChannel,
  fVol,
  bMute 
)

Remove an uv key.

( Experimental API )

Parameters
kTime[IN] Specifies the time to remove key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
eChannel[IN] The channel of texture - 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
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ GetAmbientColor()

def RLPy.RIMaterialComponent.GetAmbientColor (   self,
  strMeshName,
  strMaterialName 
)

Get ambient color.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
ambient color - RLPy.RRgb

§ GetDiffuseColor()

def RLPy.RIMaterialComponent.GetDiffuseColor (   self,
  strMeshName,
  strMaterialName 
)

Get diffuse color.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
diffuse color - RLPy.RRgb

§ GetGlossinessWeight()

def RLPy.RIMaterialComponent.GetGlossinessWeight (   self,
  strMeshName,
  strMaterialName 
)

Get glossiness wight.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
weight of specular - float

§ GetMaterialNames()

def RLPy.RIMaterialComponent.GetMaterialNames (   self,
  strMeshName 
)

Get material names.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
Return values
std::vector<std::wstring > material namse.

§ GetOpacity()

def RLPy.RIMaterialComponent.GetOpacity (   self,
  strMeshName,
  strMaterialName 
)

Get opacity.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
weight of opacity - float

§ GetSelfIlluminationWeight()

def RLPy.RIMaterialComponent.GetSelfIlluminationWeight (   self,
  strMeshName,
  strMaterialName 
)

Get self-illumination weight.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
weight of self-illumination - float

§ GetSpecularColor()

def RLPy.RIMaterialComponent.GetSpecularColor (   self,
  strMeshName,
  strMaterialName 
)

Get specular color.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
specular color - RLPy.RRgb

§ GetSpecularWeight()

def RLPy.RIMaterialComponent.GetSpecularWeight (   self,
  strMeshName,
  strMaterialName 
)

Get specular weight.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
weight of specular - float

§ GetTextureWeights()

def RLPy.RIMaterialComponent.GetTextureWeights (   self,
  strMeshName,
  strMaterialName 
)

Get all channels weight of texture.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
Returns
weight of opacity - float

§ GetUvData()

def RLPy.RIMaterialComponent.GetUvData (   self,
  strMeshName,
  strMaterialName,
  eChannel,
  kUvOffset,
  kUvTile,
  fUvRotate 
)

Get all channels weight of texture.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
eChannel[IN] The channel of texture - 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 - RLPy.RVector2f
kUvTile[OUT] uv tile - RLPy.RVector2f
fUvRotate[OUT] uv rotate - float
Return values
RLPy.RStatus.SuccessSuccess.
RLPy.RStatus.FailureFail.

§ GetVideoVolume()

def RLPy.RIMaterialComponent.GetVideoVolume (   self,
  strMeshName,
  strMaterialName,
  eChannel 
)

Get volume of video.

( Experimental API )

Parameters
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
eChannel[IN] The channel of texture - 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

§ LoadVideoToTexture()

def RLPy.RIMaterialComponent.LoadVideoToTexture (   self,
  kTime,
  strMeshName,
  strMaterialName,
  eChannel,
  strVideoPath 
)

Remove an uv key.

( Experimental API )

Parameters
kTime[IN] Specifies the time to remove key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
eChannel[IN] The channel of texture - 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] The file path of video - string
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail

§ RemoveUvDataKey()

def RLPy.RIMaterialComponent.RemoveUvDataKey (   self,
  kTime,
  strMeshName,
  strMaterialName,
  eChannel 
)

Remove an uv data key.

( Experimental API )

Parameters
kTime[IN] Specifies the time to remove key - RLPy.RTime
strMeshName[IN] The name for mesh - string
strMaterialName[IN] The name for material of mesh - string
eChannel[IN] The channel of texture - 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
Return values
RLPy.RStatus.SuccessSuccess
RLPy.RStatus.FailureFail