I’m hoping this is very easy and I am just being thick, but I seem to be unable to work out how to add a texture map to the diffuse channel of a Vray material via Maxscript. Is this easy enough?? Basically I want to add maps to diffuse and opacity automatically. This is how I am adding it when using a standard material :
You can use the showproperties MaxScript function to list all available MaxScript properties of the V-Ray material. For the diffuse texture in particular, you could use something like this:theMaterial.texmap_diffuse=bitmapTex bitmap:theMap
Just for “best coding practices”, it’s always best to test to make sure a property exists before attempting to change/set it. For instance
mat = meditMaterials[1]
if (isProperty mat "texmap_diffuse") then
-- change or do something to the mat.texmap_diffuse (like assign a new bitmap texture)
else
format "Mat: [%] does not have a property 'texmap_diffuse'\n" mat.name