Layered texture changes via script don't update in Iray

quindorquindor Posts: 4


I'm trying to make a simple code which loads an image in a layer of a layered texture. It does work so far with the Filament viewport renderer, but Iray simply ignores the new maps. CTRL-I doesn't help, changing the viewport render and go back to iray neither. I have to open the LIE and click accept. However, the small property icon changes instantly to the new map after running the script.

Can someone please help me to make this work?

var ContentMgr = App.getContentMgr();
var ImgMgr = App.getImageMgr();

var node = Scene.getPrimarySelection();

var Properties = ["Tip Transmission Color", "Root Transmission Color", "Hair Root Color", "Hair Tip Color"];

var Color01_Path = ContentMgr.getAbsolutePath("./Runtime/Textures/Color01.jpg", true);

for(i = 0; i <= 3; i++) {

	var LayeredImg = node.getObject().getCurrentShape().findMaterial("default").findProperty(Properties[i]).getMapValue();
	LayeredImg.getLayer(0).imageFile = Color01_Path;


thank you very much!

Post edited by quindor on


Sign In or Register to comment.