Announcement

Collapse
No announcement yet.

[maxscript] Rename material

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

  • [maxscript] Rename material

    Hello

    I am writing a little script, it configures max automatically at startup but i have a little problem, all the mtl have the same name. I want the same scheme like max "mtl01,mtl02...mtl24" How reproduce this iteration ?
    I tried the medit.materials instruction but it does'nt work

    any ideas

    Code:
    -- VRay is the default renderer
    renderers.current = RendererClass.classes[4]()
    
    -- VRay settings
    vr = renderers.current
    vr.gi_on = true
    vr.gi_secondary_type = 3 
    vr.gi_irradmap_showCalcPhase = true
    vr.gi_irradmap_minRate = -3
    vr.gi_irradmap_maxRate = -2
    vr.system_vrayLog_show = false
    
    -- VRay is used in the material editor
    renderers.medit_locked = true
    
    -- Change all standards mtl in VRay mtl
    for i = 1 to 24 do
    	 meditMaterials[i] = VRayMtl()
    In teapots we trust.

  • #2
    Hi,
    I would add this to iteration:
    meditMaterials[i].name = "mtl" + (i as String)

    Hope it works has i can't tested right now (doing some urgent test render for a work)
    Daniel Santana | Co-Founder / Technical Director
    You can do it! VFX
    Lisbon/Porto - Portugal
    http://www.ycdivfx.com

    Comment


    • #3
      it works perfectly, thanks
      In teapots we trust.

      Comment

      Working...
      X