Jump to content

Accessing materials from Material palette from Python


erik

Recommended Posts

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.

Edited by erik
Link to comment
Share on other sites

While I see your point, are you sure that everybody who reads this forum reads the other one as well? In that case one of the forums are not needed. Otherwise it makes total sense for me to post in both forums because there might be knowledge there that does not exist here.

For completeness of this thread in case anyone searching for this problem in the future, edward gave me the correct answer:

gal_entry = hou.galleries.galleryEntries('basic_displacement')[0] 
gal_entry.createChildNode(hou.node("/shop"))

Link to comment
Share on other sites

While I see your point, are you sure that everybody who reads this forum reads the other one as well? In that case one of the forums are not needed. Otherwise it makes total sense for me to post in both forums because there might be knowledge there that does not exist here.

For completeness of this thread in case anyone searching for this problem in the future, edward gave me the correct answer:

gal_entry = hou.galleries.galleryEntries('basic_displacement')[0] 
gal_entry.createChildNode(hou.node("/shop"))

Appologize, this was a polite, friendly request. I don't want to be a capo here, nor modarate you, do what you like.

with best regards,

skk.

ps I'm simply concerned with a flood of cross posting on these used to well self organised forums brought by a new users. What makes total sense to you, brings total noise to others. I'm also pretty sure knowledge is evenly spaced on both sites. If I'm allowed to suggest something, a good practise would be to post in a first place, wait a day or two, and repeat your question on the other site in case no one answers yet. Of course you know better what makes sense to you.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...