Problem when creating new vray material using Ruby api

I created a material using below 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?


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:

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