Quantcast
Viewing all articles
Browse latest Browse all 5776

Material name to match Layer name

@soccerbatman wrote:

Hi everyone, I have been trying to make a script that materials names match their layers names. Here is what I have and it does not work:

import rhinoscriptsyntax as rs

def LayerNameToMaterial():
layers = rs.LayerNames()

for i in layers:
    objs = rs.ObjectsByLayer(i)
    index = rs.ObjectMaterialIndex(objs)
    if index==0:
        rs.MaterialName(objs, i)

LayerNameToMaterial()

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5776

Trending Articles