Hey Steve,
This script will copy the material from the first object and make a mask for you on the second.
dim PlayerImg, PlayerMask as xpBaseObject
dim PlayerImgMat, PlayerMaskMat as xpMaterial
dim PlayerImgSha, PlayerMaskSha as xpBaseShader
dim FilePath as String
'get file from image-----------------------------
Self.GetObjectByName("Player_Img_RGB", PlayerImg)
PlayerImg.GetMaterial(0, PlayerImgMat)
PlayerImgMat.GetShader(0, PlayerImgSha)
FilePath = PlayerImgSha.FileName
'set file to mask--------------------------------
Self.GetObjectByName("Player_Mask_1", PlayerMask)
PlayerMask.GetMaterial(0, PlayerMaskMat)
PlayerMaskMat.GetShader(0, PlayerMaskSha)
PlayerMaskSha.SetFileName(FilePath)
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
------------------------------
Original Message:
Sent: 11-04-2022 21:14
From: Steve Szeszycki
Subject: XPression: copy material texture to a mask material texture
Thanks Mal; it would be a case-by-case basis. I would not know the files names before actually getting the file. Looking back at my VL example I posted, I now know why that didn't work. I'm pretty sure what I want to achieve can be done with a script; I just don't know the right syntax.
------------------------------
Steve Szeszycki
XPresssion Operator
Los Angeles United States
Original Message:
Sent: 11-04-2022 12:09
From: Malcolm Thorpe
Subject: XPression: copy material texture to a mask material texture
How many different image files/mask files will you be using? Will you know the names of the image files before they are used? To my mind, it would be more of a logic/input selector job. You would have to use 2 input selectors, one for the image, one for the mask. That's about all I can come up with for now.
------------------------------
Malcolm Thorpe
Free Lance Xpression Designer/Carbonite TD
Original Message:
Sent: 11-03-2022 17:14
From: Steve Szeszycki
Subject: XPression: copy material texture to a mask material texture
Hello all, I have a scene with two materials that use the same PNG image file as a texture. 1. PICTURE material. 2. MASK material (set to Alpha Mask Inverted). I would like to change the image file on the picture material texture and have the MASK texture change as well. I tried this with Visual Logic (attached), to copy the face, but it copied the pictures settings as well; where I ended up with 2 pictures on my scene; and no mask. Can this not be done with visual logic? Only with scripting?
------------------------------
Steve Szeszycki
XPresssion Operator
Los Angeles United States
------------------------------