Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.


    OakCorp Japan - Yuji Yamauchi
    oakcorp.net
    v-ray.jp

  • #2
    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[n] (where n = the slot id).

    If you change your code like this, it should work:
    Code:
    $.material.texmap_diffuse.addSubtex 80
    for i = 1 to 100 do
    (
    execute ("$.material.texmap_diffuse.texmap_color["+ i as string + "]" = (color 0 0 0)")
    )
    Miroslav Ivanov
    Chaos Cosmos

    Comment


    • #3
      thank you for the advice.
      I learned a lot.

      OakCorp Japan - Yuji Yamauchi
      oakcorp.net
      v-ray.jp

      Comment

      Working...
      X