I need some help with scripting. I've written the script below with examples from the forum, but I'm uncertain about the order of things.
Document1 is an image added from ENPS Xpression plugin
Doc1PathReport is just to get the file path of image in Document1
...and that part works, thanks to @bford
Then, I need a shaded version of Document1...I made a material (Document1Gradient) with the image (shader: Document1Image) and a gradient to accomplish that and applied it to a quad...Document1Shaded.
In visual logic, I link Doc1PathReport.text to Doc1Path.text.
My script will compile, but doesn't replace the image in the shader.
Can anybody see what I'm doing wrong? Is what I want even possible?
Thanks in advance,
James.
Dim Document1 as xpBaseObject
Dim Mat as xpMaterial
Dim Shader as xpBaseShader
Dim Doc1PathReport as xpTextObject
Self.GetObjectByName("Document1", Document1)
Self.GetObjectByName("Doc1PathReport", Doc1PathReport)
If Document1.GetMaterial(0,Mat) then
If Mat.GetShader(0,Shader) then
Doc1PathReport.text=shader.FileName
end if
end if
Dim Document1Shaded as xpBaseObject
Dim Document1Gradient as xpMaterial
Dim Document1Image as xpBaseShader
Dim Doc1Path as xpTextObject
Self.GetObjectByName("Document1Shaded", Document1Shaded)
Self.GetMaterialByName("Document1Gradient", Document1Gradient)
Self.GetShaderByName("Document1Image", Document1Image)
Self.GetObjectByName("Doc1Path", Doc1Path)
If Document1Shaded.GetMaterial(0,Document1Gradient) then
If Document1Gradient.GetShader(0,Document1Image) then
Shader.SetFileName("Doc1Path.Text")
end if
end if