J_spad Posted June 25, 2014 Share Posted June 25, 2014 Hello, I have a imported alembic file with many objects that I would like to assign a shadow matte shader to. I do not want to have to drag that shader or assign it per object. Could anyone help me write a script to do this? I do not know the hou modal well. somthing like... myNodes = {GET ALL NODES AND CHILDREN IN ALIMBIC} for myNode in myNodes: if {myNode is a geo object} {assign shader} Quote Link to comment Share on other sites More sharing options...
old school Posted June 25, 2014 Share Posted June 25, 2014 If you are just doing a pass-through render of the Alembic primitives, why not load the entire Alembic Archive in to the scene using a single object and an Alembic SOP referencing the archive. Then spend a Pack Edit SOP and assign your Shadow Matte Shader to all the alembic primitives (leave group field blank). While you are at it, move the display flag to the Pack Edit SOP and open up a Data Tree pane set to the Object Appearance plug-in option and try the assignment there as well. Quote Link to comment Share on other sites More sharing options...
J_spad Posted June 25, 2014 Author Share Posted June 25, 2014 Well I feel silly now! That did the trick. I would still like to see an example of that script for educational purposes if anyone has time. I am stuck on filtering the node types into a list. Quote Link to comment Share on other sites More sharing options...
anim Posted June 25, 2014 Share Posted June 25, 2014 Well I feel silly now! That did the trick. I would still like to see an example of that script for educational purposes if anyone has time. I am stuck on filtering the node types into a list. it would be something like this root = hou.node("/obj/alembicarchive1") matpath = "/shop/shadowmatte" geonodes = root.recursiveGlob("*", hou.nodeTypeFilter.ObjGeometry ) for geo in geonodes: matparm = geo.parm("shop_materialpath") if matparm: matparm.set( matpath ) 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.