anicg Posted April 9, 2020 Share Posted April 9, 2020 I'd like to create and assign materials using the object names, for objects that have the display flag on, each object gets a principled shader created using its name and assigned to it Quote Link to comment Share on other sites More sharing options...
anim Posted April 9, 2020 Share Posted April 9, 2020 this should get you started matnet = hou.node("/mat") objs = hou.node("/obj").recursiveGlob("*", filter=hou.nodeTypeFilter.Obj) for obj in objs: if obj.type().name() == "geo" and obj.isDisplayFlagSet(): safename = "_".join(obj.path().split("/")[2:]) mat = matnet.createNode("principledshader", safename) obj.parm("shop_materialpath").set(mat.path()) matnet.layoutChildren() 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.