# Import Asset through console/python

**URL:** <https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522>\
**Category:** Samples & Examples\
**Created:** [January 25, 2022, 9:40am UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522 "2022-01-25T09:40:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc2002](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marc2002](https://forums.developer.nvidia.com/u/marc2002)\
**Post date:** [January 25, 2022, 9:40am UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522/1 "2022-01-25T09:40:16Z")

</div>

Hi, is there a way to import an usd asset through the script editor?

---

<div class="post-metadata">

**Author:** ![WendyGram](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/wendygram/32/157225_2.png) [@WendyGram](https://forums.developer.nvidia.com/u/WendyGram)\
**Post date:** [January 25, 2022, 5:15pm UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522/2 "2022-01-25T17:15:35Z")

</div>

So short answer is, YES! However, that is where my expertise ends. I contacted the Kit development team to help us out. Have you had a chance to look at our [Kit Programming Manual](https://docs.omniverse.nvidia.com/py/kit/index.html)?

---

<div class="post-metadata">

**Author:** ![nnikfetrat](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nnikfetrat/32/57899_2.png) [@nnikfetrat](https://forums.developer.nvidia.com/u/nnikfetrat)\
**Post date:** [January 25, 2022, 6:12pm UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522/3 "2022-01-25T18:12:20Z")

</div>

Hi! It should be something as simple as getting the context and calling open\_stage\*:

```auto
import omni.usd
omni.usd.get_context().open_stage_with_callback(path, None)

```

Please refer to “omni.usd module” section in the documentation WendyGram posted above for furter API details.

---

<div class="post-metadata">

**Author:** ![marc2002](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marc2002](https://forums.developer.nvidia.com/u/marc2002)\
**Post date:** [January 25, 2022, 6:31pm UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522/4 "2022-01-25T18:31:52Z")

</div>

Hi, thanks for the quick response. However (O cannot try it now sorry) this seems to open a stage, not to load the USD within the current scene. Is this correct? I want to do the latter, so having a USD with the environment for example, and programmatically load prim/USD inside the scene.

---

<div class="post-metadata">

**Author:** ![WendyGram](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/wendygram/32/157225_2.png) [@WendyGram](https://forums.developer.nvidia.com/u/WendyGram)\
**Post date:** [January 25, 2022, 6:55pm UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522/5 "2022-01-25T18:55:09Z")

</div>

Hello @marc2002! The development team got back to me with some coding help. This code will create a reference.

```auto
import omni.kit.commands
from omni import usd

omni.kit.commands.execute('CreateReferenceCommand',
      usd_context=omni.usd.get_context(),
      path_to='/my_prim_path',
      asset_path='C:/path/to/my_file.usd',
      instanceable=True)

```

Let me know if this helps!

---

<div class="post-metadata">

**Author:** ![marc2002](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marc2002](https://forums.developer.nvidia.com/u/marc2002)\
**Post date:** [January 26, 2022, 7:04am UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522/6 "2022-01-26T07:04:10Z")

</div>

Perfect thanks!

---

<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:** [February 9, 2022, 7:04am UTC](https://forums.developer.nvidia.com/t/import-asset-through-console-python/201522/7 "2022-02-09T07:04:44Z")

</div>

Closed on February 9, 2022, 7:04am UTC

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