Saving a subnetwork as HDA?

   996   3   0
User Avatar
Member
6 posts
Joined: Feb. 2017
Offline
From inside the material library, is it possible to Save a custom Karma material builder or material subnet as a HDA. I created a HDA using karma material builder as a base and inside is just a mtlx setup, then saved it out as a HDA. But it doesn't show up on list anywhere. Is this possible to do, it worked okay in sop and stage context?
User Avatar
Member
6 posts
Joined: Feb. 2017
Offline
Well not the best solution but slightly better/more concise than dragging to shelf
import hou

cwd = hou.selectedItems()[0].parent()
node = cwd.createNode('User::base_texture_mtl::1.0', 'base_texture_mtl')
node.setGenericFlag(hou.nodeFlag.Material, True)
As shelf tool - downsides need to have node(s) selected, but okay if something messes up or need to version up
User Avatar
Member
8 posts
Joined: Oct. 2014
Online
In the ‘material libray’ node, there is a parameter called ‘Tab Menu Mask’. It seems to define what kind of nodes can be displayed in the menu. I ended the name of my node with ‘builder’, and it successfully appeared in the menu.

Regarding ‘nodeFlag’, I use Python in ‘OnCreate’ to control it.

This may not be the best solution, but it has indeed solved some problems.


Edited by chongsong - March 11, 2024 06:00:36

Attachments:
zzzz.png (87.0 KB)
Screenshot 2024-03-11 175034.png (56.5 KB)
Screenshot 2024-03-11 175755.png (61.2 KB)

User Avatar
Member
6 posts
Joined: Feb. 2017
Offline
Yeah very cool, does seem to work. Missed the big note at top of docs for 20.0 update . Additionally if you right click 'Tab Menu Mask', can set 'Make current value Default' for custom additions. Works for in-project as far
  • Quick Links