With MaxScript I can not access more than 20 slots with VrayMultiSub tex.

With MaxScript I can not access more than 20 slots with VrayMultiSub tex.

For example, the following script will cause an error.
(Assign VrayMultiSub map to Diffuse of VrayMtl and run)

$.material.texmap_diffuse.addSubtex 80
for i = 1 to 100 do
(
execute (“$.material.texmap_diffuse.color_”+ i as string +" = (color 0 0 0)")
)

work with i = 1 to 20

Please advice how to access more than 20 slots.

The reason it doesn’t work is that you’re iterating the aliases for the subtexture slots property (which are defined up until the default value of 20) instead of the actual property.
In short - $.material.texmap_diffuse.color_n instead of $.material.texmap_diffuse.texmap_color (where n = the slot id).

If you change your code like this, it should work:

$.material.texmap_diffuse.addSubtex 80
for i = 1 to 100 do
(
execute ("$.material.texmap_diffuse.texmap_color["+ i as string + "]" = (color 0 0 0)")
)

thank you for the advice.
I learned a lot.