Setting Surface Diffuse Color Image (Solved)

I have a simple plane with an image on it.  When I run the script, I would like the replace the currest diffuse color image with the next image in a series.

I'm just getting started in DAZ scripting and although I have a good background in JS and other programming languages I can't seem to get this to work.

1. The idea wold be to read the current image name from the selected plane's diffuse color image.
2. Pull the name of the image file from the plane's surfaece.
3. From the exposed string obtain the last two chars into a string variable and convert it  to a number.and put that in another variable.
3. Add 1 to the result, convert it back to a string and concat it to the image file name.
4. Finally save that back to the plane's surface diffuse color image.

First I decided to see if I could just get the surface diffuse color..

I tried something like...

var obj = item.getObject();

var shp = obj.getCurrentShape();

var mat = shp.getAllMaterials();

But then I don't know how to set the image of the Diffuse Color...

Anyone got the time to help?

Post edited by cheznous2029_28ab1adedc on
Sign In or Register to comment.