Jump to content
Sign in to follow this  
Atom

[SOLVED]Create Mantra Node Syntax?

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

Share this post


Link to post
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')

Share this post


Link to post
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)

Share this post


Link to post
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"))

Share this post


Link to post
Share on other sites

Thanks eetu that worked!

 

@Mandrake0: Indeed, that is the fastest turn around yet!

Edited by Atom

Share this post


Link to post
Share on other sites

Yeah :)

 

BTW Atom/Enivob, you do not need to crosspost your questions on both forums - pretty much the same people frequent both, and it feels a bit cluttered to read the same messages on both..

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites

Got it, I wondered about that?

 

I check both daily myself.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×