Load a material from file and assign to layer

I am fairly new to scripting and brazil. Is there a way to load a Brazil material from file and assign it to a layer using vb script? I am using rhino 4 if it makes a difference. Thank you.

Views: 380

Reply to This

Replies to This Discussion


Here are the RDK scripting functions: http://wiki.mcneel.com/developer/rdkrhinoscripting

You will need "ContentLoadFromFile" and "SetMaterialInstanceId" - note that you will have to use Rhinoscript methods to get at the layer material index.

 - Andy

Thank you. Following your pointers, I did this and it seems to work fine:

Function blnLoadMaterial(strFileName,strLayerName)
  Set objRDK = Rhino.getPlugInObject("Renderer Development Kit")
  strID = objRDK.contentLoadFromFile(strFileName)
  intIndex = Rhino.addMaterialToLayer(strLayerName)
  blnLoadMaterial = objRDK.SetMaterialInstanceId(strID, intIndex)
End Function

Reply to Discussion



  • Add Videos
  • View All


© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service