We have a script to load/overwrite the images of about 10 materials in one take id, to update the materials across our entire project. Here is the script we have entered, but the files are not updating as they should. The scripting is place on a Text Object that we would manually enter, or datalinq, say "DAL", for the Dallas Mavericks, and files in our NBA folder labeled to match. 90% of the time we use a datalinq to load the team Tricode, but for special games, we need to manually enter a 4 digit code, IE "OKCN" (vs, "OKC") for a secondary set of logos and colors.
File name protocol:
DAL_L0.png
DAL_L1.png
DAL_L2.png
DAL_C1.png
DAL_C2.png
DAL_C3.png
DAL_C4.png
Script on AWAY text object:
dim L0, L1, L2, C1, C2, C3, C4 as xpBaseObject
dim L0mat, L1mat, L2mat, C1mat, C2mat, C3mat, C4mat as xpMaterial
dim L0shade, L1shade, L2shade, C1shade, C2shade, C3shade, C4shade as xpBaseShader
scene.GetObjectByName("AWAY_L0", L0)
L0.GetMaterial(0,L0mat)
L0.GetShader(0, L0shade)
scene.GetObjectByName("AWAY_L1", L1)
L1.GetMaterial(0,L1mat)
L1.GetShader(0, L1shade)
scene.GetObjectByName("AWAY_L2", L2)
L2.GetMaterial(0, L2mat)
L2mat.GetShader(0, L2shade)
scene.GetObjectByName("AWAY_C1", C1)
C1.GetMaterial(0, C1mat)
C1mat.GetShader(0, C1shade)
scene.GetObjectByName("AWAY_C2", C2)
C2.GetMaterial(0, C2mat)
C2mat.GetShader(0, C2shade)
scene.GetObjectByName("AWAY_C3", C3)
C3.GetMaterial(0, C3mat)
C3mat.GetShader(0, C3shade)
scene.GetObjectByName("AWAY_C4", C4)
C4.GetMaterial(0, C4mat)
C4mat.GetShader(0, C4shade)
L0shade.SetFileName("D:\NBA\" & text & "_L0.PNG")
L1shade.SetFileName("D:\NBA\" & text & "_L1.PNG")
L2shade.SetFileName("D:\NBA\" & text & "_L2.PNG")
C1shade.SetFileName("D:\NBA\" & text & "_C1.PNG")
C2shade.SetFileName("D:\NBA\" & text & "_C2.PNG")
C3shade.SetFileName("D:\NBA\" & text & "_C3.PNG")
C4shade.SetFileName("D:\NBA\" & text & "_C4.PNG")
Script on HOME text object:
dim L0, L1, L2, C1, C2, C3, C4 as xpBaseObject
dim L0mat, L1mat, L2mat, C1mat, C2mat, C3mat, C4mat as xpMaterial
dim L0shade, L1shade, L2shade, C1shade, C2shade, C3shade, C4shade as xpBaseShader
scene.GetObjectByName("HOME_L0", L0)
L0.GetMaterial(0,L0mat)
L0.GetShader(0, L0shade)
scene.GetObjectByName("HOME_L1", L1)
L1.GetMaterial(0,L1mat)
L1.GetShader(0, L1shade)
scene.GetObjectByName("HOME_L2", L2)
L2.GetMaterial(0, L2mat)
L2mat.GetShader(0, L2shade)
scene.GetObjectByName("HOME_C1", C1)
C1.GetMaterial(0, C1mat)
C1mat.GetShader(0, C1shade)
scene.GetObjectByName("HOME_C2", C2)
C2.GetMaterial(0, C2mat)
C2mat.GetShader(0, C2shade)
scene.GetObjectByName("HOME_C3", C3)
C3.GetMaterial(0, C3mat)
C3mat.GetShader(0, C3shade)
scene.GetObjectByName("HOME_C4", C4)
C4.GetMaterial(0, C4mat)
C4mat.GetShader(0, C4shade)
L0shade.SetFileName("D:\NBA\" & text & "_L0.PNG")
L1shade.SetFileName("D:\NBA\" & text & "_L1.PNG")
L2shade.SetFileName("D:\NBA\" & text & "_L2.PNG")
C1shade.SetFileName("D:\NBA\" & text & "_C1.PNG")
C2shade.SetFileName("D:\NBA\" & text & "_C2.PNG")
C3shade.SetFileName("D:\NBA\" & text & "_C3.PNG")
C4shade.SetFileName("D:\NBA\" & text & "_C4.PNG")
Template Preview:
Files on backend:
------------------------------
Sara Groover
Graphics Producer
Oklahoma City United States
------------------------------