Accessing materials from Material palette from Python

   4314   2   0
User Avatar
Member
2 posts
Joined: Nov. 2009
Offline
I'm writing a Python script for terrain generation and would like to use a basic_displacement which you can find in the Material palette. Using the normal workflow, it is very easy to get hold of it, but how can I create it through Python?

It does not seem to be a primitive object, so something like
hou.node(“/shop”).createNode(“basic_displacement”)
does not work.

Any ideas are appreciated.
User Avatar
Member
8161 posts
Joined: July 2005
Offline
gal_entry = hou.galleries.galleryEntries('basic_displacement')
gal_entry.createChildNode(hou.node(“/shop”))
User Avatar
Member
2 posts
Joined: Nov. 2009
Offline
Thank you, that solutions works for me.
  • Quick Links