Kelleytoons (3/31/2019)
Chris,
I change opacity on materials all the time, so it's most likely something wrong in your code somewhere. I'm about ready to eat, but if Any Key doesn't beat me to it I'll post something that does work after that.Hi Mike
Yup just found it forgot to add a key here is the revised code that now works.
import RLPy
# Get Avatar 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)
time_line = RLPy.RGlobal_GetTime()
R_Key = RLPy.RKey()
R_Key.SetTime(RLPy.RTime(time_line))
for mesh in mesh_list:
print("****************")
print("Mesh List: {} ".format(mesh))
material_list = material_component.GetMaterialNames(mesh)
for mat in material_list:
print("Mat: {} ".format(mat))
# Set Materials Invisable here
material_component.AddOpacityKey(R_Key, mesh, mat, 0)
print("Finished...")
Chris