Announcement

Collapse
No announcement yet.

Problem when creating new vray material using Ruby api

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

  • Problem when creating new vray material using Ruby api

    I created a material using below code:

    Code:
    context = VRay::Context.active
    scene = context.scene
    
    scene.change{
    my_material_plugin = scene.create(:MtlSingleBRDF, '/MyMaterialPlugin')
    my_material_plugin[:brdf] = scene.create(:BRDFVRayMtl, '/vray')
    }
    But the mtl created by above code is not similar to the vraymtl created manually (please see image below)
    How can I fix this?


    Click image for larger version

Name:	New Project.png
Views:	289
Size:	91.6 KB
ID:	1202508

  • #2
    There is a specific naming convention plugins have to follow in order to express ownership. Child pluigns should be namespaced under their parent plugins: /parent/child/grand_child

    Try changing last line to:

    Code:
    my_material_plugin[:brdf] = scene.create(:BRDFVRayMtl, '/MyMaterialPlugin/vray')

    Comment

    Working...
    X