Announcement

Collapse
No announcement yet.

VRayBlendMtl and setProperty function in maxscript issue

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

  • VRayBlendMtl and setProperty function in maxscript issue

    To set the required values ​​in the coat properties in VRayBlendMtl I use this code:
    Code:
    myBlendMat=VRayBlendMtl()
    myBitmapTexture=Checker()
    
    setProperty myBlendMat "blend_0" (color 50 50 50)
    setProperty myBlendMat "texmap_blend_0" myBitmapTexture
    setProperty myBlendMat "texmap_blend_mult_0" 50.0
    But nothing works and the values ​​do not change, although no errors appear.
    When I use the code below, everything works as expected:
    Code:
    meditMaterials[1].Blend[1]=(color 50 50 50)
    meditMaterials[1].texmap_blend[1]=myBitmapTexture
    meditMaterials[1].texmap_blend_multiplier[1]=50.0
    What could be the reason for such strange behavior of properties and how can I make the "setProperty" function work in VRayBlendMtl?​

  • #2
    Not sure if you can make it work with setProperty, since from what I notice the "blend_0", "blend_1", etc. derive from the "blend" array (i.e the VRayBlendMtl gets the info from the Blend array, whilst the individual "blend_x" parameters seem to be for read-only purposes). I am not sure if there's a method of reading part of the array as a property name. Otherwise, doing it the regular way works as expected:
    Code:
    myBlendMat=VRayBlendMtl()
    myBitmapTexture=Checker()
    
    myBlendMat.Blend[1] = (color 50 50 50)
    myBlendMat.texmap_blend[1] = myBitmapTexture
    myBlendMat.texmap_blend_multiplier[1]= 50.0​
    What's the reason for using setProperty?
    Aleksandar Hadzhiev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      this works:
      Code:
      (
          myBlendMat=VRayBlendMtl()
          myBitmapTexture=Checker()
      
          setProperty myBlendMat #baseMtl (vraymtl name:"myBaseMaterial")
          setProperty myBlendMat #coatMtl #((vraymtl name:"myRedCoatMaterial" diffuse:red), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined)
              
          setProperty myBlendMat #blend #(red, green, blue, white, black, orange, yellow, brown, gray)  
          setProperty myBlendMat #texmap_blend #(myBitmapTexture, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined)
          setProperty myBlendMat #texmap_blend_multiplier #( 50.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0)
      
          meditmaterials[1] = myBlendMat
      )
      ​
      It stands to reason that if the properties are also there individually, they should work.
      Perhaps it's a bug, perhaps it's a limitation, i'll ask the devs.
      Lele
      Trouble Stirrer in RnD @ Chaos
      ----------------------
      emanuele.lecchi@chaos.com

      Disclaimer:
      The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

      Comment

      Working...
      X