Grasshopper

algorithmic modeling for Rhino

Hi

Does anyone have a script to add a default rhino materials to a document. (If the script also specifies the ambient colour even better!)

I just want to add them so they are visible in the material table and not applied to an object.

I'll add them to objects later on through gh. I just want to set up the rhino document first.

Thankyou.

Views: 1231

Replies to This Discussion

Hi John,

a developer of Materials told me:

In RhinoCommon, you can do:

RhinoDoc.ActiveDoc.RenderMaterials.Add()

And you can create a material using

RenderMaterial.CreateBasicMaterial()

In rhinoscript there are a few meethods for Materials. You can change the target of the rhinoscriptsyntax functions with

import Rhino

import scriptcontext as sc

sc.doc = Rhino.RhinoDoc.ActiveDoc

after this, you can run normal rhinoscriptsyntax functions in GhPython, too.

Thanks

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Thank you Giulio.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service