Render_material.Name = "Double-Sided Material " + ().ToString()įront_material = ( The creationįunction that creates the material as child to a parent content using the given The BeginChange() and EndChange() bracket of render_material. Note that the front_material and back_material instances are created within Is possible to do so with a script names should really be unique.
This so we don't end up with materials that have the same name. We set a name suffixed with a new GUID each time this material is created by the Programmatical changes to the render content because it is already in the Once we have a material we need to bracket any changes we want to make betweenīeginChange() and EndChange() calls. Weĭon't need much else besides the render content GUID and the document. To create the double-sided parent material we use RenderContent.Create. # only if we have a selection do the work if object_selection: We'll create and assign the material only when there is an object selection. The front and back slots we'll be using RenderContent.Create(Guid type, RenderContent parent, string childSlotName, RenderContent.ShowContentChooserFlags flags, RhinoDoc doc). To create render materials as the child content for the double-sided material in
Such materials will be set as child content to This means we need toĬreate these materials as well. In other words it will show up in theĪ double-sided material references two other materials. Using one of these overloads will result in the material being created andĪdded to the persistent content list. Type has the GUID E6CD1973-B739-496E-AB69-32957FA48492.Ī new instance we create with one of the static method RenderContent.Create() In the tag you'll find theįollowing these steps give us the information we need: a double-sided material Manually in Rhino, then save the material as a file. To figure out what the GUID of the double-sided material type is I create one One can find many GUIDsīut unfortunately the double-sided material GUID is not exposed through the API To create a double-sided material type we are going to use RenderMaterial fromĪ GUID is needed to create a material of a specific type. Written by Nathan 'jesterKing' Letwory Introduction