# Houdini Intergration - Publish HDA?

**URL:** <https://community.shotgridsoftware.com/t/houdini-intergration-publish-hda/2998>\
**Category:** Pipeline Integrations\
**Created:** [September 21, 2019, 8:25pm UTC](https://community.shotgridsoftware.com/t/houdini-intergration-publish-hda/2998 "2019-09-21T20:25:14Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![andrewa](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@andrewa](https://community.shotgridsoftware.com/u/andrewa)\
**Post date:** [September 30, 2019, 8:02pm UTC](https://community.shotgridsoftware.com/t/houdini-intergration-publish-hda/2998/15 "2019-09-30T20:02:13Z")

</div>

**houdini\_collector.py**

In this file you should see a method called _process\_current\_session_. In there I gather all the digital assets by adding:

```auto
# HDAs
hda_nodes = list()
obj_network = hou.node("/obj")
all_nodes = obj_network.children()
for node in all_nodes:
    cur_type = node.type().definition()
    if cur_type is not None:
        hda_path = cur_type.libraryFilePath()
        hda_nodes.append(node)
if len(hda_nodes) != 0:
    self.collect_hdas(item, hda_nodes)

```

You decide how you want to collect them. I put an extra check in my version to make sure the hda name matches the current file name. Since I create versioned hda files, it makes it easier to only publish the one digital asset you need. That’s something you can decide.

This now points to a new **collect\_hdas** method. This method will add a new _item_ to the collection process. Using Shotgun’s **create\_item** method you can go ahead and do this

```auto
    def collect_hdas(self, parent_item, hda_nodes):
        """
        Creates items for HDAs to be exported
        :param parent_item: Parent Item instance
        :param hda_nodes: list of items to export
        :return:
        """
        # print "\nSorting HDA imformation for: %s\n" % hda_nodes
        # print "parent_item = %s" % parent_item
        print("\nCOLLECTING HDA ITEMS")
        geo_items = list()
        for scene_geo in hda_nodes:
            geo_item = parent_item.create_item(
                "houdini.session.hda.hdaitem",
                "Digital Asset",
                scene_geo.name()
            )
            # get the icon path to display for this item
            icon_path = os.path.join(icon_dir, "generic", "files_32.png")
            geo_item.properties['hda_node'] = scene_geo
            print("\nSetting hda_node to: %s" % scene_geo)
            definition = scene_geo.type().definition()
            geo_item.properties['hda_location'] = definition.libraryFilePath()

            geo_item.set_icon_from_path(icon_path)
            geo_items.append(geo_item)
        return geo_items

```

For each item you create, you will eventually see it in the Shotgun Publish window with a checkmark beside it. Take note that I create a new item type called:

**_houdini.session.hda.hdaitem_**

This is the item type you will be looking for later. You can see I use a lot of print statements. You can either get your feedback this way or with the logger. The print statement just sends it to the Houdini Console of Python Tab if you have one open. I usually open a new Python Tab with every change I make so I can compare the results.  
You can also create custom item properties. I have included the digital asset’s location so that it can be used in the publish process to copied over. For each item you can also attach an icon.

After this, the new **_publish\_session\_hdas.py_** script will be looking for the **_houdini.session.hda.hdaitem_** in its filter.

---

_[View the full topic](https://community.shotgridsoftware.com/t/houdini-intergration-publish-hda/2998)._
