Announcement

Collapse
No announcement yet.

Rhinoscript + Vray Material Access

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

  • Rhinoscript + Vray Material Access

    Versions: Rhino 7, V-Ray 5

    I'm scripting the conversion of a massive library of globeplants.com species from SKP to Rhino and the last step is to apply imported V-Ray materials to Rhino layers. I just cannot find any solid documentation on V-Ray scripting within Rhinoscript and the only limited information is from the V-Ray Script Access page.

    Dim vray, materials
    Set vray = Rhino.GetPlugInObject("V-Ray for Rhino")
    materials = vray.Scene.Materials

    I just can't access the Materials array to identify names, indexes and apply to Rhino layers. Would there be any documentation that would provide deeper access to classes, methods, etc.

  • #2
    You should be able to do that with layer.RenderMaterial property without having to go through Vray.

    https://developer.rhino3d.com/api/Rh...erialIndex.htm

    Not sure about the syntax in Rhinoscript, but in python getting the materials array is something like this:

    RenderMats = [rm for rm in scriptcontext.doc.RenderMaterials]

    All the Vray materials should be there.

    Hope that helps.

    Comment


    • #3
      Thanks for the reply; however, when I import the vrmat it does not get applied to the layer ... so the Layer.RenderMaterial is not of use. The V-Ray materials don't even get registered with the Rhino Material Table and therefore, I cannot access them and I need to work out how to read the vray.Scene.Materials array in order to apply to matching Layers.

      Comment

      Working...
      X