Jump to content

[SOLVED]Create Mantra Node Syntax?


Atom

Recommended Posts

Hi All,

 

I am trying to create a mantra node and I am guessing at the syntax. I tried this code but is does not work.

mantra_surface = hou.node("/shop").createNode('mantrasurface','my_surface', run_init_scripts=False)

What is the syntax for creating a mantra surface node?

Edited by Atom
Link to comment
Share on other sites

'mantrasurface'

is not a valid type - go into shop and then hot TAB to see the list of valid types...for eg put a "Mantra Shader Builder" down, then MMB on the node and you'll see Operator Type: vopmaterial

 

then this will work:

mantra_surface = hou.node("/shop").createNode('vopmaterial','my_surface')

Link to comment
Share on other sites

Hi,

 

Mantra Surface is actually not a node type, but a gallery entry. Essentially a preset for the vopmaterial node type.

You first need to create a vopmaterial node and then apply the preset.

mantra_surface = hou.node("/shop").createNode('vopmaterial','my_surface', run_init_scripts=False)
hou.galleries.galleryEntries("mantrasurface")[0].applyToNode(mantra_surface)
Link to comment
Share on other sites

it doesn't work this way because the material is in the gallery.

 

this will Help:

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=17884&view=previous&sid=ba551930a34b14134fc4810dded192c2

gal_entry = hou.galleries.galleryEntries('mantrasurface')[0]
gal_entry.createChildNode(hou.node("/shop"))
Link to comment
Share on other sites

To clarify, the established "rule" is to post on one forum only, and if in a couple of days you get no answer then you can post to the other. Also, if you get good advice or solutions on both forums, it might be a good idea to provide a link from one to the other, so future help seekers can easier find all the good stuff..

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...