# OmniGraph: Process bundle input

**URL:** <https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334>\
**Category:** General Discussion\
**Created:** [June 29, 2023, 6:14pm UTC](https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334 "2023-06-29T18:14:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno.vetter](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruno.vetter](https://forums.developer.nvidia.com/u/bruno.vetter)\
**Post date:** [June 29, 2023, 6:14pm UTC](https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334/1 "2023-06-29T18:14:01Z")

</div>

I want to implement an OmniGraph node in Python. It should get a bundle as an input, this bundle can contain multiple prims.

How can I extract the prims from the bundle input inside the node’s compute(db) function?

Thanks  
Bruno

---

<div class="post-metadata">

**Author:** ![mati-nvidia](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mati-nvidia/32/164558_2.png) [@mati-nvidia](https://forums.developer.nvidia.com/u/mati-nvidia)\
**Post date:** [June 30, 2023, 1:40pm UTC](https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334/2 "2023-06-30T13:40:51Z")

</div>

Hi @bruno.vetter. Have you taken a look at these two tutorials?

- [Tutorial 16 - Bundle Data — omni.graph.docs 1.11.1 documentation](https://docs.omniverse.nvidia.com/kit/docs/omni.graph.docs/latest/tutorials/tutorial16.html)
- [Tutorial 15 - Bundle Manipulation — omni.graph.docs 1.11.1 documentation](https://docs.omniverse.nvidia.com/kit/docs/omni.graph.docs/latest/tutorials/tutorial15.html)

---

<div class="post-metadata">

**Author:** ![bruno.vetter](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruno.vetter](https://forums.developer.nvidia.com/u/bruno.vetter)\
**Post date:** [June 30, 2023, 6:04pm UTC](https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334/3 "2023-06-30T18:04:29Z")

</div>

Yes, I have. These tutorials do not cover how to work with bundles containing a set of prims. For example, the Ros Publisher Nodes accept a bundle named targetPrims, containing one or more prims. When I try to process such a bundle input inside my compute function, the attributes property returns an empty list. Looking at the OmniGraph docs, there seem to be a concept of having bundles inside bundles, but I am not sure if this is what I am looking for. I haven‘t found any code samples covering this.

---

<div class="post-metadata">

**Author:** ![mati-nvidia](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mati-nvidia/32/164558_2.png) [@mati-nvidia](https://forums.developer.nvidia.com/u/mati-nvidia)\
**Post date:** [July 13, 2023, 1:41am UTC](https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334/4 "2023-07-13T01:41:49Z")

</div>

Thanks Bruno. I’ll reach out to the OmniGraph team for you.

---

<div class="post-metadata">

**Author:** ![pbarejko](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/pbarejko/32/206148_2.png) [@pbarejko](https://forums.developer.nvidia.com/u/pbarejko)\
**Post date:** [July 31, 2023, 5:25pm UTC](https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334/5 "2023-07-31T17:25:44Z")

</div>

Hi! Sincere apologizes for the delay. Here is an example OGN and Python node:

The `OgnBundleInputExample.ogn` file:

```json
{
    "BundleInputExample": {
        "version": 1,
        "description": "Example node of bundle input",
        "language": "Python",
        "exclude": ["usd", "docs"],
        "categories": "internal:test",
        "uiName": "Example Node: Bundle Input",
        "inputs": {
            "prims": {
                "type": "bundle",
                "description": ["Input Primitives in Bundle"]
            }
        },
        "outputs": {
            "count": {
                "type": "int",
                "description": ["Number of Input Primitives in Bundle"]
            }
        }
    }
}

```

The `OgnBundleInputExample.py` file:

```python
class OgnBundleInputExample:
    @staticmethod
    def compute(db) -> bool:
        input_bundle = db.inputs.prims.bundle
        child_bundles = input_bundle.get_child_bundles()
        db.outputs.count = len(child_bundles)
        return True

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [March 14, 2024, 1:37pm UTC](https://forums.developer.nvidia.com/t/omnigraph-process-bundle-input/258334/6 "2024-03-14T13:37:49Z")

</div>

Closed on March 14, 2024, 1:37pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
