usdmaterialpath within SOP Modify

   325   1   2
User Avatar
Member
8 posts
Joined: Feb. 2014
Offline
Within a SOP_Modify I'm using a python node to access the usdmaterialpath attribute of imported geo. This gives me the material path as a lop/usd path (/materials/materialName).

I would like to access that material (within this SOP_Modify) to query a few parameters of that material.

How do I resolve that path to that node within a SOP_Modify? How do I access that LOP material node's attributes via python within a SOP_Modify?

Thanks for any help.
User Avatar
Member
8 posts
Joined: Feb. 2014
Offline
Here's the simple/basic code to get the usd path. This is in a Python SOP inside a SOP Modify node. This is after a Material Library and Assign Material.

node = hou.pwd()
geo = node.geometry()

prims = geo.prims()
for primN in prims:
val = primN.attribValue('usdmaterialpath')
print( 'val', val )
  • Quick Links